From cc5986818f1964da5c97975ae1c96b4eec48179e Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 27 Jan 2026 20:17:25 +0000 Subject: [PATCH] fix: process queued messages after execute_command completes The ExecuteCommandTool was not calling task.processQueuedMessages() after command execution, unlike other tools such as EditFileTool, WriteToFileTool, ApplyDiffTool, etc. This caused user messages sent during command execution to remain stuck in the queue instead of being processed. The fix adds processQueuedMessages() call after command execution completes, matching the pattern used by other tools. Fixes EXT-638 --- src/core/tools/ExecuteCommandTool.ts | 3 +++ .../tools/__tests__/executeCommandTool.spec.ts | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/core/tools/ExecuteCommandTool.ts b/src/core/tools/ExecuteCommandTool.ts index d3e2bbce8df..836280c101d 100644 --- a/src/core/tools/ExecuteCommandTool.ts +++ b/src/core/tools/ExecuteCommandTool.ts @@ -128,6 +128,9 @@ export class ExecuteCommandTool extends BaseTool<"execute_command"> { } } + // Process any queued messages after command execution completes + task.processQueuedMessages() + return } catch (error) { await handleError("executing command", error as Error) diff --git a/src/core/tools/__tests__/executeCommandTool.spec.ts b/src/core/tools/__tests__/executeCommandTool.spec.ts index 89b2575288b..8b61386dfc3 100644 --- a/src/core/tools/__tests__/executeCommandTool.spec.ts +++ b/src/core/tools/__tests__/executeCommandTool.spec.ts @@ -68,6 +68,7 @@ describe("executeCommandTool", () => { }, recordToolUsage: vitest.fn().mockReturnValue({} as ToolUsage), recordToolError: vitest.fn(), + processQueuedMessages: vitest.fn(), providerRef: { deref: vitest.fn().mockResolvedValue({ getState: vitest.fn().mockResolvedValue({ @@ -158,6 +159,22 @@ describe("executeCommandTool", () => { expect(result).toContain("Command") }) + it("should process queued messages after command execution", async () => { + // Setup + mockToolUse.params.command = "echo test" + mockToolUse.nativeArgs = { command: "echo test" } + + // Execute + await executeCommandTool.handle(mockCline as unknown as Task, mockToolUse, { + askApproval: mockAskApproval as unknown as AskApproval, + handleError: mockHandleError as unknown as HandleError, + pushToolResult: mockPushToolResult as unknown as PushToolResult, + }) + + // Verify that processQueuedMessages was called after command execution + expect(mockCline.processQueuedMessages).toHaveBeenCalled() + }) + it("should pass along custom working directory if provided", async () => { // Setup mockToolUse.params.command = "echo test"