Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

Fixes #6028

Problem

Commands with complex syntax (escaped quotes, special characters) were failing with a misleading "The user denied this operation" error without ever showing an approval prompt. The actual parsing/processing error was being swallowed and replaced with a generic denial message.

Solution

  • Added proper error handling in the askApproval function to catch and display actual parsing errors
  • Created a new parsingError response type to clearly indicate when errors occur during command parsing
  • Now users see the actual error message (e.g., "Failed to parse command: Invalid escape sequence") instead of the misleading denial message

Changes

  1. src/core/assistant-message/presentAssistantMessage.ts

    • Wrapped the cline.ask() call in a try-catch block
    • On error, display the actual error message and use the new parsingError response
  2. src/core/prompts/responses.ts

    • Added parsingError response type with clear messaging that the error occurred before the approval dialog could be shown

Testing

  • All existing tests pass
  • The fix properly displays parsing errors instead of the generic denial message
  • No breaking changes to existing functionality

Important

Improves error handling in presentAssistantMessage.ts to display actual parsing errors instead of misleading denial messages.

  • Behavior:
    • askApproval function in presentAssistantMessage.ts now catches and displays parsing errors instead of showing a generic denial message.
    • Introduces parsingError response type in responses.ts to indicate parsing issues clearly.
  • Error Handling:
    • Wraps cline.ask() in a try-catch block in presentAssistantMessage.ts to handle and display errors properly.
    • Uses formatResponse.parsingError to provide detailed error messages.
  • Testing:
    • All existing tests pass.
    • Parsing errors are now correctly displayed instead of a generic denial message.

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

- Add try-catch in askApproval to properly handle parsing errors
- Add new parsingError response type for clearer error messages
- Fixes #6028 where complex command syntax showed misleading error
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 18:05
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jul 21, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 21, 2025
@daniel-lxs
Copy link
Member

This doesn't solve the issue at all

@daniel-lxs daniel-lxs closed this Jul 23, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 23, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Commands with complex syntax show "The user denied this operation" without prompting user

4 participants