File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
lib/copilot/tools/client/workflow Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
99
1010export class RedeployClientTool extends BaseClientTool {
1111 static readonly id = 'redeploy'
12+ private hasExecuted = false
1213
1314 constructor ( toolCallId : string ) {
1415 super ( toolCallId , RedeployClientTool . id , RedeployClientTool . metadata )
@@ -30,6 +31,12 @@ export class RedeployClientTool extends BaseClientTool {
3031 async execute ( ) : Promise < void > {
3132 const logger = createLogger ( 'RedeployClientTool' )
3233 try {
34+ if ( this . hasExecuted ) {
35+ logger . info ( 'execute skipped (already executed)' , { toolCallId : this . toolCallId } )
36+ return
37+ }
38+ this . hasExecuted = true
39+
3340 this . setState ( ClientToolCallState . executing )
3441
3542 const { activeWorkflowId } = useWorkflowRegistry . getState ( )
Original file line number Diff line number Diff line change @@ -1307,6 +1307,11 @@ const sseHandlers: Record<string, SSEHandler> = {
13071307 updateStreamingMessage ( set , context )
13081308
13091309
1310+ // Do not execute on partial tool_call frames
1311+ if ( isPartial ) {
1312+ return
1313+ }
1314+
13101315 // Prefer interface-based registry to determine interrupt and execute
13111316 try {
13121317 const def = name ? getTool ( name ) : undefined
@@ -1892,6 +1897,7 @@ const subAgentSSEHandlers: Record<string, SSEHandler> = {
18921897 const id : string | undefined = toolData . id || data ?. toolCallId
18931898 const name : string | undefined = toolData . name || data ?. toolName
18941899 if ( ! id || ! name ) return
1900+ const isPartial = toolData . partial === true
18951901
18961902 // Arguments can come in different locations depending on SSE format
18971903 // Check multiple possible locations
@@ -1958,6 +1964,10 @@ const subAgentSSEHandlers: Record<string, SSEHandler> = {
19581964
19591965 updateToolCallWithSubAgentData ( context , get , set , parentToolCallId )
19601966
1967+ if ( isPartial ) {
1968+ return
1969+ }
1970+
19611971 // Execute client tools in parallel (non-blocking) - same pattern as main tool_call handler
19621972 try {
19631973 const def = getTool ( name )
You can’t perform that action at this time.
0 commit comments