Repository navigation
Agent suggestions
Public previewDescription
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.146.0 (6904719), x64
- OS Version: Ubuntu 25.10 (Linux 6.17)
- Harness: Claude agent host (Agents window), Claude Code SDK 2.1.304, model
claude-opus-5-5 - Worked in 1.145.2 on the same machine and in the same kind of work
Disclosure: I investigated this with an AI coding agent (Claude Code). It went through my local
agenthost.logfiles and Claude transcripts, and compared the 1.145.2 and 1.146.0 source. The log excerpts and counts come from my machine. The "Likely cause" section is the agent's reading of the source, and it hasn't been checked with a debugger.
What happens
Since updating to 1.146.0, Claude turns in the agent host sometimes never finish. The chat shows only "This is taking a little longer than usual". The Claude transcript shows the model answered and ended the turn (stop_reason: end_turn), but VS Code never shows the answer and never logs result for sdkUuid=… for that turn. If I stop the turn and ask, the agent says it already replied.
Pattern: two rebuilds before the turn
Every lost turn started with two rebuild isResume=true lines before queue yielded:
14:03:58.057 [Claude] session 89ac…: rebinding before turn request_ec2a… for changed client customizations
14:03:58.150 [error] [ClaudeSdkPipeline:89ac…] _processMessages crashed: Error: Claude SDK stream ended without a result message
14:03:59.599 [Claude] session 89ac…: rebuild isResume=true agent=(none)
14:04:09.551 [Claude] session 89ac…: rebuild isResume=true agent=(none) ← second rebuild, same turn
14:04:11.255 [Claude:89ac…] queue yielded sdkUuid=request_ec2a… turnId=request_ec2a…
← no "result for sdkUuid=request_ec2a…", ever
The transcript for the same conversation has the user prompt at 14:04:11 and the assistant's end_turn reply at 14:04:20.
I classified every turn in my agenthost.log files by how many rebuilds came before its queue yielded:
| Version | Turns with 0 / 1 rebuild | Turns with 2 rebuilds | Of those, never got a result |
|---|---|---|---|
| 1.145.2 (3 VS Code sessions, Nov 9–10) | 61 | 6 | 0 |
| 1.146.0 (Nov 11–12) | 50 | 4 | 2 |
The rebuilds themselves aren't new. They happen at about the same rate in 1.145.2. They just weren't attributed in the log before #346442. Neither is the stream ended without a result message error: 43 times in 1.145.2 across those three sessions. What's new is that a turn after a double rebuild can lose its response.
Likely cause (from reading the 1.146.0 source)
#345929 (agentHost: harden Claude cancellation and lifecycle recovery, 599658f) changed ClaudeSdkPipeline._processMessages to ignore messages from a query that is no longer the current one:
for await (const message of query) {
if (signal.aborted || this._needsRebind || this._query !== query) {
continue; // previously: only `if (aborted) throw`
}
…
if (message.type === 'result' && !signal.aborted && !this._needsRebind && this._query === query) {
const completed = this._queue.settleHead(); // previously: any `result` settled the headA sequence that seems to fit the logs:
send()sees a rebind reason and calls_rebindForSyncedState()→_rebindQuery('restart'), which awaits a ~10 s rematerialize.- The old query's stream ends first, while it is still
this._query. The post-loop guard throwsstream ended without a result message, and the catch sets_needsRebind = true. - While the restart rebuild is still starting up, another caller goes through
_ensureQueryBound(), sees_needsRebindand starts a second_rebindQuery('recover')concurrently. Candidates:snapshotResolvedCustomizations,reconcileMcpServerEnablement,start/stopMcpServer,reloadPlugins. - Both rebuilds bind a query on the same prompt-queue iterable. The send continues after the first one and enqueues the prompt. The first query consumes it, but the second rebuild finishes later and becomes
this._query. - The first query's assistant messages and
resultnow hitthis._query !== queryand are dropped. Its consumer pass ends quietly (if (this._query !== query) return;). The new query never receives the prompt, so the turn's deferred never settles.
In 1.145.2, step 5 didn't drop anything. The loop processed every message until abort, which would explain why the same double-rebuild sequence completed every time there.
I haven't confirmed step 3 with a debugger. The logs only show two rebuild lines about 10 s apart. Separately, _rebindQuery has no guard against running concurrently with itself.
A second hang, possibly related
In the same session, a turn hung after only one rebuild. Claude made two parallel client tool calls: mcp__client__runPlaywrightCode (toolu_01GPmE…) and mcp__client__screenshotPage (toolu_01MVPa…). The agent host logged the client completion for both (Forwarding client tool completion: source=client-dispatch). Only toolu_01MVPa… reached the transcript as a tool_result, so the SDK waits forever for the other one. I don't have an explanation for this one from the source.
14:59:05.873 [AgentSideEffects] Forwarding client tool completion: source=client-dispatch, … toolCallId=toolu_01GPmE…
14:59:06.006 [AgentSideEffects] Forwarding client tool completion: source=client-dispatch, … toolCallId=toolu_01MVPa…
14:59:06.026 [AgentSideEffects] Forwarding client tool completion: source=server-envelope, … toolCallId=toolu_01MVPa…
Expected
- A rebuild before a turn shouldn't drop the turn's response.
- If a turn's prompt was consumed by a query that is then discarded, the turn should fail or be retried, not hang indefinitely.
Notes
- Nearly every turn rebinds for "client customizations" (31 of 47 turns on Nov 12), though no files changed in the session's customization directory or the user config, and the client tool list stayed the same.
SessionClientCustomizationsDiffgoes dirty on any change to the synced list, compared by position and includingnonce, or viaSessionMcpDiscovery. I couldn't see which of these fires. Fewer spurious rebinds would make the race much rarer. - Possibly related: Claude agent host: steering a running turn shows
error_during_execution([ede_diagnostic] result_type=user …) while the agent keeps working #347325 (another agent-host/SDK pipeline race, around steering) and Chat: "This is taking a little longer than usual" gives no indication of what the agent is stuck on #347602 (the "taking a little longer" message gives no context). - Workaround: stop the turn and send a new message. The session resumes from the transcript.
Activity
jhulford commentedon Nov 12, 2026
I'm having similar issues and they're happening very frequently since updating to the latest version - enough that I'm going to have to revert because the lost messages and work tracking in the session stream are killing my productivity. I set an opus agent free to try and help add to this issue to help resolve it.
Start agent report:
Same symptoms here on macOS (1.146.0, Agents window). On Nov 12, 22 "rebinding before turn … for changed client customizations" lines appeared across 5 Claude sessions between 08:42 and 12:27. Most of them were followed by
_processMessages crashed: Error: Claude SDK stream ended without a result messageand often a secondrebuild. Nothing in the synced customization bundle changed after 09:16 (samepluginDir, samenonce), and no user, workspace or~/.claudecustomization file changed either.Where "client customizations" comes from
This answers the question in the Notes section. It's neither the synced list nor
SessionMcpDiscovery. It's anyroot/configChangedaction. Every Claude session subscribes to the root config change event and marks its customizations diff dirty, without looking at what changed:hasDifferenceFrom()isthis._dirty || !samePaths(...), so_getRebindReason()reports"client customizations"and the next turn on every live session rebuilds.What sends
root/configChangedwhen nothing changedroot/configChanged. This runs withchat.agentHost.codexAgent.enabledat its default (true), even when Codex is never used. Switching back to the Agents window is therefore enough to make every Claude session rebuild on its next turn._sdkSetupChannel.refresh()→publishRootTransientValues(...)→root/configChanged. About 7 of my 22 rebinds came on the first turn after a "Models refreshed" log line.root/configChangedwith the assignment context and is gated byworkbench.enableExperiments.Two more lost-turn variants
The response was lost from the conversation history, in two ways:
"No response requested."(timestamped about 1 s after the user message). It has the sameparentUuidas the real turn..jsonl), but the UI never showed it.Suggested fixes
markMcpConfigurationDirty, mark dirty only when MCP-relevant root keys actually change. Ignore transient keys such asvscode.codexAccount.refreshRequestand the SDK setup status.SessionClientCustomizationsDiffcompare against what was last applied, as the tools diff does, rather than a sticky_dirtyflag.refreshRequestwhen the Codex agent isn't in use.Workaround I've just applied (not yet confirmed):
"chat.agentHost.codexAgent.enabled": false. It should remove the focus-triggered rebinds. The 30-minute refresh would still trigger some.jay-lu-simplisafe commentedon Nov 13, 2026
Same symptom on macOS (Apple silicon), with a comparison between 1.146.0 and 1.145.0 on one machine.
claude-opus-5-5. The Claude Code SDK also differed between the two runs (2.1.308 on 1.145.0; 2.1.304 or newer on 1.146.0), so this isn't a single-variable comparison.result for sdkUuid=…line inagenthost.logfor that turn. I haven't checked each turn against its transcript.queue yieldedThe 1.145.0 sample is small (2 double-rebuild turns, both delivered). Together with the 1.145.2 numbers in the description (0 of 6), that is 0 of 8 on 1.145.x against 9 of 11 on 1.146.0 here, though the two 1.145 samples come from different machines.
A third rebind reason. One turn logged
rebinding before turn … for changed resume point(all the others saychanged client customizations). It had two rebuilds, no_processMessages crashedline, and its reply was delivered.History fork on 1.145.0. After a double rebuild on 1.145.0 (
rebuild→_processMessages crashed→rebuild), the reply was shown. The next message, sent about 2 minutes after that reply with no rebuild before it, then forked the session history:parentUuidas the 12:40:22 message.This is the same orphaning that jhulford describes above, but on 1.145.0, where the reply itself was delivered. I have seen it once, not as a pattern.
Not tested:
--disable-extensions, Insiders.I investigated this with an AI coding agent (Claude Code). It read my local
agenthost.logfiles and Claude transcripts. The counts come from my machine, and session IDs are shortened.zhaojiale2021 commentedon Nov 17, 2026
Same loss confirmed on Windows with a non-Anthropic relay model (1.147.0-insider)
Adding a data point from a Windows machine, since the report and the other comments are mostly macOS/Linux.
Environment
1.147.0-insider, Windows 10 Pro 19045ccs-claude-…--deepseek-flash[1m]). The SDK logs[claude-code:unrecognized_model]for this alias, but turns do run and stream normally otherwise.Symptom
After a turn finishes, the session never leaves the "Working" group in the agent sessions sidebar, and the chat pane keeps showing "This is taking a little longer than usual".
Log evidence (
agenthost.log, local time UTC+8, session697e0d33…)Turn 1 — trigger
changed client customizations:Turn 2 — trigger
changed client tools(no customization files were edited between these turns):Across this window there were 19
queue yieldedlines and 16result for sdkUuidlines, with the two misses above.Both turns did complete on disk. From
~/.claude/projects/d--<redacted>/697e0d33….jsonl:"stop_reason":"end_turn"at01:33:46Z(09:33:46 local) — ~77 s after the firstqueue yielded"stop_reason":"end_turn"at01:58:48Z(09:58:48 local) — ~126 s after the secondqueue yieldedSo both rebind reasons named in this issue reproduce on Windows/1.147.0-insider. In this log the
_processMessages crashed … stream ended without a result messageline is always immediately preceded by a failingsnapshotResolvedCustomizations, in case that is a useful extra signal for the rebuild race.Related: #333799 (turn completes, UI stays in progress) and #327639 (per-session status in the sidebar freezes and never flips to done).
zhaojiale2021 commentedon Nov 17, 2026
Update: the lost turn becomes the permanent queue head — every later message is sent into it as steering
Follow-up on my earlier comment, same machine and same session (
697e0d33…, VS Code 1.147.0-insider, Windows).The turn that loses its
resultin the rebind race does not only hang itself. It stays open at the head of the prompt queue for the lifetime of the agent-host process, and every subsequent user message is enqueued as a steering message on that dead turn instead of starting a new turn:That is 12 user messages over about five hours. Every one of them was answered — each steering id gets its own
result for sdkUuid— butturnIdnever changes back to a fresh turn. The session-level status therefore never leaves "working": the session stays in the Working group of the sidebar and the chat pane keeps showing the working indicator indefinitely, even though the visible last answer is complete. Nothing in the UI clears it.Two details that may help the investigation:
The wedge is scoped to the agent-host process. A lost turn from before a host restart did not wedge later turns:
09:32:29 turn request_a7c76474lost its result, the host process was restarted (hostProcessAgeMs≈21506066at 15:45 → process started around 09:45), and09:47:58 turn request_4f10273fthen ran as a normal new turn and completed. The09:56loss in the new process wedged everything after it. This is consistent with the reports thatDeveloper: Reload Windowdoes not clear the state but a full app restart does.A client-side truncate can reset the queue head. In a second session (
b11477e8…) I saw the same loss (15:53:47 request_5869dca3, no result), then a steering message (15:55:26), thentruncateChat kept [0..request_b2a5d1fd…]at15:56:24, after which a fresh turn started normally. If that truncate/retry path can be exposed as a recovery action in the UI, it would be a much cheaper workaround than restarting the whole app.Still present on 1.147.0-insider; the two turns in this session that lost their result are the same rebind-triggered ones from my previous comment (
changed client customizationsandchanged client tools).zhaojiale2021 commentedon Nov 17, 2026
Recovery:
Restart Local Agent Hostworks, but there is no equivalent for remote agent hostsFollowing up on the queue-head finding. Confirmed on the same setup (VS Code 1.147.0-insider, Windows client):
Developer: Restart Local Agent Hostrecovers a wedged local session. It restarts the agent-host process, the lost turn is dropped, and the session comes back from the transcript showing as finished. That is consistent with the wedge being process-scoped, and it is a much better workaround than restarting the whole app.workbench.action.chat.restartLocalAgentHost("Restart Local Agent Host"). For remote hosts there is only "Reconnect"/"Trigger Reconnect", which re-attaches to the same host process and therefore does not clear the stuck queue head. The session stays in "working" forever.Manual workaround for remote today:
Remote-SSH: Kill VS Code Server on Host(or killing the remote agent-host process directly,agentHostMain/--type=agentHost) and reconnecting. That kills remote terminals and background tasks as collateral.Suggestions for whoever picks this up:
Restart Agent Hostaction on the host entry in the environments list, in addition to the developer command).truncateChatreachable as a "retry turn" action — that would repair the session without touching the host process.I can provide remote
agenthost.logexcerpts from an SSH target if useful.zhaojiale2021 commentedon Nov 17, 2026
Filed a feature request for the remote side: #348798 — allow restarting a remote agent host (SSH/WSL/Dev Container) from the UI, mirroring
Developer: Restart Local Agent Host.MaximVoloshinUA commentedon Nov 18, 2026
Same loss on Windows 11, stable 1.146.0, triggered by
changed client toolsAnother data point, from the stable build on Windows 11.
claude-opus-5-5rebinding before turn … for changed client tools(not customizations). Severalactive client … tools=[…]re-registrations for the session came just before each lost turn.Two turns in one chat were lost the same way. Both had the double-rebuild shape described above:
The transcript has the assistant's
end_turnreply at 02:11:58. The chat kept showing "This is taking a little longer than usual".The earlier lost turn (01:41) also confirms the queue-head behaviour that Alan Zhao (@zhaojiale2021) described. It had the same rebind, crash and two rebuilds. My next two messages were not started as new turns but enqueued into the stuck one:
A side effect: after the resume, the agent's own context no longer contained the lost turn. So when I asked "status?", it replied as if the lost question had never been asked, which made the failure more confusing.
Turns in the same chat with zero or one rebuild delivered their
resultnormally.GNeras commentedon Nov 27, 2026
Still happening on 1.148.0: captured end to end with breakpoints in the agent host (root cause, repro and a fix tested in daily use)
claude-opus-5-5Summary
The turn's prompt is consumed by the query bound by one rebind, and a second, concurrent rebind replaces that query a moment later. From then on,
_processMessagesdrops every message of the turn, including the reply and itsresult, because they come from a query that is no longerthis._query. The second rebind exists because of three things together:_needsRebind = truewhile the new query is still being built.snapshotResolvedCustomizations()→_ensureQueryBound(), sees_needsRebindand starts_rebindQuery('recover'). Nothing prevents two_rebindQuerycalls from running at once.~/.claude/plugins, which happens on every process start and exit.Repro
rebinding before turn … for changed client customizations, and some of the time the reply is lost.In my
agenthost.logfiles from Nov 24–26, by the turn's position since the session materialized:Most 3rd+ rebinds came from root config changes, such as the Codex account refresh jhulford described. It's a timing race: in short test chats I needed several attempts. In long real sessions it happens much more often.
Capture 1: second turn of a test chat, reply "dos" dropped (session
3c89fb6b…, Nov 26)adoptClientCustomizations(…): the client plugin sync lands, right after turn 1 ended. A cascade of customization republishes followsClaudeAgentSession.send:rebindReason = "client customizations".hasDifferenceFrom→{dirty: true, applied: [], desired: [<abap plugin dir>, <VS Code Synced Data dir>, …]}_rebindQuery("restart"). Current query: q2signalChanged: true:bindAbortSignal(placeholder)in_rebindQueryclosed itthis._query→consumerError: "Claude SDK stream ended without a result message"→_needsRebind = truesnapshotResolvedCustomizationswithneedsRebind: true_rebindQuery("recover")←_ensureQueryBound←snapshotResolvedCustomizations←getSessionCustomizations←AgentSideEffects._publishSessionCustomizations, concurrent with the restart_bindWarmQuery→ q3queue yielded sdkUuid=request_9e2359c6…: the prompt is consumed by q3rebuildlog line comes afterqueue yieldedthis._query !== query):assistantfrom q3, text"dos",user_message_uuids: ["request_9e2359c6…"]resultsuccess/end_turnfrom q3 forrequest_9e2359c6…Capture 2: the same race in a long real session (session
97bbd017…, 12:02)Same chain, but here the recover was triggered by the file-watcher republish, and the second rebuild came before
queue yielded:adoptClientCustomizations(right after turn 1)hasDifferenceFrom→applied: [],desired: [abap plugin, …]_rebindQuery("restart")stream ended without a result message→_needsRebind = true_ensureQueryBound()withneedsRebind: true←snapshotResolvedCustomizations←getSessionCustomizations←getChatCustomizations←_publishSessionCustomizations←_publishSessionCustomizationsSoon←_publishSessionCustomizationsForAgent← agentonDidCustomizationsChange_rebindQuery("recover")queue yielded sdkUuid=request_4441078f…system/init,system/status(user_message_uuids: ["request_4441078f…"]), the stream events and theassistantmessageRoot causes, with code references
The first turn after materialize runs without the client plugins, so turn 2 always rebinds. At materialize, the SDK options were
plugins: []in every capture (synced: 0)._syncClientCustomizationsqueuesadoptClientCustomizationson the session sequencer (claudeAgent.ts:2632), whichsendMessageholds for the whole turn (claudeAgent.ts:2399). So the sync only lands after turn 1 has finished, and turn 2 seesclient customizationschanged. As far as I can tell, turn 1 never gets the client-synced plugins.A restart rebind ends the live query and reports it as a crash.
_rebindQuerycallsthis._queue.bindAbortSignal(placeholder.signal)(claudeSdkPipeline.ts:638), which ends the old query's prompt iterator (claudePromptQueue.ts:74). The old stream then ends while it is stillthis._query, so the post-loop guard throwsstream ended without a result messageand sets_needsRebind = true(claudeSdkPipeline.ts:761-770). That's why this error follows almost every rebind (39 of 40 in my logs). For the rest of the rematerialize, the pipeline looks dead to everyone else.Anything that calls
_ensureQueryBound()during that window starts a concurrent rebind (claudeSdkPipeline.ts:174-176)._rebindQueryhas no in-flight guard. The caller in both captures was the customization republish, whichAgentSideEffectsfans out to every session of the agent (agentSideEffects.ts:699, subscribed at:745).The republish is fired by the customizations file watcher on every Claude CLI start and exit.
ClaudeCustomizationWatcherwatches~/.clauderecursively and triggers on thepluginssubpath (CLAUDE_CUSTOMIZATION_SUBPATHS,claudeSessionCustomizationDiscovery.ts:443). The CLI writes there on every start and exit. Recorded file changes:~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/.in_use/<pid>(a natively installed plugin), plus~/.claude/plugins/known_marketplaces.json.lock, added and then deleted;…/.in_use/<pid>.So every rebuild republishes customizations for every session, right in the window from cause 2.
Messages from a superseded query are dropped and the turn is never settled. The checks at
claudeSdkPipeline.ts:704and:729drop everything, including theresult. Nothing fails or retries the turn whose prompt that query consumed, so it hangs until the user stops it.Fix, tested in daily use
Serializing
_rebindQueryis enough to break the chain. A caller that arrives while a rebind is in flight waits for it, and arecoverthat is no longer needed afterwards (!_needsRebind) returns without rebuilding:I've been running exactly this guard in my own agent host since yesterday. It's applied at runtime: open the agent host's inspector with
process._debugProcess, findClaudeSdkPipelinein the heap withRuntime.queryObjects, wrap_rebindQueryon its prototype and close the inspector again. No VS Code files are changed.recoverarrived while therestartwas in flight, it waited instead of starting a second rebind, and the turn completed. Without the guard, each of those 5 turns would have been lost.Other changes that would remove the window or the trigger:
_needsRebindwhen the old query was ended by_rebindQuery.send, instead of queueing it behind the turn.~/.claude/plugins(.in_use/,*.lock).Other hangs with the same symptom (different root causes)
While capturing this, I found three more ways a Claude turn in the agent host never finishes, or its reply is never shown. They have nothing to do with rebinds, but they look the same from the chat, so some reports here may be one of them. Each has a deterministic repro, a capture and a workaround I've tested:
completeClientToolCallusesrespond, notrespondOrBuffer): Agent Host client tool hangs after active client removal; browser click invoked with empty args #322990, details for 1.148.I can share the inspector script and the raw captures (JSONL with arguments and async stacks) if useful.
hojland commentedon Nov 27, 2026
Same on macOS arm64 (27.2.1), VS Code 1.148.0 (661626d), Claude agent host with
claude-opus-5-5on Amazon Bedrock. Several natively installed Claude Code plugins have.in_use/<pid>markers under~/.claude/plugins/cache, which fits the watcher trigger described above.In one agent-host process (Nov 26 13:09 to Nov 27 15:26), every turn preceded by two
rebuild isResume=truelines lost its reply: 7 of 7, across 5 sessions. Of 9 turns with a rebind and a single rebuild, 1 lost its reply.The
changed client toolsrebinds don't need a real change. Only one client is attached, and after startup its tool list is identical in all 256active client … tools=[…]lines. Still, 8 turns loggedrebinding before turn … for changed client tools. The latest (request_34717d99…, Nov 27 15:01:50) went rebind, rebuild,stream ended without a result message, then a second rebuild 0.5 s later, and its reply never reached the chat, although the transcript shows the turn finishing normally at 15:04:21.One more effect we haven't seen reported here: the superseded process doesn't stop. In session
08c06c13…the first turn's reply (request_91c9cb2b…) was dropped, so the chat showed nothing, and I sent the message again 3 minutes later (request_334a2fb2…). The host rebuilt twice more. From then on, two processes worked on the same session for about 4 minutes. The transcript has two prompt ids interleaving and forks at 5 points. Both processes made changes on GitHub. One posted that a PR shouldn't be marked ready, and two seconds later the other marked it ready. One of them also ran a tool call immediately after an AskUserQuestion, without waiting for the answer. Neither process's output reached the chat. So this race can also duplicate real side effects (pushes, PR edits), not only hide output.Logs: https://gist.github.com/hojland/df165fa7fc6e79d26a957720c5d9b4ac
agenthost-claude-lifecycle.log: theagenthost.logfor that process, filtered to the Claude lifecycle lines (home paths shortened, nothing else edited).transcript-structure.jsonl: the Claude Code transcript of08c06c13…from 12:30 to 12:43 UTC, reduced to ids, parent ids, prompt ids, timestamps and block types, with message content removed.The README in the gist lists the lost turn ids and the fork points.
I found this with an AI coding agent (Claude Code), working from my
agenthost.logand Claude transcripts. I haven't used a debugger.