From 80e6750f3827dd7310ae87a81a1802c00acd8342 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Fri, 20 Feb 2026 13:58:20 -0500 Subject: [PATCH] fix: emit command_output instead of error on cancel for cloud UI transition The cloud message parser only recognizes say:"command_output" to transition pending commands. Using say:"error" left the pending command stuck in the UI. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/core/tools/ExecuteCommandTool.ts | 2 +- src/core/tools/__tests__/executeCommand.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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