opencode-pty
opencode-pty copied to clipboard
Plugin fails to load on OpenCode v2.0.27 - incompatible plugin API
Bug Description
[email protected] fails to load as a plugin on OpenCode v2.0.27 with the following error:
Plugin must export a default definition with an id and an effect or setup function.
Environment
- OpenCode version: v2.0.27
- opencode-pty version: 0.4.0 (latest on npm)
- Platform: Windows 11
- Node: v22.18.0
Steps to Reproduce
- Install opencode-pty:
opencode plugin add opencode-pty@latest - Start OpenCode v2.0.27
- Plugin fails to load with the error above
Root Cause
OpenCode 2.0 introduced a new Effect-based plugin API that requires plugins to export a default definition with id and effect or setup function keys. opencode-pty currently uses the old export format (named exports like export { PTYPlugin }).
Expected Behavior
opencode-pty should either:
- Adapt to the new Effect-based plugin API, OR
- Provide a compatibility shim for OpenCode 2.x
Additional Context
- Similar issues reported for oh-my-openagent: https://github.com/code-yeongyu/oh-my-openagent/issues/10089
- Related v2 plugin installation bug: https://github.com/shekohex/opencode-pty/issues/67
Confirming this is still current as of 2026-10-16 — nothing changed on either side:
- Host upgraded to OpenCode 2.0.30 (
@opencode/cli, channellatest), Windows 11, Node v22.18.0 [email protected]remains npmlatest(last publish 2026-09-18)- Load still fails deterministically with the same message:
Plugin must export a default definition with an id and an effect or setup function.(refserr_ee462d92,err_5a1c4f26)
The host ships no V1 compatibility layer (https://opencode.ai/v2/docs/build/plugins/migrate-v1), so a V2-shaped default export ({ id, effect } or { id, setup }) is required for 2.x. Happy to re-test a V2 build.