AbortError in hook callback wedges query mid-stream; stdout silent, no result, no recovery
Summary
When the CLI runs as a subprocess (observed via Claude Desktop's local-agent / Cowork mode on Linux, but the failure is inside the CLI itself), a turn stalls mid-stream after a tool use. The process keeps running but emits no further stdout — no more tokens and no final result message. The parent harness is left with a live session that never completes and cannot be aborted gracefully.
Evidence (CLI stderr captured by the host)
AbortError:
at A (/$bunfs/root/src/entrypoints/cli.js:9486:473)
at z (/$bunfs/root/src/entrypoints/cli.js:2881:186)
Error in hook callback hook_1:
AbortError:
at A (/$bunfs/root/src/entrypoints/cli.js:9486:473)
cli.js:9486 is in the sendRequest control-request path:
async sendRequest(H,$,q,K=...){
let _={type:"control_request",request_id:K,request:H};
if(this.inputClosed) throw Error("Stream closed");
if(q?.aborted) throw Error("Request aborted");
...
}
Captured context at the stall: hadFirstResponse=true, last_message_type=assistant, last_tool_name=Write. So it happens after a tool use, while a hook callback / control request is in flight. An AbortError is thrown and not recovered; the query never resumes and never surfaces a terminal error.
Impact
- The stream silently wedges; no
resultmessage is ever emitted, so the host shows a running session with a live timer and zero output. - More frequent under concurrency (multiple subagents) — roughly 1 in 10 spawned subagents stalls; single turns less often.
- Host-side abort does not unwedge it:
query.interrupt()does not resolve within 1500ms, and the host must hard-kill the subprocess to recover. Partial output is lost.
Likely related
- #51851 —
sendRequestthrows permanently afterinputClosedflips, with no reset path (samesendRequestwedge, different trigger). - #28405 (closed) —
hook_callbackcontrol-request parse failure in the same surface.
Expected
An AbortError raised in a hook callback / control request should either be recovered (resume the stream) or terminate the turn with a surfaced error plus a final result/error message — it should never leave the query hung with no output and no way to abort.
Environment
- CLI: bundled bun binary shipped inside Claude Desktop (Linux, aaddrick/claude-desktop-debian build)
1.8555.2. - Onset: stalls began ~2026-05-12.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗