Skip to content

Commit 7266f81

Browse files
Gourav224claude
andcommitted
fix(server): an unanswered Claude MCP registration keeps the native session
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 65b4a69 commit 7266f81

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ export class ClaudeAgentSdkQueryRunnerError extends Schema.TaggedError<ClaudeAge
534534
}
535535
}
536536

537-
class ClaudeMcpRegistrationTimeoutError extends Schema.TaggedError<ClaudeMcpRegistrationTimeoutError>()(
537+
export class ClaudeMcpRegistrationTimeoutError extends Schema.TaggedError<ClaudeMcpRegistrationTimeoutError>()(
538538
"ClaudeMcpRegistrationTimeoutError",
539539
{},
540540
) {

‎apps/server/src/orchestration-v2/ProviderTurnStartService.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ class WorktreeRecreateNoBaseError extends Schema.TaggedError<WorktreeRecreateNoB
9292
const isProviderTurnStartError = Schema.is(ProviderTurnStartError);
9393

9494
/**
95-
* Claude refuses these before it reads the prompt: replacing a process running background work,
96-
* or launch arguments whose appended system prompt cannot be read.
95+
* Claude fails these before it reads the prompt: replacing a process running background work,
96+
* launch arguments whose appended system prompt cannot be read, or an MCP registration that
97+
* never answers while the query opens.
9798
*/
9899
const PROMPT_REFUSAL_TAGS = [
99100
"ClaudeBackgroundWorkBlocksQueryReplacementError",
101+
"ClaudeMcpRegistrationTimeoutError",
100102
"ClaudeAppendSystemPromptFileError",
101103
"ClaudeAppendSystemPromptMissingValueError",
102104
] as const;

‎apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { CommandPolicyCapabilityUnsupportedError } from "../CommandPolicy.ts";
3838
import {
3939
ClaudeAppendSystemPromptFileError,
4040
ClaudeBackgroundWorkBlocksQueryReplacementError,
41+
ClaudeMcpRegistrationTimeoutError,
4142
ClaudeProviderCapabilitiesV2,
4243
} from "../Adapters/ClaudeAdapterV2.ts";
4344
import {
@@ -1311,6 +1312,7 @@ describe("orchestration v2 provider switching", () => {
13111312
it.live.each([
13121313
["background work", new ClaudeBackgroundWorkBlocksQueryReplacementError()],
13131314
["an unreadable append file", new ClaudeAppendSystemPromptFileError({ path: "missing.md" })],
1315+
["an unanswered MCP registration", new ClaudeMcpRegistrationTimeoutError()],
13141316
] as const)("keeps the native session after turns refused for %s", ([, refusalCause]) =>
13151317
Effect.scoped(
13161318
Effect.gen(function* () {

0 commit comments

Comments
 (0)