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
- 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["."]).
- Reference it in
opencode.json: "plugin": ["@atlante/opencode"].
- Boot opencode: the package installs into the plugin cache, no error is logged, and the plugin's agents/tools never appear.
Description
The server-plugin loader silently ignores installed npm plugins that don't expose a plugin entrypoint: the
report.missinghandler it passes toloadExternalforkind: "server"is an empty no-op (missing(){}), whileerrordoes log install/load/compatibility failures. So a package listed inpluginthat 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.19had"main": nullandexportswith 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 pluginCLI 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
mainand noexports["./server"](onlyexports["."]).opencode.json:"plugin": ["@atlante/opencode"].