-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Bug: sessions_yield subagent completion delivered as passive context — LLM can silently ignore it, breaking orchestration loops #92116
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Environment
sessions_yieldto orchestrate subagentsProblem
When a parent agent uses
sessions_yieldto wait for subagent completions, the completion is delivered by injecting it as passive prompt context into the parent agent's next turn. The parent agent is expected to read this context, recognize that a subagent has completed, and take appropriate action (verify results → update plan → continue or finish).However, LLMs inherently treat prompt context as reference material that may be acted upon or ignored — there is no mechanism forcing the parent agent to process the completion event. Whether the parent agent picks up the completion and continues the orchestration loop, or ignores it and produces unrelated output, is entirely determined by the LLM's non-deterministic behavior on that specific turn.
This means a multi-agent orchestration loop (subagent-complete → parent-review → continue/end) can silently break at any turn, with no error, no recovery path, and no indication that anything went wrong.
Diagnostic Evidence
We injected 5 console.log diagnostic points into
sendSubagentAnnounceDirectly(insubagent-announce-deliverymodule) to trace the delivery path:subagent_announce_active_checkisActiveafterresolveRequesterSessionActivity()subagent_announce_steer_attemptisActive==truesubagent_announce_steer_resultresolveActiveWakeWithRetries()subagent_announce_direct_deliveryshouldDeliver/hasChannelflagssubagent_announce_resultLog from a subagent completion event:
The delivery path is correct:
sessions_yieldcorrectly sets the parent session to non-active, the direct delivery path is taken, anddelivered: trueconfirms the completion message was injected into the parent session's prompt context.Observed parent agent behavior (3 attempts, same scenario):
sessions_yieldSame completion format, same Delegate persona, same Gateway configuration — three different outcomes, two of which silently broke the orchestration workflow.
Root Cause
The root cause is the delivery mechanism itself, not prompt wording or instruction conflicts. Subagent completion is delivered as passive prompt context, and LLMs inherently treat all context as optional — reference material they may read and act on, or skip and ignore.
For a critical workflow step like "subagent reports completion to parent", a passive context injection is too weak. The parent agent needs a stronger harness that forces it to process the completion result rather than offering it as one of many context blocks the LLM can overlook.
The problem is not contradictory instructions — it's that no instruction in prompt context can guarantee execution by an LLM. Context is, by definition, advisory.