Skip to content

Support OpenCode 2.0 (opencode2) — V2 plugin API port #103

Description

@Jaleel-VS

Summary

OpenCode 2.0 (the beta installed as opencode2) uses a new plugin API, and this plugin is currently V1-only. It fails to load on V2.

Symptom (V2 server log)

failed to load plugin target=@sunerpy/opencode-kiro-auth
cause=SchemaError(Missing key at ["default"]["effect"] / ["default"]["setup"])

The package (latest v0.20.6) depends on @opencode-ai/plugin@^1.15.11 (V1 API). Per the V2 migration guide: "V1 plugins will not work in V2."

What changed in V2

  • Config field pluginplugins (the V1 entry is auto-translated, so no config change needed).
  • Plugins must export a default object from Plugin.define({ id, setup }) using @opencode-ai/plugin (beta / /v2 entrypoints).
  • The plugin context is now an OpenCode server client; transforms live on ctx.agent, ctx.catalog.provider, ctx.catalog.model, ctx.integration, ctx.session, etc. Full reference: https://opencode.ai/v2/docs/build/plugins

Request

Port the plugin to the V2 plugin API and publish a V2-compatible release, or at least add a V2 entrypoint/branch. I'm happy to test against opencode2 (currently 0.0.0-next-17444) once a build is available.

Environment: macOS arm64, opencode v1.18.18 (works) + opencode2 V2 beta (broken).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions