Skip to content

Plugin install fails with valid proxy env: fetch() proxy.url must be a non-empty string #21468

Closed as not planned

Description

@vanish1984

Description

Summary

When plugin is configured with a package name such as oh-my-openagent, OpenCode 1.4.0 fails during plugin installation on macOS with:

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

The proxy environment in the shell is valid. As a result the plugin is not loaded, custom agents are not registered, and OpenCode falls back to the default agent.

Environment

  • OpenCode: 1.4.0
  • OS: macOS
  • Node.js: v22.21.1
  • Bun: 1.3.6
  • Proxy env in shell:
    • http_proxy=http://127.0.0.1:7890
    • https_proxy=http://127.0.0.1:7890

Reproduction

  1. Configure OpenCode with a package-name plugin entry:
{
  "plugin": ["oh-my-openagent"]
}
  1. Ensure the shell has valid proxy vars set, for example:
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
  1. Run:
opencode --print-logs run --agent sisyphus "return exactly: plugin-check-ok"

Expected

OpenCode should install or load the plugin successfully and the sisyphus agent should be available.

Actual

OpenCode logs:

INFO  service=plugin path=oh-my-openagent loading plugin
INFO  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
!  agent "sisyphus" not found. Falling back to default agent

Additional checks

  • Reproduces even after explicitly source ~/.zshrc in a fresh zsh process.
  • Reproduces even when injecting npm_config_proxy and npm_config_https_proxy directly into the opencode command environment.
  • Shell proxy variables are present and non-empty.
  • Direct package usage via local filesystem path works immediately.

Workaround

Use a local filesystem path in the plugin array instead of the package name:

{
  "plugin": ["/Users/.../.cache/opencode/node_modules/oh-my-openagent"]
}

With the local path, sisyphus loads correctly and runs.

Question

It looks like the package-install code path is constructing or reading a proxy config object with an empty url, even though valid proxy env vars exist in the parent shell. Could you check the plugin installer proxy resolution logic in 1.4.0?

Plugins

oh-my-openagent

OpenCode version

1.4.0

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 8, 2026
  2. github-actions commented on Apr 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review those issues and consider whether your report adds new information or a different scenario. If so, please link to the related issues for context.

  3. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 6, 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