Skip to content

fix(subagents): #341 lifecycle — wait_agent terminal inference, stale status, pruning (P2a) - #459

Merged
Juliusolsson05 merged 1 commit into
integration/rendering-pipelinefrom
fix/subagent-lifecycle-341
Jul 7, 2026
Merged

Juliusolsson05 merged 1 commit into
integration/rendering-pipelinefrom
fix/subagent-lifecycle-341

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Residue plan P2a — the #341 lifecycle gaps behind the 06-21 bundle's 57/73 stuck-running children:

  1. wait_agent terminal inference: MCP-spawned codex children get no notification — the parent's wait_agent output ({"status":{"<agent-uuid>":{"completed"|"failed"…}}}, shape verified against real rollouts) is now parsed and feeds done/error.
  2. stale status (shared type + both builders + row treatment): 5 quiet minutes while nominally running ⇒ "gone quiet Nm" (◌), never an eternal spinner, never fabricated completion.
  3. Pruning (both watchers): terminal >10 min ⇒ fold state dropped (durable truth is in the parent transcript); metaByAgent previously grew forever on resumed sessions. Stale children deliberately stay tracked for late revival.

Injectable nowMs for tests. 15 subagent tests; both tsc gates clean.

🤖 Generated with Claude Code

… status, pruning

The 2026-06-21 bundle's pathology (57/73 children stuck "running"
forever) had three lifecycle gaps, all fixed here (residue plan P2a):

1. wait_agent terminal inference: codex MCP-spawned children get NO
   subagent notification - the parent's wait_agent function_call_output
   ({"status":{"<agent-uuid>":{"completed"|"failed"|...}}}, shape
   verified against real on-disk rollouts) is the ONLY terminal signal.
   The tracker now records wait call ids, parses their outputs, and
   feeds done/error into status derivation.

2. 'stale' status (shared type + both builders + row glyph/label): a
   nominally-running child with no transcript activity for 5 minutes is
   presumed dead/hung - painted as "gone quiet Nm" (glyph ◌), never an
   eternal spinner and never a fabricated "done".

3. Pruning (both watchers): children terminal for >10 minutes drop from
   the fold maps - their durable truth lives in the parent transcript by
   then. metaByAgent was previously never pruned, so resumed sessions
   accumulated every child ever spawned. Terminal-only: stale children
   stay tracked so late revival can flip them back to running.

Builders take injectable nowMs so tests do not fake timers. 15 subagent
tests green; unit project green; both tsc gates clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 merged commit 9e74604 into integration/rendering-pipeline Jul 7, 2026
@Juliusolsson05
Juliusolsson05 deleted the fix/subagent-lifecycle-341 branch July 7, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant