Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit cc59868

Browse files
committed
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
1 parent 17d3456 commit cc59868

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/core/tools/ExecuteCommandTool.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ export class ExecuteCommandTool extends BaseTool<"execute_command"> {
128128
}
129129
}
130130

131+
// Process any queued messages after command execution completes
132+
task.processQueuedMessages()
133+
131134
return
132135
} catch (error) {
133136
await handleError("executing command", error as Error)

src/core/tools/__tests__/executeCommandTool.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe("executeCommandTool", () => {
6868
},
6969
recordToolUsage: vitest.fn().mockReturnValue({} as ToolUsage),
7070
recordToolError: vitest.fn(),
71+
processQueuedMessages: vitest.fn(),
7172
providerRef: {
7273
deref: vitest.fn().mockResolvedValue({
7374
getState: vitest.fn().mockResolvedValue({
@@ -158,6 +159,22 @@ describe("executeCommandTool", () => {
158159
expect(result).toContain("Command")
159160
})
160161

162+
it("should process queued messages after command execution", async () => {
163+
// Setup
164+
mockToolUse.params.command = "echo test"
165+
mockToolUse.nativeArgs = { command: "echo test" }
166+
167+
// Execute
168+
await executeCommandTool.handle(mockCline as unknown as Task, mockToolUse, {
169+
askApproval: mockAskApproval as unknown as AskApproval,
170+
handleError: mockHandleError as unknown as HandleError,
171+
pushToolResult: mockPushToolResult as unknown as PushToolResult,
172+
})
173+
174+
// Verify that processQueuedMessages was called after command execution
175+
expect(mockCline.processQueuedMessages).toHaveBeenCalled()
176+
})
177+
161178
it("should pass along custom working directory if provided", async () => {
162179
// Setup
163180
mockToolUse.params.command = "echo test"

0 commit comments

Comments
 (0)