You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(session): notify parent when subagent sessions finish #35066
Subagent sessions with a parent session should write a synthetic result message back into the parent when the child session finishes.
Foreground task tool calls are the exception: the parent already receives the subagent output in the tool result, so the child completion path should suppress the synthetic parent prompt while that foreground job is still owned by the task tool.
Occurrence: headless serve — child completion never notifies the parent
Observed today on opencode 1.18.15/1.18.16 headless opencode serve (Linux), driving an autonomous SDD workflow through the serve HTTP API:
5/5 orchestrator sessions had a foreground task tool part stuck running forever while the child sub-agent session had already finished its work (its parts show complete reads/writes, batch-flushed). The child-completion notification never reached the parent, so the parent turn never resumed.
The same binary/providers/network in interactive TUI sessions: 226 task parts across all sessions — 132 completed + 89 errored + 5 running — i.e. 96%+ resolve. The TUI receives the completion; the headless serve does not.
The stuck-parent signature appears to ride on a tool-completion envelope drop: in a controlled probe on a freshly-recycled serve, one session ran read/glob/bash — glob and bash flipped to completed with output present, the read stayed running with no output for 300s until the caller aborted. Work completes; the completion envelope selectively never lands; the turn stalls.
Recovery on our side works by artifact-checking the child work from disk (the work is done), but the parent session itself never completes — exactly the gap this issue addresses.
This issue (and the draft PR #35041) would fix the class we are hitting at scale. Happy to add any of the probe details or raw part-state dumps if useful.
#45482 addresses this — a caller's Task call is now held until the children it started have settled, and an idle parent is woken so a late result is actually observed.
In V2, when a subagent session finishes, its result is posted to the parent session as a <subagent ...> message with the final state, and an idle parent is resumed by default so it can act on the result.
Wired up in #34320; delivery is shared since #46054.
Activity
opencode-agent commentedon Jul 3, 2026
@kitlangton tagging you here for the subagent parent-notification issue. Draft PR: #35041
test(opencode): add regression test for lost terminal-iteration wakeup
EnigmaJazz commentedon Aug 11, 2026
Occurrence: headless serve — child completion never notifies the parent
Observed today on opencode 1.18.15/1.18.16 headless
opencode serve(Linux), driving an autonomous SDD workflow through the serve HTTP API:tasktool part stuckrunningforever while the child sub-agent session had already finished its work (its parts show complete reads/writes, batch-flushed). The child-completion notification never reached the parent, so the parent turn never resumed.completedwith output present, the read stayedrunningwith no output for 300s until the caller aborted. Work completes; the completion envelope selectively never lands; the turn stalls.This issue (and the draft PR #35041) would fix the class we are hitting at scale. Happy to add any of the probe details or raw part-state dumps if useful.
NamedIdentity commentedon Aug 27, 2026
#45482 addresses this — a caller's Task call is now held until the children it started have settled, and an idle parent is woken so a late result is actually observed.
neriousy commentedon Oct 1, 2026
In V2, when a subagent session finishes, its result is posted to the parent session as a
<subagent ...>message with the final state, and an idle parent is resumed by default so it can act on the result.Wired up in #34320; delivery is shared since #46054.
Closing as completed.
fix(runner): queue work when already running instead of discarding