Skip to content

fix(server): stop a second server from resending Claude turns - #10

Closed
cestercian wants to merge 1 commit into
cursor/upstream-main-17cdfrom
cursor/fix-claude-duplicate-turn-17cd
Closed

cestercian wants to merge 1 commit into
cursor/upstream-main-17cdfrom
cursor/fix-claude-duplicate-turn-17cd

Conversation

@cestercian

@cestercian cestercian commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

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 PR is small and focused
  • I explained what changed and why
  • No UI changes

This change was made by Grok 4.7.

Open in Web Open in Cursor 

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.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Sep 23, 2026
@cursor
cursor Bot changed the base branch from main to cursor/upstream-main-17cd September 23, 2026 19:15
@cestercian

Copy link
Copy Markdown
Owner Author

superseded by upstream

@cestercian cestercian closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant