Repository navigation
fix: stop hidden helper agents posting raw reports to your chat - #206570
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesSuppresses automatic chat delivery of hidden helpers’ wake replies while preserving visible and conversation-bound sessions. Example: A hidden helper runs
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it provides a focused fix for a current delivery bug, with no actionable correctness findings. Reviewed head: Before merge
FindingsNone. Agent review detailsHow this fits togetherBackground completions capture a session-event target, execute a follow-up turn, and route its output; hidden helpers separately return results through the subagent completion owner. flowchart TD
A[Background command completes] --> B[Session event target]
B --> C[Helper wake turn]
C --> D[Automatic chat delivery]
C --> E[Subagent completion owner]
E --> F[Parent agent]
F --> G[User chat]
Technical reviewBest possible solution: Keep the focused suppression in the existing session-event target owner with visible and bound-session delivery preserved. Do we have a high-confidence way to reproduce the issue? Current-main source traces the inherited requester route from exec completion into unsuppressed event delivery, consistent with the contributor’s real Telegram reproduction. Is this the best way to solve the issue? The patch fixes the shared delivery decision without adding another execution path, and preserves the existing completion handoff and conversation-binding contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4fd7d7af0e74. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +15, Tests +58, Docs +2. Total +75 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 29, 2026, 5:11 AM ET / 10:11 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
e3c8a49 to
49eba8e
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
subagent-capabilities reaches session-event-target through config/sessions, so the static import formed a runtime import cycle (check:import-cycles). Load it in the already-async capture, like the session entry reader next to it.
|
Live proof lines for c428bfa (Telegram Test Server DM; Discord QA Lab for the thread-bound control): |
|
Landed in 2a428f2. Thanks @stealthybear for the report, the live repro and the fix, and @Nocha12 for #206708 and the active-binding exception from #206709. A hidden helper agent's wake reply now goes only to its parent, so you see one summary instead of the helper's raw report plus the summary. Visible spawns, thread-bound subagents and persistent ACP sessions still reply in their own conversation. |
…570) Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 03cdb2cef17) captures `deliver` from the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat. Fixes #206556 Fixes #206708 Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for #206708 and for #206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries. ## What Problem This Solves When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary. ## User Impact A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration. ## Why This Change Was Made The event target capture, which already decides `deliver: false` for private producers, now also sets it when the destination is a hidden subagent (`isSubagentEnvelopeSession` and not `isVisibleSpawnedSession`) with no active conversation binding (`listSessionBindingsBySessionAsync`). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (`subagent-capabilities -> config/sessions -> ... -> session-event-target`). ## Evidence Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs `exec` in the background, calls `sessions_yield`, and replies a marker when the exit wakes it. | Build | Helper's raw reply in the DM | Parent got the helper's result | Parent's summary in the DM | | --- | --- | --- | --- | | main 73940d31e75 (2 runs), 03cdb2cef17 (1 run) | yes, every run | yes | yes | | this PR c428bfac7aa (2 runs) | no | yes | yes | | `visible: true` control, main and this PR | yes (posts as before) | n/a | n/a | Thread-bound control: Telegram has no thread-bound spawn (its binding placement is `current`), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check, `thread: true, mode: "session"` spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (`expected false to be undefined`) and passes with it. Observed proof lines: openclaw/openclaw#206570 (comment). Local review on c428bfac7aa: no findings. Tests: `session-event-handoff.test.ts` plus the 12 test files that import `session-event-target.ts` pass (151 tests); `check:import-cycles` reports 0 cycles. Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):  Related, separate: #168227, #198204, #200046. Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
…570) Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 03cdb2cef17) captures `deliver` from the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat. Fixes #206556 Fixes #206708 Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for #206708 and for #206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries. ## What Problem This Solves When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary. ## User Impact A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration. ## Why This Change Was Made The event target capture, which already decides `deliver: false` for private producers, now also sets it when the destination is a hidden subagent (`isSubagentEnvelopeSession` and not `isVisibleSpawnedSession`) with no active conversation binding (`listSessionBindingsBySessionAsync`). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (`subagent-capabilities -> config/sessions -> ... -> session-event-target`). ## Evidence Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs `exec` in the background, calls `sessions_yield`, and replies a marker when the exit wakes it. | Build | Helper's raw reply in the DM | Parent got the helper's result | Parent's summary in the DM | | --- | --- | --- | --- | | main 73940d31e75 (2 runs), 03cdb2cef17 (1 run) | yes, every run | yes | yes | | this PR c428bfac7aa (2 runs) | no | yes | yes | | `visible: true` control, main and this PR | yes (posts as before) | n/a | n/a | Thread-bound control: Telegram has no thread-bound spawn (its binding placement is `current`), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check, `thread: true, mode: "session"` spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (`expected false to be undefined`) and passes with it. Observed proof lines: openclaw/openclaw#206570 (comment). Local review on c428bfac7aa: no findings. Tests: `session-event-handoff.test.ts` plus the 12 test files that import `session-event-target.ts` pass (151 tests); `check:import-cycles` reports 0 cycles. Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):  Related, separate: #168227, #198204, #200046. Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
…570) Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 03cdb2cef17) captures `deliver` from the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat. Fixes #206556 Fixes #206708 Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for #206708 and for #206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries. ## What Problem This Solves When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary. ## User Impact A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration. ## Why This Change Was Made The event target capture, which already decides `deliver: false` for private producers, now also sets it when the destination is a hidden subagent (`isSubagentEnvelopeSession` and not `isVisibleSpawnedSession`) with no active conversation binding (`listSessionBindingsBySessionAsync`). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (`subagent-capabilities -> config/sessions -> ... -> session-event-target`). ## Evidence Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs `exec` in the background, calls `sessions_yield`, and replies a marker when the exit wakes it. | Build | Helper's raw reply in the DM | Parent got the helper's result | Parent's summary in the DM | | --- | --- | --- | --- | | main 73940d31e75 (2 runs), 03cdb2cef17 (1 run) | yes, every run | yes | yes | | this PR c428bfac7aa (2 runs) | no | yes | yes | | `visible: true` control, main and this PR | yes (posts as before) | n/a | n/a | Thread-bound control: Telegram has no thread-bound spawn (its binding placement is `current`), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check, `thread: true, mode: "session"` spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (`expected false to be undefined`) and passes with it. Observed proof lines: openclaw/openclaw#206570 (comment). Local review on c428bfac7aa: no findings. Tests: `session-event-handoff.test.ts` plus the 12 test files that import `session-event-target.ts` pass (151 tests); `check:import-cycles` reports 0 cycles. Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):  Related, separate: #168227, #198204, #200046. Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
) Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 03cdb2c) captures `deliver` from the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat. Fixes #206556 Fixes #206708 Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for #206708 and for #206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries. ## What Problem This Solves When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary. ## User Impact A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration. ## Why This Change Was Made The event target capture, which already decides `deliver: false` for private producers, now also sets it when the destination is a hidden subagent (`isSubagentEnvelopeSession` and not `isVisibleSpawnedSession`) with no active conversation binding (`listSessionBindingsBySessionAsync`). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (`subagent-capabilities -> config/sessions -> ... -> session-event-target`). ## Evidence Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs `exec` in the background, calls `sessions_yield`, and replies a marker when the exit wakes it. | Build | Helper's raw reply in the DM | Parent got the helper's result | Parent's summary in the DM | | --- | --- | --- | --- | | main 73940d3 (2 runs), 03cdb2c (1 run) | yes, every run | yes | yes | | this PR c428bfa (2 runs) | no | yes | yes | | `visible: true` control, main and this PR | yes (posts as before) | n/a | n/a | Thread-bound control: Telegram has no thread-bound spawn (its binding placement is `current`), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check, `thread: true, mode: "session"` spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (`expected false to be undefined`) and passes with it. Observed proof lines: #206570 (comment). Local review on c428bfa: no findings. Tests: `session-event-handoff.test.ts` plus the 12 test files that import `session-event-target.ts` pass (151 tests); `check:import-cycles` reports 0 cycles. Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):  Related, separate: #168227, #198204, #200046. Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]> Follow-up scan: 34d4f8f improve: list Docker streams and flag unconfirmed cleanup in Doctor (#201292); 21786f6 refactor(ui): stop sending 28 additional unused labels to translators (#207982); 9cec330 refactor(workboard): group session tiles without rescanning each column (#207380); 16a2d4b refactor(ui): lowercase log search text only once (#207383). Other hits are not required by this focused beta.2 fix. (cherry picked from commit 2a428f2) Co-authored-by: RomneyDa <[email protected]>
) Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 03cdb2c) captures `deliver` from the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat. Fixes #206556 Fixes #206708 Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for #206708 and for #206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries. ## What Problem This Solves When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary. ## User Impact A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration. ## Why This Change Was Made The event target capture, which already decides `deliver: false` for private producers, now also sets it when the destination is a hidden subagent (`isSubagentEnvelopeSession` and not `isVisibleSpawnedSession`) with no active conversation binding (`listSessionBindingsBySessionAsync`). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (`subagent-capabilities -> config/sessions -> ... -> session-event-target`). ## Evidence Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs `exec` in the background, calls `sessions_yield`, and replies a marker when the exit wakes it. | Build | Helper's raw reply in the DM | Parent got the helper's result | Parent's summary in the DM | | --- | --- | --- | --- | | main 73940d3 (2 runs), 03cdb2c (1 run) | yes, every run | yes | yes | | this PR c428bfa (2 runs) | no | yes | yes | | `visible: true` control, main and this PR | yes (posts as before) | n/a | n/a | Thread-bound control: Telegram has no thread-bound spawn (its binding placement is `current`), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check, `thread: true, mode: "session"` spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (`expected false to be undefined`) and passes with it. Observed proof lines: #206570 (comment). Local review on c428bfa: no findings. Tests: `session-event-handoff.test.ts` plus the 12 test files that import `session-event-target.ts` pass (151 tests); `check:import-cycles` reports 0 cycles. Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):  Related, separate: #168227, #198204, #200046. Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 2a428f2) Release adaptation: Suppress only hidden unbound helper events at the stable target capture; honor explicit delivery restrictions, visible sessions, active bindings, and the existing scheduled/requester custody. Companion audit: PR #206570 uses existing binding and spawn classifiers. Resume the stopped cherry-pick at the stable agent-run registry import anchor without importing main-only authority handlers. Co-authored-by: RomneyDa <[email protected]>
…claw#206570) Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 7e9542f) captures `deliver` from the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat. Fixes openclaw#206556 Fixes openclaw#206708 Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for openclaw#206708 and for openclaw#206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries. ## What Problem This Solves When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary. ## User Impact A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration. ## Why This Change Was Made The event target capture, which already decides `deliver: false` for private producers, now also sets it when the destination is a hidden subagent (`isSubagentEnvelopeSession` and not `isVisibleSpawnedSession`) with no active conversation binding (`listSessionBindingsBySessionAsync`). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (`subagent-capabilities -> config/sessions -> ... -> session-event-target`). ## Evidence Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs `exec` in the background, calls `sessions_yield`, and replies a marker when the exit wakes it. | Build | Helper's raw reply in the DM | Parent got the helper's result | Parent's summary in the DM | | --- | --- | --- | --- | | main 2877834 (2 runs), 7e9542f (1 run) | yes, every run | yes | yes | | this PR c428bfa (2 runs) | no | yes | yes | | `visible: true` control, main and this PR | yes (posts as before) | n/a | n/a | Thread-bound control: Telegram has no thread-bound spawn (its binding placement is `current`), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check, `thread: true, mode: "session"` spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (`expected false to be undefined`) and passes with it. Observed proof lines: openclaw#206570 (comment). Local review on c428bfa: no findings. Tests: `session-event-handoff.test.ts` plus the 12 test files that import `session-event-target.ts` pass (151 tests); `check:import-cycles` reports 0 cycles. Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):  Related, separate: openclaw#168227, openclaw#198204, openclaw#200046. Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
Root cause: src/auto-reply/reply/session-event-target.ts:156 (base 03cdb2c) captures
deliverfrom the producing run only, so a hidden subagent's exec-wake turn keeps the requester's chat route with delivery on, and its reply is posted to that chat.Fixes #206556
Fixes #206708
Thanks @stealthybear for the report, the fix and the live repro, and @Nocha12 for #206708 and for #206709, whose active-binding exception (thread-bound subagents and persistent ACP sessions keep replying in their own conversation) this PR now carries.
What Problem This Solves
When an agent hands work to a hidden helper (a subagent) that runs a background command and waits for it, the helper's reply after the command finishes is posted straight to your chat, for example your Telegram DM with the bot. The parent agent also gets that reply and posts its own summary, so you see two messages for one result: first the helper's raw report (sometimes with notes meant only for the parent), then the summary.
User Impact
A hidden helper's wake reply now reaches only its parent agent, so you see one summary instead of two. The parent still gets the helper's result through its normal finished-task report. Visible spawned sessions keep posting to the chat as before, and thread-bound helpers and persistent ACP sessions bound to their own conversation keep replying in that thread. No setting, schema or migration.
Why This Change Was Made
The event target capture, which already decides
deliver: falsefor private producers, now also sets it when the destination is a hidden subagent (isSubagentEnvelopeSessionand notisVisibleSpawnedSession) with no active conversation binding (listSessionBindingsBySessionAsync). Without the binding check a thread-bound subagent would stop replying in its own thread. The capabilities module is loaded lazily in the async capture because a static import formed a runtime import cycle (subagent-capabilities -> config/sessions -> ... -> session-event-target).Evidence
Live Telegram Test Server DM, real Gateway, Telegram delivery, spawn, exec, yield, wake and announce; only the model is scripted. The DM asks the agent to spawn a hidden helper that runs
execin the background, callssessions_yield, and replies a marker when the exit wakes it.visible: truecontrol, main and this PRThread-bound control: Telegram has no thread-bound spawn (its binding placement is
current), so the thread case ran on Discord through QA Lab: on this head and on the earlier head without the binding check,thread: true, mode: "session"spawns, the child's exec wake runs and it replies. That lane's recorder cannot see SUT-created threads, so the thread message itself is covered by the unit case below, which fails without the binding check (expected false to be undefined) and passes with it.Observed proof lines: #206570 (comment). Local review on c428bfa: no findings. Tests:
session-event-handoff.test.tsplus the 12 test files that importsession-event-target.tspass (151 tests);check:import-cyclesreports 0 cycles.Earlier live evidence from @stealthybear (released 2026.11.10, real model on a real Telegram bot):
Related, separate: #168227, #198204, #200046.
Merge danger: two-way door. A revert restores the duplicate post; nothing is stored, migrated or published. Blast radius: event turns (exec wakes, tool handoff results) of hidden subagent sessions without an active binding; ordinary, visible and bound sessions are unchanged.