fix: preserve user message during command execution

When a command is running and user types a message before clicking
"Proceed While Running", the message was being lost. The frontend
was only sending a terminal continue operation without including
the user's typed text and images.

Fixed by sending the message as a messageResponse (similar to other
tool cases) when text/images are present, which the backend already
properly handles in ExecuteCommandTool.ts.

Fixes issue where messages disappear during command execution.
This commit is contained in:
Roo Code 2025-12-21 17:25:44 +00:00
parent 78dc34498b
commit d2f3aade75

View file

@ -727,7 +727,21 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
startNewTask()
break
case "command_output":
vscode.postMessage({ type: "terminalOperation", terminalOperation: "continue" })
// If user has typed a message, send it with the continue response
if (trimmedInput || (images && images.length > 0)) {
vscode.postMessage({
type: "askResponse",
askResponse: "messageResponse",
text: trimmedInput,
images: images,
})
// Clear input state after sending
setInputValue("")
setSelectedImages([])
} else {
// If no message, just continue the command
vscode.postMessage({ type: "terminalOperation", terminalOperation: "continue" })
}
break
}