Before submitting your bug report
Relevant environment info
- OS: Windows 7
- Continue version: v2.0.0
- IDE version: VSCodium 1.116.02821
- Model: Unsloth Studio Local
Description
The grep_search agent tool always returns "The search returned no results" on Windows, even when ripgrep finds matches. If I use Process Monitor to catch rg.exe being run, and run it manually, I get search results. If I search the same string in VSCode I also get search results.
The bug is in core/util/grepSearch.ts in formatGrepSearchResults. The parser checks for file header lines using:
if (line.startsWith("./") || line === "--") {
On Windows, ripgrep outputs paths with backslashes (.\templates\foo\bar.tpl) instead of forward slashes (./templates/foo/bar.tpl). The startsWith("./") check never matches, so numResults stays 0 and all results are silently discarded despite the content being present.
I added || line.startsWith(".\\") to this check, and now I get the search results I expect.
To reproduce
- Ask the agent to search for a string that exists in the codebase using the grep_search tool
- Observe "The search returned no results" even though the string is present
Log output
Before submitting your bug report
Relevant environment info
Description
The grep_search agent tool always returns "The search returned no results" on Windows, even when ripgrep finds matches. If I use Process Monitor to catch rg.exe being run, and run it manually, I get search results. If I search the same string in VSCode I also get search results.
The bug is in
core/util/grepSearch.tsinformatGrepSearchResults. The parser checks for file header lines using:On Windows, ripgrep outputs paths with backslashes (.\templates\foo\bar.tpl) instead of forward slashes (./templates/foo/bar.tpl). The startsWith("./") check never matches, so numResults stays 0 and all results are silently discarded despite the content being present.
I added
|| line.startsWith(".\\")to this check, and now I get the search results I expect.To reproduce
Log output