[Bug] SendMessage(to: "main") from background subagent silently dropped instead of reaching spawner
Bug Description
▎ SendMessage(to: "main") from a background subagent is silently dropped instead of reaching the spawning session.
▎
▎ The SendMessage tool documents to: "main" as the way a background subagent reaches "the main conversation." In practice the spawner never receives it — the subagent completes, emits an idle_notification, and its content is lost with no error. The mechanism appears to be that "main" resolves relative to the caller, so in a subagent's runtime it addresses itself.
▎
▎ Repro (clean config, no custom hooks): from a main session, spawn a background Agent-tool subagent whose only action is SendMessage(to:"main","PING") and end; the main session never receives "PING".
▎
▎ Expected: the message reaches the spawning conversation (per the tool's to docs).
▎ Impact: silent data loss in multi-agent / dynamic-workflow runs — a subagent's entire (possibly expensive) output can vanish. Forces file-write / transcript-scraping workarounds.
▎ Confidence: message-non-delivery directly observed multiple times (2026-07-02 and 2026-07-10); the exact "resolves to self" mechanism is inferred. A clean repro on our machine is currently masked by a PreToolUse hook we installed to block to:"main" because of this bug.
▎ Suggested fix: make to:"main" resolve to the spawner for subagents (match the docs), or fail loudly (return a delivery error) and correct the tool documentation.
Environment Info
- Platform: darwin
- Terminal: xterm-256color
- Version: 2.1.205
- Feedback ID: 58effc07-8344-49b3-88f3-f26179dd0bff
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗