fix: claims plugin fails to load (unresolvable @opencode/plugin import) #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The plugin registered as
failedwith only "Plugin failed to load" and a per-attempt reference (err_7dd8e193, latererr_8e57cbb8). The reference appears nowhere in~/.local/share/opencode/log/opencode.log, so the server log does not carry the underlying error at the default INFO level.Root cause isolated by controlled experiment (each row is a real plugin directory the server loaded):
index.jsindex.tsindex.ts@opencode/pluginindex.ts@opencode-ai/pluginTypeScript, the default export and the hook were all fine. Bare package specifiers do not resolve for a local plugin loaded by path.
@opencode/pluginis not installed anywhere on disk (the runtime defines it internally for its own TUI plugin), and@opencode-ai/plugin@1.2.27is the V1 package, whose API has noPlugin.define.Fix
Drop the import.
Plugin.defineis an identity function in the runtime, so exporting the definition object directly is equivalent. Onlynode:builtins are used, and those resolve.Status after the change:
active, idknox.claims.