diff --git a/extensions/copilot/src/extension/prompts/node/panel/toolCalling.tsx b/extensions/copilot/src/extension/prompts/node/panel/toolCalling.tsx index 59b7fa47486..9582b3c8cd9 100644 --- a/extensions/copilot/src/extension/prompts/node/panel/toolCalling.tsx +++ b/extensions/copilot/src/extension/prompts/node/panel/toolCalling.tsx @@ -607,6 +607,11 @@ async function appendHookContext( return; } + // Skip postToolUse hook if the request was cancelled - the response stream is closed + if (props.token.isCancellationRequested) { + return; + } + // Execute postToolUse hook after successful tool execution const postHookResult = await chatHookService.executePostToolUseHook( props.toolCall.name,