Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 14, 2026

Related GitHub Issue

Closes: #10675

Roo Code Task Context (Optional)

This PR was created by Roo Code to address the follow-up comment from @johnameyer regarding the same issue happening when the "Roo wants to edit this file" prompt appears with "Save"/"Reject" options.

Description

This PR extends the fix for #10675 to handle all ask types where approval buttons are shown. Previously, messages sent during these states were lost because they were sent as askResponse but the backend expected button clicks.

Affected Ask Types:

  • tool - File edits: Save/Reject buttons (the case reported by @johnameyer)
  • command - Command execution: Run Command/Reject buttons
  • browser_action_launch - Browser actions: Approve/Reject buttons
  • use_mcp_server - MCP server usage: Approve/Reject buttons
  • command_output - Command running: Proceed While Running/Kill Command buttons

Root Cause:
When approval buttons are shown (enableButtons = true), the UI allows user input (sendingDisabled = false). Previously, messages were sent directly as askResponse: "messageResponse", but the backend was waiting for button clicks (yes/no), causing messages to be lost.

The Fix:
Added a check for isWaitingForButtonApproval in handleSendMessage. When buttons are enabled and the current ask type requires button-based approval, messages are now queued instead of sent directly. This ensures they are processed after the approval interaction completes.

Test Procedure

  1. Unit Tests: Added test cases for:

    • queues messages when tool approval buttons are shown (tool state) - Issue #10675
    • queues messages when command approval buttons are shown (command state)
    • queues messages when command is running (command_output state) - Issue #10675
  2. Manual Testing:

    • Prompt Roo to edit a file (triggers tool ask with Save/Reject buttons)
    • While buttons are shown, type a message and press Enter
    • The message should be queued (not disappear)
    • Click Save or Reject
    • The queued message should be processed afterward

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 PR attempts to address the follow-up comment on Issue #10675 regarding messages disappearing when the "Save"/"Reject" prompt is shown. This is a more comprehensive fix that covers all button-based approval scenarios, not just command_output.

Note: This PR supersedes the approach in PR #10677 which only addressed the command_output case. This fix is more general and handles all ask types where buttons are shown.

Feedback and guidance are welcome!

Get in Touch

@roomote


Important

Fixes message loss by queuing messages during approval button states in ChatView.tsx, with tests added in ChatView.spec.tsx.

  • Behavior:
    • Fixes message loss by queuing messages when approval buttons are shown in ChatView.tsx.
    • Affects tool, command, browser_action_launch, use_mcp_server, and command_output ask types.
    • Adds isWaitingForButtonApproval check in handleSendMessage to queue messages.
  • Tests:
    • Adds unit tests in ChatView.spec.tsx for queuing messages during tool, command, and command_output states.
    • Tests ensure messages are queued and not sent as askResponse during approval button states.

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

Fixes #10675 - Messages now queue when approval buttons are shown for:
- tool (file edits: Save/Reject)
- command (command execution: Run Command/Reject)
- browser_action_launch (browser actions: Approve/Reject)
- use_mcp_server (MCP server usage: Approve/Reject)
- command_output (command running: Proceed While Running/Kill Command)

Previously, messages sent during these states were lost because they were
sent as askResponse but the backend expected button clicks. Now messages
are properly queued and processed after the approval interaction completes.
@roomote
Copy link
Contributor Author

roomote bot commented Jan 14, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly addresses Issue #10675 by queueing messages when approval buttons are shown, preventing them from being lost. The fix:

  • Properly identifies button-approval ask types (tool, command, browser_action_launch, use_mcp_server, command_output)
  • Queues messages instead of sending them as askResponse when buttons are enabled
  • Correctly handles edge cases (e.g., followup which has buttons but should send messages directly)
  • Includes appropriate test coverage

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