Skip to content

Ripgrep PATH fallback removed, breaking SearchText tool for npm/nvm installations #26409

Description

@wesamahakem

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

  1. Install ripgrep globally on your system and ensure it is in your PATH.
  2. Install Gemini CLI via standard npm or a node version manager.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitykind/bugpriority/p2Important but can be addressed in a future release.status/bot-triaged

    Type

    Projects

    Status
    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions