Description
OpenCode fails to install an npm plugin when proxy environment variables are present.
In my case, trying to load oh-my-openagent through the normal plugin spec caused OpenCode to attempt an npm install and fail with:
request to https://registry.npmjs.org/oh-my-openagent failed, reason: fetch() proxy.url must be a non-empty string
and later also:
request to https://registry.npmjs.org/zod/-/zod-4.3.6.tgz failed, reason: fetch() proxy.url must be a non-empty string
This happened while the shell environment had:
http_proxy=http://127.0.0.1:7897
https_proxy=http://127.0.0.1:7897
all_proxy=socks5://127.0.0.1:7897
The failure happens during OpenCode's plugin install path, not because the plugin package itself is bad.
A working workaround was to avoid the npm/plugin install path entirely and point OpenCode at a locally installed plugin directory instead of using a package spec.
So this looks like an upstream proxy handling bug in OpenCode's plugin install/npm fetch path.
Plugins
oh-my-openagent
OpenCode version
1.3.15
Steps to reproduce
- Set proxy environment variables, for example:
export http_proxy=http://127.0.0.1:7897
export https_proxy=http://127.0.0.1:7897
export all_proxy=socks5://127.0.0.1:7897
- Configure an npm-backed plugin in
~/.config/opencode/opencode.json, for example:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["oh-my-openagent"]
}
- Start
opencode
- Observe plugin installation attempt in logs
- Observe failure fetching from
registry.npmjs.org with:
fetch() proxy.url must be a non-empty string
Screenshot and/or share link
N/A
Operating System
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 GNU/Linux
Terminal
xterm-256color (WSL)
Description
OpenCode fails to install an npm plugin when proxy environment variables are present.
In my case, trying to load
oh-my-openagentthrough the normal plugin spec caused OpenCode to attempt an npm install and fail with:and later also:
This happened while the shell environment had:
The failure happens during OpenCode's plugin install path, not because the plugin package itself is bad.
A working workaround was to avoid the npm/plugin install path entirely and point OpenCode at a locally installed plugin directory instead of using a package spec.
So this looks like an upstream proxy handling bug in OpenCode's plugin install/npm fetch path.
Plugins
oh-my-openagent
OpenCode version
1.3.15
Steps to reproduce
~/.config/opencode/opencode.json, for example:{ "$schema": "https://opencode.ai/config.json", "plugin": ["oh-my-openagent"] }opencoderegistry.npmjs.orgwith:Screenshot and/or share link
N/A
Operating System
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 GNU/Linux
Terminal
xterm-256color (WSL)