Skip to content

fix(wrap): add RELAY_SKIP_PROMPT and self-echo filtering#641

Merged
khaliqgant merged 7 commits intomainfrom
feature/wrap-skip-prompt-self-echo
Mar 25, 2026
Merged

fix(wrap): add RELAY_SKIP_PROMPT and self-echo filtering#641
khaliqgant merged 7 commits intomainfrom
feature/wrap-skip-prompt-self-echo

Conversation

@khaliqgant
Copy link
Member

@khaliqgant khaliqgant commented Mar 25, 2026

Summary

  • RELAY_SKIP_PROMPT=1 env var suppresses the <system-reminder> XML block in injected messages. Just delivers the raw relay message text.
  • Adds RELAY_AGENT_NAME to the broker's self_names set so messages from the agent's own MCP server are filtered as self-echo.

Motivation

When the wrap command is used in interactive terminals (Superset desktop app), the system-reminder block confuses both agents and users. The self-echo issue occurred because the MCP server inside the agent registers with the same name but the broker didn't recognize it as "self".

Test plan

  • RELAY_SKIP_PROMPT=1 agent-relay-broker wrap claude -- --help — no system-reminder in output
  • Agent posting to #general doesn't see its own message echoed back
  • cargo test passes (verified: all 85 unit + 12 continuity + 8 e2e tests green)

Generated with Claude Code


Open with Devin

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

khaliqgant and others added 2 commits March 25, 2026 15:50
Two fixes for the wrap command when used in interactive terminal
environments (e.g. Superset desktop app):

1. RELAY_SKIP_PROMPT=1 env var suppresses the <system-reminder> block
   that wraps injected messages. In interactive terminals, this XML
   noise confuses both the agent and the user.

2. Add RELAY_AGENT_NAME to self_names so messages sent by the agent's
   own MCP server (which registers with the same name) are filtered
   as self-echo instead of being re-injected into the PTY.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only deliver DMs addressed to this agent. Previously all DMs on the
workspace were injected into every agent's PTY. Channel messages
(target starts with '#') are still broadcast to all subscribers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant force-pushed the feature/wrap-skip-prompt-self-echo branch from e69e6b2 to effe2aa Compare March 25, 2026 14:51
devin-ai-integration[bot]

This comment was marked as resolved.

khaliqgant and others added 4 commits March 25, 2026 16:23
…d conversation_id targets

Devin review caught that the filter was too aggressive — it silently
dropped messages with empty targets (presence), 'thread' targets
(thread replies), and dm_/conv_ prefixed targets (conversation_id
fallback). Only drop messages clearly addressed to a different agent.
@khaliqgant khaliqgant merged commit 10115cf into main Mar 25, 2026
40 checks passed
@khaliqgant khaliqgant deleted the feature/wrap-skip-prompt-self-echo branch March 25, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant