Repository navigation
fix(subagents): #341 lifecycle — wait_agent terminal inference, stale status, pruning (P2a) - #459
Merged
Juliusolsson05 merged 1 commit intoJul 7, 2026
Conversation
… 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>
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Residue plan P2a — the #341 lifecycle gaps behind the 06-21 bundle's 57/73 stuck-running children:
wait_agentoutput ({"status":{"<agent-uuid>":{"completed"|"failed"…}}}, shape verified against real rollouts) is now parsed and feeds done/error.stalestatus (shared type + both builders + row treatment): 5 quiet minutes while nominally running ⇒ "gone quiet Nm" (◌), never an eternal spinner, never fabricated completion.metaByAgentpreviously grew forever on resumed sessions. Stale children deliberately stay tracked for late revival.Injectable
nowMsfor tests. 15 subagent tests; both tsc gates clean.🤖 Generated with Claude Code