Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 6, 2025

Fixes #6756

Summary

This PR adds the --no-messages flag to the ripgrep command arguments to suppress file access error messages (e.g., permission denied errors) that were causing the search_files tool to return empty results.

Problem

When ripgrep encounters files it cannot access due to permission issues, it outputs error messages that interfere with the JSON parsing of search results, causing the entire search operation to fail and return no results.

Solution

Added the --no-messages flag to the ripgrep arguments. According to the ripgrep documentation, this flag:

  • Suppresses all error messages related to opening and reading files
  • Still shows error messages related to pattern syntax errors
  • Allows the search to continue and return valid results from accessible files

Changes

  • Modified src/services/ripgrep/index.ts line 153 to include --no-messages in the ripgrep arguments array

Testing

  • Ran existing tests for the ripgrep service - all tests pass
  • The change is minimal and only affects error message suppression, not the core search functionality

Important

Adds --no-messages flag to ripgrep command in index.ts to suppress file access error messages, allowing search to continue with accessible files.

  • Behavior:
    • Adds --no-messages flag to ripgrep command in regexSearchFiles() in index.ts to suppress file access error messages.
    • Suppresses errors like permission denied, but still shows pattern syntax errors.
    • Allows search to continue and return results from accessible files.
  • Testing:
    • Ran existing tests for ripgrep service; all tests pass.

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

Fixes #6756

When ripgrep encounters file access errors (e.g., permission denied), it would cause the search_files tool to return empty results. Adding the --no-messages flag suppresses these error messages while still showing pattern syntax errors, allowing the search to continue and return valid results from accessible files.
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 6, 2025 17:13
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Aug 6, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 6, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 7, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 7, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Aug 12, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 12, 2025
@mrubens mrubens merged commit 7b0f489 into main Aug 12, 2025
31 checks passed
@mrubens mrubens deleted the fix/ripgrep-file-access-errors branch August 12, 2025 21:51
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 12, 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 lgtm This PR has been approved by a maintainer PR - Needs Review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

search_files tool may return empty result if rg encounters file access errors during search

5 participants