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
- no Ripgrep installed
- ask agent to use Glob to check file existence
Screenshot and/or share link
No response
Operating System
Windows11
Terminal
Windows Terminal
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:
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:
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
Screenshot and/or share link
No response
Operating System
Windows11
Terminal
Windows Terminal