File tree Expand file tree Collapse file tree
apps/server/src/orchestration-v2
claude_background_task_interrupt Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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" ) ;
Original file line number Diff line number Diff 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 ) =>
You can’t perform that action at this time.
0 commit comments