Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 13, 2026

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_output state) would "disappear" and not be acknowledged by the agent.

Root Cause:
When a command is running (command_output state), 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 askResponse instead 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 in handleSendMessage. Now when a command is running, user messages are queued instead of sent directly, ensuring they are processed once the command completes.

Test Procedure

  1. Unit Test: Added a test case queues messages when command is running (command_output state) - Issue #10675 that verifies:

    • When in command_output state, messages are sent as queueMessage type
    • Messages are NOT sent as askResponse (which would cause them to be lost)
  2. Manual Testing:

    • Start a long-running command (e.g., sleep 60)
    • While the command is running, type a message and press Enter
    • The message should be queued (not disappear)
    • When the command completes or is cancelled, the queued message should be processed

Run the tests:

cd webview-ui && npx vitest run src/components/chat/__tests__/ChatView.spec.tsx

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes.
  • Documentation Impact: No documentation updates are required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - This is a behavioral fix with no UI changes.

Documentation Updates

  • No documentation updates are required.

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_output state by queuing messages in ChatView.tsx and adds tests in ChatView.spec.tsx.

  • Behavior:
    • Fixes message loss during command_output state by queuing messages in handleSendMessage in ChatView.tsx.
    • Adds clineAsk === "command_output" to queue condition to ensure messages are queued when a command is running.
  • Testing:
    • Adds test queues messages when command is running (command_output state) - Issue #10675 in ChatView.spec.tsx to verify queuing behavior.
    • Test ensures messages are queued and not sent as askResponse during command_output state.
  • Misc:
    • Updates dependencies in ChatView.tsx to include clineAsk in effect dependencies.

This description was created by Ellipsis for 39360eb. You can customize this summary. It will automatically update as commits are pushed.

When a command is running (command_output state), user messages were being
sent as askResponse and getting lost/ignored. This is because during
command_output: sendingDisabled=false, isStreaming=false, and
messageQueue.length=0, so messages bypassed the queue.

The fix adds clineAsk === "command_output" to the queue condition in
handleSendMessage. Now messages sent during command execution are queued
and will be processed once the command completes, fixing the disappearing
message bug.

Added test case to verify the fix.
@roomote
Copy link
Contributor Author

roomote bot commented Jan 13, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The fix correctly addresses Issue #10675 by adding clineAsk === "command_output" to the message queue condition. This ensures messages sent while a command is running are queued instead of being sent directly as askResponse (where they would be lost). The test coverage is adequate and all 24 tests pass.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Message Fails to Be Added to Queue When Command is Running

2 participants