Description
A recent architectural shift to prioritize "SEA" (Single Executable Application) bundling has introduced a performance regression for users on non-SEA distributions (e.g., standard npm install -g, or installations via Node version managers).
Specifically, PR #25342 (pushed April 13, 2026) refactored packages/core/src/tools/ripGrep.ts to use a strict internal discovery logic. This refactor removed the fallback that previously checked the system PATH for rg or rg.exe.
While the CLI correctly falls back to the TypeScript-based GrepTool implementation, this results in a significant performance degradation for searches in large codebases. Users who have ripgrep installed system-wide (via WinGet, Homebrew, etc.) are currently unable to leverage it because the CLI strictly searches only for architecture-specific filenames (like rg-win32-x64.exe) within its own relative vendor directories.
Reproduction
- Install
ripgrep globally on your system and ensure it is in your PATH.
- Install Gemini CLI via standard npm or a node version manager.
- Observe that the CLI fails to discover the system
rg and falls back to GrepTool, even if use_ripgrep: true is set in configuration.
Proposed Solution
We should re-introduce a system PATH discovery step as a final fallback (Tier 3) in getRipgrepPath().
By prioritizing the bundled binaries but allowing the system PATH as a last resort, we maintain the offline/security guarantees for the SEA builds while ensuring that other distribution channels remain performant and can leverage the user's existing tools.
If a maintainer can approve this direction, I would be happy to submit a PR implementing this low-priority fallback.
Description
A recent architectural shift to prioritize "SEA" (Single Executable Application) bundling has introduced a performance regression for users on non-SEA distributions (e.g., standard
npm install -g, or installations via Node version managers).Specifically, PR #25342 (pushed April 13, 2026) refactored
packages/core/src/tools/ripGrep.tsto use a strict internal discovery logic. This refactor removed the fallback that previously checked the systemPATHforrgorrg.exe.While the CLI correctly falls back to the TypeScript-based
GrepToolimplementation, this results in a significant performance degradation for searches in large codebases. Users who haveripgrepinstalled system-wide (via WinGet, Homebrew, etc.) are currently unable to leverage it because the CLI strictly searches only for architecture-specific filenames (likerg-win32-x64.exe) within its own relativevendordirectories.Reproduction
ripgrepglobally on your system and ensure it is in yourPATH.rgand falls back toGrepTool, even ifuse_ripgrep: trueis set in configuration.Proposed Solution
We should re-introduce a system
PATHdiscovery step as a final fallback (Tier 3) ingetRipgrepPath().By prioritizing the bundled binaries but allowing the system
PATHas a last resort, we maintain the offline/security guarantees for the SEA builds while ensuring that other distribution channels remain performant and can leverage the user's existing tools.If a maintainer can approve this direction, I would be happy to submit a PR implementing this low-priority fallback.