Skip to content

Commit 7b0f489

Browse files
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 <[email protected]>
1 parent 245bc2a commit 7b0f489

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/ripgrep/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export async function regexSearchFiles(
150150
throw new Error("Could not find ripgrep binary")
151151
}
152152

153-
const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", directoryPath]
153+
const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", "--no-messages", directoryPath]
154154

155155
let output: string
156156
try {

0 commit comments

Comments
 (0)