fix(server): stop a second server from resending Claude turns - #10
Closed
cestercian wants to merge 1 commit into
Closed
cestercian wants to merge 1 commit into
cestercian wants to merge 1 commit into
Conversation
A failed dispatch on a server that shares the state directory reconciled by republishing every event since its stale snapshot, including the other server's thread.turn-start-requested. The local provider reactor then started a second Claude turn for the same user text. Reconcile still projects those events onto the local command model, and only republishes events this dispatch itself appended.
Owner
Author
|
superseded by upstream |
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 Changed
A failed command on a server that shares its state directory no longer republishes events written by the other server. Reconcile still projects those events onto the local command model. Only events this dispatch appended are published to local reactors.
Why
One user message was starting two Claude provider turns. The desktop backend and the background service can share one state directory, so the second server's in-memory command model falls behind. When a command failed on that server, reconcile re-read every event since its snapshot and published them on the local event bus, including turn-start events the first server had already handled. The second server's provider reactor has its own turn-start dedupe cache, so it resumed the Claude session and sent the same user text again under a new turn id. The extra turn has no pending message because the first server already consumed that slot. The second process is cold-starting the CLI, which is why the duplicate shows up tens of seconds later, often while the first turn is still running.
Checklist
This change was made by Grok 4.7.