Skip to content

fix(server): serialize Claude session start and recovery - #37

Closed
macodev00 wants to merge 16 commits into
mainfrom
cursor/claude-mcp-binding-lock-1b0a
Closed

macodev00 wants to merge 16 commits into
mainfrom
cursor/claude-mcp-binding-lock-1b0a

Conversation

@macodev00

Copy link
Copy Markdown
Owner

What Changed

Claude session start and recovery for one thread share one lock. The new session binding is written before that lock is released, and recovery re-reads the binding after it acquires the lock.

  • A live Claude query keeps the MCP bearer it already spawned with.
  • A refused replacement leaves the open query and its credential in place.
  • A failed start revokes and clears the thread credential when the previous adapter is gone or the session probe fails after the old session has stopped.
  • Claude refuses replacement, including rollback, while child tasks are running.

Fixes pingdotgg#12694

Why

A concurrent recovery could restart the old provider instance after the start lock was released but before the new binding was recorded. It could also keep using a binding snapshot taken before it waited for the lock. Either path left two instances running and made the MCP credential timing-dependent.

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web Open in Cursor 

juliusmarminge and others added 16 commits September 23, 2026 15:01
…case screenshots (pingdotgg#13316)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Exotic <118054752+extoci@users.noreply.github.com>
…otgg#11580)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
…3355)

Co-authored-by: Yordis Prieto <yordis.prieto@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Keep the thread binding update inside the start lock and re-read it after
recovery acquires that lock, so a waiting recovery cannot restart the
instance that was just replaced. A refused replacement keeps the live query
and its MCP credential. A failed start revokes the credential when the
previous adapter is gone. Claude still refuses replacement, including
rollback, while child tasks are running.

Fixes pingdotgg#12694
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Sep 24, 2026
@macodev00

Copy link
Copy Markdown
Owner Author

Superseded: upstream pingdotgg#13380 already opened and closed after Macroscope Not approved (cap HIT).

@macodev00 macodev00 closed this Sep 24, 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.

[Bug]: Claude session replacement suppresses exit and silently stops live subagent tasks

8 participants