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

Merged
KH
8mo ago
+137-26

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