fix: add --no-messages flag to ripgrep to suppress file access errors (#6757)

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.

Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-08-12 17:51:06 -04:00 committed by GitHub
parent 245bc2a2e6
commit 7b0f489ea2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,7 +150,7 @@ export async function regexSearchFiles(
throw new Error("Could not find ripgrep binary")
}
const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", directoryPath]
const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", "--no-messages", directoryPath]
let output: string
try {