Repository navigation
Agent suggestions
Public previewDescription
In a dev container, a subagent's tool call is announced and then never executed. Nothing runs it, nothing fails it, and nothing times out, so the subagent's turn stays open and the chat spins indefinitely.
I reproduced this six times, on both a patched and a completely stock build, driving a real window through a scripted scenario rather than by hand.
What happens
A prompt that launches a subagent (Agent / Task) produces, on the subagent's own chat channel:
chat/toolCallStart turn=3fcf1cc0-… Bash
chat/toolCallReady turn=3fcf1cc0-…
(nothing further, ever)
At that point, measured inside the container:
- No process is executing.
psshows no shell, nofind, nogrep, nothing but the container's own keep-alive processes. - The agent host log is silent. Its last line is the tool completion that preceded the hang.
- The UI still reports the turn as running, and did so for the full 10 minute observation window.
- The parent's spawning
Agenttool call also never completes.
So the call is announced to the client, never executed by anything, and never reaped.
It scales with the number of subagents
A prompt that spawns several subagents leaves several turns open. One run, driven the same way:
chat/turnStarted x10
chat/turnComplete x4
Seven subagent turns were opened and two completed; five were left open, along with the parent's follow-up turn. The chat shows nothing further for any of them and no amount of waiting changes it.
That ratio matches what #332073 reports from a different trigger, which is why I think the missing terminal path is worth treating as its own defect rather than only as a consequence of whatever stalls the tool call.
Why the turn never closes
AgentSideEffects.completeSubagentSession is the only thing that completes a subagent chat's turn, and it is reachable from exactly one place: a subagent_completed signal.
node/agentSideEffects.ts
590: if (signal.kind === 'subagent_completed') {
591: this.completeSubagentSession(signal.chat.toString(), signal.toolCallId);
That signal has two producers, and both are downstream of the spawning tool finishing:
claudeMapSessionEvents.ts:406fires it on thetool_resultfor the spawningTask/Agenttool_use, and only when the spawn is not flagged background.claudeSubagentSignals.ts:129fires it on atask_notificationwith a terminal status.
Because the spawning tool call never completes, neither producer fires. subagent_completed was emitted zero times in every run. The subagent turn is therefore never completed, cancelled or errored.
Nothing else closes it. The only thing resembling a watchdog is agentHostTurnTracker, which derives a hang reason for telemetry and dispatches no action, so there is no path by which an abandoned turn is ever terminated.
Reproducing it
Drive a window, send a prompt that spawns a subagent, and wait. The scenario I used, with all prompts read-only:
Without changing anything, launch a subagent to inventory the top-level directories of this repository, then report what it found.
Then assert that every chat/turnStarted eventually reaches a terminal action. The run never satisfies it.
Two measurements make the diagnosis unambiguous and are worth repeating if anyone tries this:
- check
psinside the container, to distinguish "the command is slow" from "nothing is running" - check whether the agent host log is still growing, rather than judging from the UI: the Stop control disappears transiently during tool execution, so the UI is not a reliable indicator of progress
Scope
Reproduced on 1.135.0 (08d4889f9ec4a1685d257b9b95de036c8e1ce1e5), dev container on Docker, agent host in the container, Claude harness, Windows client and Linux container on arm64.
I run a set of local patches against the shipped bundle, so I re-ran this against a completely stock, reverted bundle to be sure they were not the cause. It reproduces identically: the turn is still open after 10 minutes with nothing executing. As a control in the same comparison, the stock build produced 2 ENOPRO errors where the patched build produced none, which confirms the revert genuinely took effect.
What I have not established
I have not identified why the announced call is never executed. Two candidates in the existing set look most likely, and I would rather not guess between them:
- #330899, where a client tool is admitted to execution off the stream-mapper ready rather than the runtime invocation
- #331595, where a subagent's tool call is handled on the parent chat
Whichever it is, the missing reaper is separable and worth having on its own: a turn whose producing work is gone should not remain open forever, and today nothing can end it but the user.
Related: #332073 reports the same visible outcome from a different cause (closing the window mid-flight). The grouping is in #333174.
AI disclosure: this issue and the related investigation were written with the assistance of AI.
Public patches and patcher scripts
Public patch catalog and patcher scripts · Source patch index. The public collection includes the maintained patchers, rollback instructions, regression scripts, and historical snapshots. Build restrictions and exact installer coverage are documented there.
Activity
RyanEwen commentedon Sep 2, 2026
I instrumented the SDK message router to record every
tool_usethe host sees and everytool_resultthat comes back, which answers the question I left open above. The break is not the host dropping results. The results never arrive at all.One run, subagent spawned, nothing else touched:
The first two of the subagent's tool calls complete normally. The next two are announced and then the stream simply stops. The spawning
Agentcall never receives a result either, which is whysubagent_completednever fires and the subagent turn is never closed.What the protocol side shows for the two stalled calls
Both received only:
and nothing after. Across the whole run there were zero confirmation or input-needed actions of any kind, so the user was never asked to approve anything, and there was nothing on screen to click.
Taken with the earlier measurement that no process is executing in the container, the picture is:
Where that puts the defect
The stall sits at the permission/execution boundary between the host and the SDK, not in the mapping of results. I want to be careful about the last step: I can see that no result is produced and that no confirmation is surfaced, but I cannot see from outside whether the host's
canUseToolcallback was invoked and never resolved, or never invoked at all. That distinction needs instrumentation inside the permission path, which I have not done.What is established, and reproducible:
I have also re-confirmed on a fully stock, reverted bundle, so none of this comes from the local patches I run.
AI disclosure: this comment and the related investigation were written with the assistance of AI.
RyanEwen commentedon Sep 2, 2026
I instrumented the permission callback itself, logging entry and exit separately, and that closes the diagnosis.
handleCanUseToolis entered for the stalled call and never returns.From one run, a subagent doing ordinary read-only work:
Two entries, one exit. The tool call whose permission request never returns is exactly the one left
Runningforever, and a third call after it never reachescanUseToolat all because the SDK is already parked behind the second.The chain, end to end
Bashtool call.handleCanUseToolfor it.canUseToolunresolved the SDK never executes the tool, so no process runs and notool_resultis produced.Agentcall therefore never completes, sosubagent_completednever fires.completeSubagentSessionis the only thing that can close a subagent turn, so the turn stays open.Every step there is measured rather than inferred, except where noted below.
Notable detail
Not every tool call goes through this path. In the same run, two earlier
Bashcalls completed without enteringcanUseToolat all (the server tool host reported no confirmation required), and a third entered and returnedallownormally. So the permission path works, and then stops working, within a single subagent.What is still inference
I have not identified why the parked request is never surfaced. The obvious candidate is that the confirmation needs to be raised on the subagent's own chat channel and is not, which would match the shape of #331595, but I have not instrumented the request-surfacing path to confirm it. I would rather leave that open than guess.
Reproduced on 1.135.0 (
08d4889f9ec4a1685d257b9b95de036c8e1ce1e5), and separately on a fully stock reverted bundle, so none of this originates in the local patches I run.AI disclosure: this comment and the related investigation were written with the assistance of AI.