fix: queue messages during command_output state (Issue #10675) #10677
+98
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #10675
Roo Code Task Context (Optional)
This PR was created by Roo Code to address the reported bug.
Description
This PR fixes the issue where user messages sent while a command is running (during the
command_outputstate) would "disappear" and not be acknowledged by the agent.Root Cause:
When a command is running (
command_outputstate), the following conditions are set:sendingDisabled = false(user can type)isStreaming = false(no API request in progress)messageQueue.length = 0(typically empty)Because none of the existing queue conditions were true, messages were sent directly as
askResponseinstead of being queued. These messages were then lost because the backend was waiting for terminal feedback, not a user message.The Fix:
Added
clineAsk === "command_output"to the queue condition inhandleSendMessage. Now when a command is running, user messages are queued instead of sent directly, ensuring they are processed once the command completes.Test Procedure
Unit Test: Added a test case
queues messages when command is running (command_output state) - Issue #10675that verifies:command_outputstate, messages are sent asqueueMessagetypeaskResponse(which would cause them to be lost)Manual Testing:
sleep 60)Run the tests:
Pre-Submission Checklist
Screenshots / Videos
N/A - This is a behavioral fix with no UI changes.
Documentation Updates
Additional Notes
This is an attempt to address Issue #10675. Feedback and guidance are welcome!
Get in Touch
@roomote
Important
Fixes message loss during
command_outputstate by queuing messages inChatView.tsxand adds tests inChatView.spec.tsx.command_outputstate by queuing messages inhandleSendMessageinChatView.tsx.clineAsk === "command_output"to queue condition to ensure messages are queued when a command is running.queues messages when command is running (command_output state) - Issue #10675inChatView.spec.tsxto verify queuing behavior.askResponseduringcommand_outputstate.ChatView.tsxto includeclineAskin effect dependencies.This description was created by
for 39360eb. You can customize this summary. It will automatically update as commits are pushed.