Symptom
Nested subagents often render as ⚠ orphan in the recursive widget tree. Suspected cause: a parent agent reaches a terminal state (completed / aborted / stopped / cleared) while children are still running or still referenced; the tree builder marks any node whose parentAgentId is missing from the live snapshot set as orphaned.
Desired behavior
- A parent that still has running or queued subagents must stay alive (not treated as finished / cleared / pruned) until those children settle — or until an explicit cascade abort.
- Healthy recursive children should not show as orphans merely because the parent turn ended.
- Must work recursively (grandparent → parent → child).
Investigation hooks
src/ui/agent-widget-tree.ts — orphaned when parent id is missing from tree nodes
AgentManager completion / clearCompleted / session switch
- Parent natural completion currently does not hold for live children
session_shutdown → abortAll is a separate intentional teardown path
Acceptance
Related
Local log: bugs.txt (parents-with-running-children-stay-alive / orphan widget)
Symptom
Nested subagents often render as
⚠ orphanin the recursive widget tree. Suspected cause: a parent agent reaches a terminal state (completed / aborted / stopped / cleared) while children are still running or still referenced; the tree builder marks any node whoseparentAgentIdis missing from the live snapshot set as orphaned.Desired behavior
Investigation hooks
src/ui/agent-widget-tree.ts—orphanedwhen parent id is missing from tree nodesAgentManagercompletion /clearCompleted/ session switchsession_shutdown→abortAllis a separate intentional teardown pathAcceptance
⚠ orphansolely due to parent turn endRelated
Local log:
bugs.txt(parents-with-running-children-stay-alive / orphan widget)