Skip to content

Improve error handling for Ripgrep binary download in offline environments #21646

Closed as not planned

Description

@XiaoleiJia1005

Description

Description
When using the Glob tool in an offline environment where ripgrep is not pre-installed, the agent fails with an confusing error message in the TUI:

✱ Glob "xxxx.ts" 
Unable to connect. Is the computer able to access the url?

Root Cause
The message is confusing for both users and the LLM. Based on the source code, the root cause is an unhandled exception thrown by the fetch call when it attempts to download the ripgrep binary from GitHub. Currently, the raw network exception from the runtime (Bun) is being bubbled up directly to the UI.

Proposed Solution
Adding a proper .catch() handler around the fetch call responsible for downloading the binary to capture the network exception.
Log the specific target URL that failed to download for debugging purposes.
Throw the existing error RipgrepDownloadFailedError.

Expected Behavior
After the fix, the user (and the LLM) should see a more descriptive error:

✱ Glob "xxxx.ts" 
RipgrepDownloadFailedError

Why this is better
This error information allows the LLM to make better decisions for its next step—such as attempting a retry, switching to a different tool, or informing the user to install ripgrep manually.

Plugins

No

OpenCode version

v1.3.13

Steps to reproduce

  1. no Ripgrep installed
  2. ask agent to use Glob to check file existence

Screenshot and/or share link

No response

Operating System

Windows11

Terminal

Windows Terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 9, 2026
  2. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions