You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Grep tool returns "No files found" for all searches on ARM64 Linux #13353
The built-in Grep tool returns "No files found" for every search, regardless of pattern, path, or include parameters. This has persisted across multiple OpenCode versions.
Reproduction
Any Grep tool call returns empty:
Grep(pattern="import", path="/home/user/project") → No files found
Grep(pattern="import", include="*.py") → No files found
Grep(pattern="def ") → No files found
Meanwhile, running the exact same rg binary with the same arguments from shell works perfectly:
# OpenCode's own rg binary, same args as grep.ts builds~/.local/share/opencode/bin/rg -nH --hidden --no-messages \
--field-match-separator='|' --regexp "import" --glob "*.py" /home/user/project
# → returns 20+ matches
Key observations
All Grep searches return empty — not pattern-specific, not path-specific
Glob tool works fine — Glob(pattern="**/*.py") finds files correctly
Shell rg works fine — identical binary, identical arguments, produces results
Duration ~0ms in logs — service=tool.registry status=completed duration=0 grep, suggesting the tool completes almost instantly without actually executing rg
The issue is not related to --follow / symlinks (tested: same results with and without symlinks)
The issue is not related to .gitignore filtering (files are git-tracked)
Analysis
Based on source code review of grep.ts:
grep.ts uses Bun.spawn([rgPath, ...args]) with stdout: "pipe" and signal: ctx.abort
The near-zero execution time suggests either:
Bun.spawn stdout pipe returns empty on ARM64 Linux
ctx.abort AbortSignal is pre-triggered, killing the process immediately
Some other Bun runtime issue on ARM64 + glibc 2.31
Ripgrep.files() (used by Glob) likely uses a different code path, which is why Glob works but Grep doesn't.
Expected behavior
Grep tool should return matching files and line numbers, consistent with direct rg execution.
I've been stuck with the same problem for a few days.
OpenCode version: 1.3.2 (Installed by brew)
OS: macOS 15.0 Sequoia (ARM64/arm64)
rg binary: /opt/anaconda3/bin/rg (ripgrep 11.0.2)
I am still seeing this behavior. I have worked around it by putting instructions in ~/.config/opencode/AGENTS.md to not use the Grep tool and instead use rg:
# Global Rules## Tool Usage
Grep tool is broken on Apple Silicon (returns "No files found" always); see https://github.com/anomalyco/opencode/issues/13353. Use `rg` via Bash instead. Glob and Read tools work fine.
-`rg "pattern" -tts -tjs` — filter by file type (`rg --type-list` for all types)
-`rg "pattern" path/` — scoped search
-`rg "pattern" --glob '*.tsx'` — manual glob (prefix `!` to exclude; use single quotes)
But I would rather not have to use this for every session.
Activity
tupton commentedon Mar 23, 2026
I'm seeing this exact issue on Mac OS 26.3.1 (ARM64), so it is not limited to Linux.
zhang185na commentedon Mar 25, 2026
I've been stuck with the same problem for a few days.
OpenCode version: 1.3.2 (Installed by brew)
OS: macOS 15.0 Sequoia (ARM64/arm64)
rg binary: /opt/anaconda3/bin/rg (ripgrep 11.0.2)
tupton commentedon Apr 24, 2026
I am still seeing this behavior. I have worked around it by putting instructions in
~/.config/opencode/AGENTS.mdto not use the Grep tool and instead userg:But I would rather not have to use this for every session.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.