Repository navigation
feat(channel): add response sanitizer + fix setup.sh dep install - #37
Merged
Merged
Conversation
Adds sanitizeAgentResponse() to strip internal noise from agent messages before they reach users: - Reasoning: _italic block_ prefixes (leading and mid-text) - Italic self-talk preamble (_thinking out loud_ before the answer) - System identity blocks (🧭 Identity, 🦞 OpenClaw status) - Metadata lines (Runtime, Channel, Session, etc.) - [self-reference] tags - Reasoning toggle lines (Reasoning: on/off) Applied at all three message paths: async dispatch, sync dispatch, and outbound sendText. Also ports org_id fallback and agent_name fields to error callbacks. Fixes setup.sh sync to run npm install after copying extension files. Without this, rsync wipes node_modules and the plugin fails to load (@sinclair/typebox missing). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sanitizeAgentResponse()function strips reasoning blocks, system metadata, identity blocks, italic self-talk preamble, and excessive newlines from agent output before it reaches users. Applied to all 3 message paths (ASYNC dispatch, outbound sendText, SYNC dispatch).setup.sh syncnow runsnpm install --omit=devafter rsync, preventing broken plugin loads caused byrsync --deletewipingnode_modules/.payload.org_id || payload.space_id || session.spaceIdto avoid null org_id.agent_nameandmessage_idto SYNC error callback for better traceability.Sanitizer rules
Reasoning: _..._blocks (leading and mid-text)Reasoning:blocks up to double newline_internal thoughts_before the real answer)Test plan
setup.sh syncinstalls deps automatically after rsyncCannot find moduleerrors after sync🤖 Generated with Claude Code