File tree Expand file tree Collapse file tree
packages/provider-acp/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4965,10 +4965,10 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
49654965 ? ( "completed" as const )
49664966 : ( "failed" as const ) ;
49674967 const embeddedToolCallIds = toolCallIdsByAgentTerminalId . get ( terminalKey ) ;
4968- const projectedToolCallIds =
4969- embeddedToolCallIds === undefined || embeddedToolCallIds . size === 0
4970- ? [ `acp-agent-terminal: ${ update . terminalId } ` ]
4971- : [ ... embeddedToolCallIds ] ;
4968+ const linked = embeddedToolCallIds !== undefined && embeddedToolCallIds . size > 0 ;
4969+ const projectedToolCallIds = linked
4970+ ? [ ... embeddedToolCallIds ]
4971+ : [ `acp-agent-terminal: ${ update . terminalId } ` ] ;
49724972 const output = next . output . slice ( - MAX_AGENT_TERMINAL_OUTPUT_CHARS ) ;
49734973 for ( const toolCallId of projectedToolCallIds ) {
49744974 const existing = context . tools . get ( toolCallId ) ;
@@ -4987,7 +4987,8 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
49874987 setToolOutputText (
49884988 {
49894989 ...seeded ,
4990- status,
4990+ // An agent-reported tool owns its status; terminal state only drives the synthetic one.
4991+ status : ( linked ? existing ?. status : undefined ) ?? status ,
49914992 ...( next . command === undefined ? { } : { command : next . command } ) ,
49924993 } ,
49934994 output ,
You can’t perform that action at this time.
0 commit comments