Repository navigation
fix(web): settle first turns recovered before the create response - #1809
Merged
Merged
Conversation
When the thread-startup binding push arrives before the create-and-send response, the client recovers the new thread from the thread list. That path skipped the runtime snapshot the response carries, so the record stayed running with no execution identity. The turn's terminal event could never correlate to it, and the composer and project tree kept showing the turn as running. Recovery now reads the server's runtime snapshots with the thread list and applies the thread's snapshot before the placeholder transfer, as the response path already does.
A recovered thread could still end up running with no execution identity. Recovery may run before the server lists the turn's runtime, and a stale running snapshot can land after the turn's terminal event. Recovery without a snapshot now transfers the placeholder as idle, so the turn's canonical events claim and settle the record. Every transfer reconciles the persisted record against the canonical replica, which settles a turn whose terminal arrived first.
chuks-qua
force-pushed
the
fix/recovered-creation-runtime
branch
from
October 6, 2026 17:50
bf75b5e to
72a54da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The composer and project tree could stay on "running" forever after a new thread's first turn ended. This happened after a failed turn and after a completed one.
When the server's thread-startup binding push arrives before the create-and-send response, the client recovers the new thread from the thread list. That path skipped the runtime snapshot the response carries. The thread record stayed
runningwith no execution ID, so the turn's terminal event could never correlate to it. This is likely right after a server restart, when the server is slower.Verified on the worktree runtime by restarting the server, then failing a Claude first turn through the composer, with a client store dump at the end:
runningwithturnExecutionId: nullwhile the canonical turn wasErrored.Why
A turn that had ended still looked like it was running. That blocked the composer and left a false activity dot in the project tree.
Review Notes
When recovery finds no runtime snapshot, the composer shows Send for about 0.5 s until the turn's canonical events claim the record. That happened in 5 of 7 runs. Removing it would mean letting a running record with no identity claim a canonical turn, which breaks the existing guard that an older turn must not cancel a newer pending send.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.