You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support opencode v2 plugin API (dual v1/v2 adapter) #15
opencode 2.0 replaced the plugin API. Thatch's plugin (v1 shape) fails to load on opencode v2 with a PluginModule.LoadError. This issue tracks the migration: dual v1/v2 support in the same @jeffober/thatch package -- no fork, MCP path untouched.
v2 requires a default export{ id, setup } (promise API) or { id, effect } (Effect API); the v1 named server export is not read. Verified at tag v2.0.9 (packages/core/src/plugin/module.ts).
The v2 SDK is a new npm name: @opencode/plugin (@opencode-ai/plugin frozen at 1.18.32).
Upstream migration doc is explicit: "Port plugins, because V1 plugin implementations do not run in V2."
Approach (from the plan)
Merged default export { id, setup, server } -- both loaders consume their own keys; verified against v1.18.32's readV1Plugin and (empirically) v2.0.9's Effect Schema decoder.
Lazy dynamic imports so each host's SDK (@opencode-ai/plugin vs @opencode/plugin) only resolves under its own runtime.
Declared degradation for v2-missing surfaces (child-session delete, session.list/messages, tui commands, toast publish path) with strategies in the plan's capability table.
Acceptance
Milestone 1: seam extraction, dual entry, shim updates, zero behavior change, mise run check green
Milestone 2: smoke tests against real opencode-v2 + v1 binaries; open questions resolved
Milestones 3-5: v2 adapter, toasts-or-degrade, mirrored test suite + Bun 1.4.2 CI/publish legs
Milestone 6: README "2.0 not yet supported" note removed, dev docs updated, release cut
Shipped in the opencode v2 dual adapter, merged to main as b57fdc7 (PR #16, six review rounds). The plugin loads and works on both opencode 1.x and 2.x from one package; the v2 degrades and post-release verification list are in docs/dev/features/opencode-plugin.md and the README.
Activity
OpenCode 2.x plugin support: dual v1/v2 adapter
sysread commentedon Sep 24, 2026
Shipped in the opencode v2 dual adapter, merged to main as b57fdc7 (PR #16, six review rounds). The plugin loads and works on both opencode 1.x and 2.x from one package; the v2 degrades and post-release verification list are in docs/dev/features/opencode-plugin.md and the README.