Nested subagents remain stuck as "Running" in Background tasks panel after parent subagent completes
Bug description
When a subagent (dispatched via the Agent tool) spawns its own nested subagents, those grandchild agents remain listed as Running in the Background tasks panel indefinitely after the parent subagent completes — in my case for 11+ hours (see screenshot).
The work itself finished: the parent subagents (code reviewers in a subagent-driven workflow) returned their reports containing the results of these nested verification agents. Only the panel state is stale — token counts and tool-use counts are frozen.
What I observed
- 5 nested agents stuck as "Running" for 11h+ (e.g. "Check parseReaisToCents impl", "Verify subcategoryId zod validation") — all spawned by reviewer subagents, not by the main session.
- Their token/tool counters never advance (frozen at 25–61k tokens).
- Calling
TaskStopfrom the main session returns "No task found with ID: <id>" for these agents — the main session's task registry doesn't know them, so there is no way to stop/dismiss them programmatically. - The parent subagents completed normally and their final reports include the nested agents' findings, so this appears to be a lifecycle/registration issue: nested-agent completion is never propagated to the Background tasks panel once the parent context is gone.
Repro sketch
- Main session dispatches subagent A (Agent tool, e.g. a code-reviewer prompt).
- Subagent A itself dispatches one or more nested agents to verify specific claims.
- Subagent A completes and returns its report.
- Open the Background tasks panel: the nested agents from step 2 remain under "Running" forever;
TaskStopwith their ids fails with "No task found".
Environment
- Claude Code (desktop app, macOS Darwin 25.3.0)
- Model: claude-fable-5
- Multi-subagent flow (implementer/reviewer pattern), reviewers on sonnet
Screenshot
<img width="804" height="1066" alt="Image" src="https://github.com/user-attachments/assets/441a6186-5010-4eaa-83a5-2148f65d83cf" />
Issue co-authored by Claude Fable 5 - Interestingly enough I the human had to come in and type this part
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗