Skip to content

Commit b43a1b4

Browse files
authored
fix(server): a Claude tool call interrupted by a new message shows as stopped, not failed (pingdotgg#34183)
1 parent 9b6c77f commit b43a1b4

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6667,7 +6667,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
66676667
);
66686668

66696669
// regression: #15892 non-execution metadata is carried through, not guessed from result text
6670-
it.effect.each(["cancelled", "denied", "permission_denied", undefined])(
6670+
it.effect.each(["cancelled", "interrupted", "denied", "permission_denied", undefined])(
66716671
"preserves native tool non-execution metadata %s without inferring a denial from text",
66726672
(kind) =>
66736673
Effect.scoped(
@@ -6722,7 +6722,10 @@ describe("ClaudeAdapterV2 background wake turns", () => {
67226722
: [],
67236723
);
67246724
const failed = items.findLast((item) => item.nativeItemRef?.nativeId === "tool-error")!;
6725-
assert.equal(failed.status, kind === "cancelled" ? "cancelled" : "failed");
6725+
assert.equal(
6726+
failed.status,
6727+
kind === "cancelled" || kind === "interrupted" ? kind : "failed",
6728+
);
67266729
assert.equal(failed.toolNonExecutionKind, kind);
67276730
const ok = items.findLast((item) => item.nativeItemRef?.nativeId === "tool-ok")!;
67286731
assert.equal(ok.status, "completed");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7739,8 +7739,8 @@ export const makeClaudeAdapterV2 = Effect.fn("makeClaudeAdapterV2")(function* (
77397739
ordinal: toolCall.ordinal,
77407740
output: input.output,
77417741
status:
7742-
toolNonExecutionKind === "cancelled"
7743-
? "cancelled"
7742+
toolNonExecutionKind === "cancelled" || toolNonExecutionKind === "interrupted"
7743+
? toolNonExecutionKind
77447744
: isClaudeToolResultError(input.toolResult)
77457745
? "failed"
77467746
: "completed",

0 commit comments

Comments
 (0)