Subagent ends its turn right after starting background work; parent receives "I'll wait" as the final report and stalls
Status Open
Reported on v2.1.294
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 1 comment · opened Oct 8, 2026
Summary
A subagent starts background work, either a nested Agent call or a Bash call with run_in_background: true. It then ends its turn with text such as "I'll wait for the notification." The turn end counts as the subagent's completion. The parent receives "I'll wait" as the subagent's final report. The background work finishes later, but nothing resumes the subagent, so the parent never gets the result.
Environment
- Claude Code 2.1.294
- macOS (Darwin 25.5.0)
- Subagents are custom agent types with pinned effort (
haiku-medium,sonnet-low,opus-low)
Reproduction
- The main session starts subagent A with the
Agenttool (foreground). - Subagent A starts a nested
Agentcall and omitsrun_in_background. The transcript shows norun_in_backgroundkey on that call. The nested agent's metadata recordsrequestShape: "background". - Subagent A ends its turn with "I'll wait for the result."
- The parent receives that text as subagent A's final output. The nested agent reports later, and nothing reads it.
The same happens when subagent A starts Bash with run_in_background: true and then ends its turn.
Evidence
- A heuristic scan of local transcripts (June to October 2026) found 37 subagent runs whose last tool call was a background
Agentlaunch, and 6 whose last tool call was a backgroundBashlaunch. Not every run stalled. I did not verify each case by hand. - Two of these runs on 2026-10-08 stalled in front of the user.
Workaround tested (not a fix)
- A
PreToolUsehook onAgent|TaskreturnedupdatedInputwithrun_in_background: falsewhen the hook input containedagent_id.agent_idappears only in hook input from inside a subagent. The nested call then ran in the foreground, and its result returned to the subagent. - A
SubagentStophook that blocks the first stop when the last tool call launched background work made a subagent wait inside its turn and report the result. I tested this with a backgroundBashtask.
Expected
One of:
- A subagent's final message does not go to the parent while work the subagent launched is still pending.
- Background work can resume a subagent that has ended its turn.
- Nested
Agentcalls inside a subagent default to foreground.
Related
- #83848: stalls with
status: completedand no final text. This report adds the trigger: the turn end after a background launch. - #74317: fabricated "waiting for background agent" stall.
- #91225 and #100117:
run_in_backgroundhandling under the fork-subagent path. These may share a cause. Unverified.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗