Skip to content

Parents with running subagents finish early → children show ⚠ orphan #1

Description

@XertroV

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.tsorphaned when parent id is missing from tree nodes
  • AgentManager completion / clearCompleted / session switch
  • Parent natural completion currently does not hold for live children
  • session_shutdownabortAll is a separate intentional teardown path

Acceptance

  • Parent with live children remains non-terminal (or remains visible in the tree as an active parent) until children complete or are aborted with the parent
  • Nested agents under a still-running lineage do not show ⚠ orphan solely due to parent turn end
  • Recursive depth 2+ covered by tests
  • Session teardown still aborts/cleans children cleanly

Related

Local log: bugs.txt (parents-with-running-children-stay-alive / orphan widget)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions