Skip to content

Plugin install via npm fails behind proxy with 'fetch() proxy.url must be a non-empty string' #21098

Closed

Description

@WSXYT

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

  1. 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
  2. Configure an npm-backed plugin in ~/.config/opencode/opencode.json, for example:
    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["oh-my-openagent"]
    }
  3. Start opencode
  4. Observe plugin installation attempt in logs
  5. 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)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 5, 2026
  2. HashTagGit commented on Apr 5, 2026

    @HashTagGit

    meet the same problem in windows11

  3. rijuyuezhu commented on Apr 5, 2026

    @rijuyuezhu

    Same problem on archlinux with opencode 1.3.15; I think this might be a regression since the plugins worked well for me yesterday.

  4. YanzheL commented on Apr 5, 2026

    @YanzheL

    Same issue here. Worked previously, but broken with latest 1.3.15 version

  5. WSXYT commented on Apr 5, 2026

    @WSXYT
    Author

    Same issue here. Worked previously, but broken with latest 1.3.15 version

    Yes, I was surprised too—the Omo agent suddenly vanished. I was in the middle of installing a skill at the time, and I even wondered if the skill had caused some sort of injection or something.

  6. willo0o commented on Apr 5, 2026

    @willo0o

    same issue.
    I workaround by this way

    export no_proxy="registry.npmjs.org"; source ~/.bashrc && opencode

    wait opencode to install/load OmO plugin finished
    then unset no_proxy and source ~/.bashrc, OmO still worked

  7. YanzheL commented on Apr 5, 2026

    @YanzheL

    I can confirm that this issue starts with version 1.3.14.
    So I rollback to 1.3.13, and it works.

  8. GoldenBaozi commented on Apr 6, 2026

    @GoldenBaozi

    same issue here on windows11 and opencode version 1.3.15, current workaround is to install plugins using npm install <plugin> -g, then manually add the path of the index.js (typically in the dist/ directory in the package folder) to the "plugins" entry in opencode.jsonc, and the path may start with "file:///"

  9. Karuisawa-Mrs commented on Apr 6, 2026

    @Karuisawa-Mrs

    I hit this on Windows while trying to install/load oh-my-openagent as an OpenCode plugin.

    Observed behavior:

    • OpenCode had a plugin entry configured, but the plugin was not actually installed into the normal runtime path.
    • opencode plugin oh-my-openagent@latest -g --force failed with:
      request to https://registry.npmjs.org/oh-my-openagent failed, reason: fetch() proxy.url must be a non-empty string
    • In my shell, HTTP_PROXY / HTTPS_PROXY / http_proxy / https_proxy were all set to http://127.0.0.1:7890.

    Impact:

    • OpenCode behaved as if the external plugin had not loaded.
    • For OmO specifically, the UI effectively fell back to builtin behavior and only the stock agents were visible.

    Workaround that fixed it locally:

    1. Create a local cache package dir:
      C:\Users\Admin\.cache\opencode\packages\oh-my-openagent@latest
    2. In that directory run:
      npm install [email protected] [email protected] [email protected]
    3. Point the OpenCode plugin entry directly at the local plugin file instead of the npm spec:
      file:///C:/Users/Admin/.cache/opencode/packages/oh-my-openagent@latest/node_modules/oh-my-openagent/dist/index.js
    4. Fully restart OpenCode.

    After that:

    • opencode debug config resolved the plugin and its agents correctly
    • opencode run --agent 'Sisyphus (Ultraworker)' ... worked

    So from this machine at least, the regression is consistent with a broken npm/plugin-install path under proxy handling, and using a direct local file:///.../dist/index.js plugin entry is an effective workaround.

  10. sad-apple commented on Apr 7, 2026

    @sad-apple

    Also encountering this issue on WSL2 with http_proxy/https_proxy environment variables set. Same error: fetch() proxy.url must be a non-empty string when opencode tries to install plugins at startup.

    Environment:

    • OS: Linux (WSL2)
    • Proxy: Windows VPN via WSL2
  11. yu-zou commented on Apr 7, 2026

    @yu-zou

    Same issue for version 1.3.17

  12. tongsh6 commented on Apr 7, 2026

    @tongsh6

    I can confirm this on Windows as well, and in my case it directly prevented oh-my-openagent / Sisyphus from loading after upgrade.

    Environment

    • OpenCode: 1.3.17
    • oh-my-openagent: 3.15.3
    • OS: Windows 11
    • Shell: PowerShell
    • Proxy env:
      • HTTP_PROXY=http://127.0.0.1:7897
      • HTTPS_PROXY=http://127.0.0.1:7897
      • ALL_PROXY=http://127.0.0.1:7897
      • NO_PROXY=localhost,127.0.0.1,::1

    What changed

    This was working for me before I shut down 5 days ago.
    After rebooting today and upgrading both OpenCode and oh-my-openagent, I could no longer use Sisyphus directly.

    Reproduction

    1. Configure OpenCode with:
      {
        "$schema": "https://opencode.ai/config.json",
        "plugin": [
          "oh-my-openagent@latest"
        ]
      }
    2. Start opencode or run:
      opencode --print-logs --log-level DEBUG run --agent sisyphus ping
    3. Observe plugin install/load failure.

    Actual behavior

    OpenCode tries to install the plugin at runtime and fails with:

    request to https://registry.npmjs.org/oh-my-openagent failed, reason: fetch() proxy.url must be a non-empty string
    

    Relevant logs:

    service=plugin path=oh-my-openagent@latest loading plugin
    service=npm pkg=oh-my-openagent@latest installing package
    ERROR service=plugin pkg=oh-my-openagent version=latest error=request to https://registry.npmjs.org/oh-my-openagent failed, reason: fetch() proxy.url must be a non-empty string failed to install plugin
    

    After that, OpenCode falls back to the default built-in agent instead of the plugin-provided one.

    For example:

    agent "sisyphus" not found. Falling back to default agent
    > build · gpt-5.3-codex
    

    Important observation

    This does not look like an oh-my-openagent package problem.

    I verified that if I bypass OpenCode's npm/plugin install path and point OpenCode to the already-installed local plugin directory, the plugin works again and the default agent becomes:

    > Sisyphus (Ultraworker) · kimi-k2.5
    

    In my case, this local plugin path worked:

    C:\Users\tongs\.cache\opencode\node_modules\oh-my-openagent
    

    And with:

    $env:OPENCODE_CONFIG_CONTENT='{"plugin":["C:\\Users\\tongs\\.cache\\opencode\\node_modules\\oh-my-openagent"]}'
    opencode run ping

    I get:

    > Sisyphus (Ultraworker) · kimi-k2.5
    Pong.
    

    So the regression seems to be specifically in OpenCode's runtime plugin install / proxy handling path on Windows.

  13. added a commit that references this issue on Apr 7, 2026
    fcb4711
  14. linG5821 commented on Apr 8, 2026

    @linG5821

    same issue.  同样的问题。 I workaround by this way我通过这种方式解决了这个问题。

    export no_proxy="registry.npmjs.org"; source ~/.bashrc && opencode

    wait opencode to install/load OmO plugin finished等待 OpenCode 安装/加载 OmO 插件完成 then unset no_proxy and source ~/.bashrc, OmO still worked然后取消设置 no_proxy 并执行 ~/.bashrc,OmO 仍然有效

    OpenCode 1.3.17 在Windows 上这对我有效, 我的 Sisyphus 又回来了
    $env:no_proxy="registry.npmjs.org"
    opencode plugin oh-my-openagent@latest -g

  15. 8 remaining items

  16. cnbebop commented on Apr 10, 2026

    @cnbebop

    +1, same question

  17. killerddd3 commented on Apr 12, 2026

    @killerddd3

    same as

  18. zsynacl commented on Apr 14, 2026

    @zsynacl

    I hit this on Windows while trying to install/load oh-my-openagent as an OpenCode plugin.

    Observed behavior:

    • OpenCode had a plugin entry configured, but the plugin was not actually installed into the normal runtime path.
    • opencode plugin oh-my-openagent@latest -g --force failed with:
      request to https://registry.npmjs.org/oh-my-openagent failed, reason: fetch() proxy.url must be a non-empty string
    • In my shell, HTTP_PROXY / HTTPS_PROXY / http_proxy / https_proxy were all set to http://127.0.0.1:7890.

    Impact:

    • OpenCode behaved as if the external plugin had not loaded.
    • For OmO specifically, the UI effectively fell back to builtin behavior and only the stock agents were visible.

    Workaround that fixed it locally:

    1. Create a local cache package dir:
      C:\Users\Admin\.cache\opencode\packages\oh-my-openagent@latest
    2. In that directory run:
      npm install [email protected] [email protected] [email protected]
    3. Point the OpenCode plugin entry directly at the local plugin file instead of the npm spec:
      file:///C:/Users/Admin/.cache/opencode/packages/oh-my-openagent@latest/node_modules/oh-my-openagent/dist/index.js
    4. Fully restart OpenCode.

    After that:

    • opencode debug config resolved the plugin and its agents correctly
    • opencode run --agent 'Sisyphus (Ultraworker)' ... worked

    So from this machine at least, the regression is consistent with a broken npm/plugin-install path under proxy handling, and using a direct local file:///.../dist/index.js plugin entry is an effective workaround.

    wonder how to do step 3: point the opencode plugin entry directly to local file

  19. yiz-liu commented on Apr 14, 2026

    @yiz-liu

    I solved this by manually installing the package into ~/.config/opencode and ~/.opencode, take oh-my-openagent for an example:

    cd ~/.config/opencode
    # set your proxy
    npm install oh-my-openagent@latest

    Then replaced the plugin entry in OpenCode config from an npm spec (oh-my-openagent@latest) to a local filesystem path:

    {
      "$schema": "https://opencode.ai/config.json"
      "plugin": [
        "~/.config/opencode/node_modules/oh-my-openagent"
      ]
    }
  20. red55 commented on Apr 15, 2026

    @red55

    the same. opencode version 1.4.4

  21. bakabird commented on Apr 16, 2026

    @bakabird

    +1 same problem

  22. rammiah commented on Apr 18, 2026

    @rammiah

    please help with this issue!

  23. rekram1-node commented on Apr 20, 2026

    @rekram1-node
    Collaborator

    This is kinda annoying, this bug is actually a bug in the bun runtime, ill see if I can apply a patch to one of the lower level packages to fix it before it gets to bun, im not sure exactly yet.

    One of our maintainers actually has a PR to bun to fix it: oven-sh/bun#28902

  24. rekram1-node commented on Apr 20, 2026

    @rekram1-node
    Collaborator

    Alr it seems like i can apply a patch to arborist to get around the issue

  25. rekram1-node commented on Apr 20, 2026

    @rekram1-node
    Collaborator

    To those who hit this bug, you may need to rm -rf ~/.cache/opencode/packages/

    Ill see if I can automate removing partially installed deps

  26. codelonesomest commented on Apr 28, 2026

    @codelonesomest
    Image

    Lol... desktop app is not loaded the oh-my-openagent agents but cli does

  27. shigomany commented on May 8, 2026

    @shigomany

    Same behaviour

  28. 316xu commented on Jun 9, 2026

    @316xu

    same with the newest version,win11 + ubuntu wsl

  29. rekram1-node commented on Jun 9, 2026

    @rekram1-node
    Collaborator

    There was a regression, a package was bumped without updating the patch, it's fixed in dev will release later today

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions