continuedev / continuedev/continue
grep_search tool returns no results on Windows due to backslash path separator in ripgrep output
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Before submitting your bug report
- I've tried finding an answer on the Continue docs site
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in core/util/grepSearch.ts and inspect formatGrepSearchResults, especially how it identifies ripgrep file-header lines. Reproduce the grep_search call on Windows or with backslash-separated paths, then verify that matching results are retained and no longer reported as empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100