Describe the bug
When attempting to install any plugin using the opencode plugin <name> command, it crashes immediately if the HTTP_PROXY or HTTPS_PROXY environment variables are set.
The error thrown is:
request to https://registry.npmjs.org/<name> failed, reason: fetch() proxy.url must be a non-empty string
Steps to reproduce
- Export a valid proxy URL in the terminal (e.g.,
export HTTP_PROXY="http://127.0.0.1:7890" and export HTTPS_PROXY="http://127.0.0.1:7890").
- Run
opencode plugin diff (or any other plugin).
- See error:
■ Could not install "diff"
■ request to https://registry.npmjs.org/diff failed, reason: fetch() proxy.url must be a non-empty string
Expected behavior
The opencode plugin command's internal fetch logic should correctly parse the proxy URL from the environment variables and route the request, or cleanly bypass it. It seems to be an issue with how Bun's fetch or the custom proxy agent parses the environment variable string.
Environment
- OS: Linux
- OpenCode Version: 1.14.18
Describe the bug
When attempting to install any plugin using the
opencode plugin <name>command, it crashes immediately if theHTTP_PROXYorHTTPS_PROXYenvironment variables are set.The error thrown is:
request to https://registry.npmjs.org/<name> failed, reason: fetch() proxy.url must be a non-empty stringSteps to reproduce
export HTTP_PROXY="http://127.0.0.1:7890"andexport HTTPS_PROXY="http://127.0.0.1:7890").opencode plugin diff(or any other plugin).Expected behavior
The
opencode plugincommand's internalfetchlogic should correctly parse the proxy URL from the environment variables and route the request, or cleanly bypass it. It seems to be an issue with how Bun's fetch or the custom proxy agent parses the environment variable string.Environment