Skip to content

Plugin package with a subpath export fails to install (pkg/subpath parsed as GitHub repo) #49852

Description

@lenucksi

Description

A plugin configured with an npm subpath export fails to install. opencode-pty ships a V2 entrypoint as opencode-pty/v2 (via exports: { "./v2": ... }), but the spec is parsed as a GitHub repo instead of an npm subpath.

Reproducing the parse directly:

$ bun add opencode-pty/v2
error: GET https://api.github.com/repos/opencode-pty/v2/tarball/ - 404
error: opencode-pty/v2 failed to resolve

Via the server (opencode plugin add opencode-pty/v2 or "plugins": [{"package": "opencode-pty/v2"}]) the log shows NpmInstallFailedError with An unknown git error occurred.

Cause: Npm.isInstallablePackage (packages/util/src/npm.ts) resolves package specs with npm-package-arg, which parses name/subpath as the GitHub shorthand github:name/subpath. Expected behaviour would be to install the registry root and import the full requested specifier (same gap as the closed #16586; related #47517).

Plugins

opencode-pty@0.4.0 (configured spec opencode-pty/v2)

OpenCode version

2.0.8

Steps to reproduce

  1. opencode plugin add opencode-pty/v2 (or add "plugins": [{"package": "opencode-pty/v2"}] to opencode.json)
  2. Server logs NpmInstallFailedError / An unknown git error occurred; the plugin never loads.
  3. Isolate the parse: bun add opencode-pty/v2GET https://api.github.com/repos/opencode-pty/v2/tarball/ - 404

Operating System

Fedora Linux (x64)

Terminal

not relevant to the bug (server-side install path)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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