-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix: Prevent auto-acceptance of attempt_completion when messages are queued #9316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…queued - Check for queued messages before auto-accepting completion - Process queued messages as user feedback instead of accepting - Add tests for queued message handling during attempt_completion Fixes #9314
Review completed. Found 1 issue that needs attention:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| // Check if there are queued messages before auto-accepting | ||
| const hasQueuedMessages = !task.messageQueueService.isEmpty() | ||
|
|
||
| // If there are queued messages, don't auto-accept the completion | ||
| // Instead, process the queued messages first | ||
| if (hasQueuedMessages) { | ||
| // Get the first queued message | ||
| const queuedMessage = task.messageQueueService.dequeueMessage() | ||
| if (queuedMessage) { | ||
| // Add the queued message as user feedback | ||
| await task.say("user_feedback", queuedMessage.text ?? "", queuedMessage.images) | ||
|
|
||
| const feedbackText = `The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n<feedback>\n${queuedMessage.text}\n</feedback>` | ||
| pushToolResult(formatResponse.toolResult(feedbackText, queuedMessage.images)) | ||
|
|
||
| // Process any remaining queued messages | ||
| task.processQueuedMessages() | ||
| return | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queued message check is placed after the subtask approval logic (lines 70-81), which means subtasks will bypass this check entirely. Since the issue mentions orchestrator flows (which use subtasks), queued messages during subtask completion will still be ignored. The check should be moved before the if (task.parentTask) block to ensure both regular tasks and subtasks handle queued messages.
Fix it with Roo Code or mention @roomote and request a fix.
Description
This PR attempts to address Issue #9314. When messages are queued during
attempt_completion, they are now processed as user feedback instead of being ignored and having the completion auto-accepted.Problem
Previously, if a user queued messages while a task was finishing (particularly in orchestrator flows), the
attempt_completionwould be automatically accepted without processing the queued messages. This caused issues where users had to go back to subtasks and re-send messages.Solution
AttemptCompletionToolto detect queued messages before auto-acceptingTesting
Fixes #9314
Feedback and guidance are welcome!
Important
This PR prevents auto-acceptance of task completion by processing queued messages as user feedback in
AttemptCompletionTool.ts.AttemptCompletionTool.ts, added check for queued messages before auto-accepting task completion.attemptCompletionTool.spec.tsto verify queued message handling.This description was created by
for 75bc9bb. You can customize this summary. It will automatically update as commits are pushed.