diff --git a/src/core/tools/ExecuteCommandTool.ts b/src/core/tools/ExecuteCommandTool.ts index d045c415cc..df29170082 100644 --- a/src/core/tools/ExecuteCommandTool.ts +++ b/src/core/tools/ExecuteCommandTool.ts @@ -373,7 +373,7 @@ export async function executeCommandInTerminal( task.isTerminalAbortedExternally = false const status: CommandExecutionStatus = { executionId, status: "cancelled" } provider?.postMessageToWebview({ type: "commandExecutionStatus", text: JSON.stringify(status) }) - await task.say("error", "The command was cancelled by the user.") + await task.say("command_output", "Command cancelled.") task.didToolFailInCurrentTurn = true task.terminalProcess = undefined diff --git a/src/core/tools/__tests__/executeCommand.spec.ts b/src/core/tools/__tests__/executeCommand.spec.ts index 13f2baade6..57c86ba9c5 100644 --- a/src/core/tools/__tests__/executeCommand.spec.ts +++ b/src/core/tools/__tests__/executeCommand.spec.ts @@ -419,7 +419,7 @@ describe("executeCommand", () => { // Verify: should return a clean tool result, not throw expect(rejected).toBe(false) expect(result).toBe("The command was cancelled by the user.") - expect(mockTask.say).toHaveBeenCalledWith("error", "The command was cancelled by the user.") + expect(mockTask.say).toHaveBeenCalledWith("command_output", "Command cancelled.") expect(mockTask.didToolFailInCurrentTurn).toBe(true) expect(mockTask.terminalProcess).toBeUndefined() // Verify the flag was reset