Skip to content

Commit ce90eec

Browse files
SunkenInTimeclaude
andauthored
fix(server): a Claude command you stop shows as interrupted (#14896)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent a0bf1ee commit ce90eec

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,7 +3673,7 @@ export function makeClaudeAdapterV2(
36733673
readonly output: ClaudeNativeToolOutput;
36743674
readonly status: Extract<
36753675
OrchestrationV2TurnItem["status"],
3676-
"running" | "completed" | "failed"
3676+
"running" | "completed" | "failed" | "interrupted" | "cancelled"
36773677
>;
36783678
readonly startedAt: DateTime.Utc;
36793679
readonly updatedAt: DateTime.Utc;
@@ -4740,7 +4740,9 @@ export function makeClaudeAdapterV2(
47404740
parentNodeId: toolCall.parentNodeId,
47414741
ordinal: toolCall.ordinal,
47424742
output: NO_CLAUDE_NATIVE_TOOL_OUTPUT,
4743-
status: "failed",
4743+
// A stopped turn cuts its open tools short; only a turn that
4744+
// ended on its own leaves them failed.
4745+
status: input.status === "completed" ? "failed" : input.status,
47444746
startedAt: toolCall.startedAt,
47454747
updatedAt: input.completedAt,
47464748
presentation: toolCall.presentation,

‎apps/server/src/orchestration-v2/testkit/fixtures/claude_background_task_interrupt/output.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function assertClaudeBackgroundTaskInterruptOutput(
4444
projection.turnItems.flatMap((item) =>
4545
item.type === "command_execution" ? [item.status] : [],
4646
),
47-
["completed", "failed"],
48-
"the background launch completed; the interrupted foreground command did not",
47+
["completed", "interrupted"],
48+
"the background launch completed; the foreground command was interrupted",
4949
);
5050
}

‎apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/claude_output.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function assertTurnInterruptMidToolClaudeOutput(
8181
assert.isDefined(commandItem);
8282
assert.isDefined(interruptRequest);
8383
assert.isDefined(interruptResult);
84-
assert.equal(commandItem.status, "failed");
84+
assert.equal(commandItem.status, "interrupted");
8585
assert.include(commandItem.input, "node -e");
8686
assert.equal(interruptRequest.status, "completed");
8787
assert.equal(interruptResult.status, "interrupted");

‎apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_restart/claude_output.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function assertTurnInterruptRestartClaudeOutput(
111111
assert.equal(projection.providerThreads[0]?.status, "idle");
112112
const commandItem = projection.turnItems.find((item) => item.type === "command_execution");
113113
assert.isDefined(commandItem);
114-
assert.equal(commandItem.status, "failed");
114+
assert.equal(commandItem.status, "interrupted");
115115
assert.include(commandItem.input, "node -e");
116116

117117
const outboundFrames = transcript.entries.flatMap((entry) =>

0 commit comments

Comments
 (0)