Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/core/tools/ExecuteCommandTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions src/core/tools/__tests__/executeCommandTool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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"
Expand Down
Loading