Skip to content

Server plugins with no discoverable entrypoint are dropped silently (report.missing is a no-op) #46587

Description

@cedoor

Description

The server-plugin loader silently ignores installed npm plugins that don't expose a plugin entrypoint: the report.missing handler it passes to loadExternal for kind: "server" is an empty no-op (missing(){}), while error does log install/load/compatibility failures. So a package listed in plugin that installs fine but resolves zero server targets disappears without any error or warning anywhere — the session just boots without the plugin.

Concrete example: @atlante/opencode@0.1.19 had "main": null and exports with only . and ./api. It installed into ~/.cache/opencode/packages/... on every boot, registered nothing, and never logged anything. Booting with the fixed package.json (non-empty "main" + exports["./server"]) loads it immediately, which confirms discovery was the only problem.

Meanwhile the opencode plugin CLI path already has a good diagnostic for exactly this state (manifest_no_targets: "does not expose plugin entrypoints in package.json — Expected one of: exports["./tui"], exports["./server"], package.json main for server, or package.json["oc-themes"] for tui themes."). The boot loader could reuse it: when an installed plugin yields zero targets, log an error/warning (ideally naming the missing convention) instead of dropping it silently.

Happy to send a PR if you point me at where the report handlers are defined in the new codebase.

Plugins

@atlante/opencode (our adapter; OpenCode plugin API via @opencode-ai/plugin)

OpenCode version

1.18.25

Steps to reproduce

  1. Create an npm package that imports @opencode-ai/plugin and exports a plugin, but whose package.json has no main and no exports["./server"] (only exports["."]).
  2. Reference it in opencode.json: "plugin": ["@atlante/opencode"].
  3. Boot opencode: the package installs into the plugin cache, no error is logged, and the plugin's agents/tools never appear.

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