Skip to content

fix(server): keep Claude sessions up while child tasks run - #22

Closed
macodev00 wants to merge 1 commit into
mainfrom
cursor/keep-claude-mcp-while-live-eaa0
Closed

macodev00 wants to merge 1 commit into
mainfrom
cursor/keep-claude-mcp-while-live-eaa0

Conversation

@macodev00

Copy link
Copy Markdown
Owner

What Changed

ClaudeAdapter.startSession refuses to replace an existing Claude session while child tasks are still running. It emits runtime.warning and fails with ProviderAdapterRequestError, leaving the open query and its runtime mode in place. Replacement when nothing is live is unchanged.

ProviderService.startSession no longer rotates the thread MCP credential before that refusal is accepted. While a session is already running, the new credential is issued alongside the existing one. If the adapter rejects the restart and the session is still up, the replacement credential is revoked and the previous credential is restored. An accepted replacement revokes only the credential the stopped query was using. A failed first start still clears the credential it just issued.

Why

Closes pingdotgg#12694.

An incoming turn that restarted Claude called startSession over a live query. That closed the query, recorded child tasks as task.completed(stopped), and suppressed session.exited, so the seat never saw a session boundary.

Supersedes pingdotgg#12723, pingdotgg#13080, and pingdotgg#13086. Those were closed after Macroscope did not approve them. This redo keeps the gate in the Claude adapter and fixes the Macroscope High from pingdotgg#13086: a rejected startSession was revoking the MCP credential the running Claude query still uses for t3-code tools. The live query now keeps that credential until replacement is accepted.

UI Changes

N/A. Server provider session lifecycle only. A blocked replacement surfaces as a runtime.warning and a request error on the turn.

Linked Issues

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

Implemented with Grok 4.7.

Open in Web Open in Cursor 

startSession closed the live query and revoked its MCP credential when a
replacement was refused. Refuse that replacement, and leave the running
query on the credential it already has.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 22, 2026
@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

@coderabbitai review

@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

@macroscope-app review

@macodev00

Copy link
Copy Markdown
Owner Author

Superseded by upstream pingdotgg#13097 — closing fork-local PR.

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

Labels

size:L 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

1 participant