[BUG] Glob and Grep tools silently return empty results for valid queries
Problem
The Glob and Grep tools intermittently return "No files found" or "No matches found" when matches demonstrably exist. This is distinct from the timeout issues in #22379 and #16043 — it occurs on small directories where timeout is not a factor, and the equivalent find or rg command in Bash succeeds immediately.
Reproduction
This is intermittent, which makes it hard to provide a deterministic repro. The pattern observed:
- Run
Glob(pattern="**/*.md", path="/some/project")→ "No files found" - Run
find /some/project -name "*.md"via Bash → lists files correctly - Re-run the same Glob call → sometimes works on retry
Similarly with Grep:
Grep(pattern="some_function", path="/some/project")→ "No matches found"grep -r "some_function" /some/projectvia Bash → finds matches- Narrowing to a specific file path first sometimes makes it work
Workarounds
- Fall back to Bash
grep/findwhen Glob/Grep returns suspiciously empty results - Narrow the search path to a specific file or directory before trusting a broad "no results"
Environment
- Platform: Linux (WSL2)
- Observed consistently over ~5 weeks of daily use
- Not correlated with repo size (happens in projects with <100 files)
Impact
This silently produces incorrect results — the model proceeds as if the file/pattern doesn't exist, leading to wrong conclusions or unnecessary recreation of existing files. It's particularly insidious because there's no error signal; the tool reports success with empty results.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗