Skip to content

OpenCode v2 support plans? #34

Open

Description

@balaji-dutt

On AI assistance: Claude (Opus 5.5 / 1M context) helped me narrow down the behavior and draft the wording below, including the repro steps. The actual issue and workflow are mine. — @balaji-dutt

Is OpenCode v2 support on the roadmap? I'm asking now because v2 is starting to reach users through the main install paths:

  • The opencode.ai homepage and download page install v2 (opencode.ai/v2/install, @opencode/cli, anomalyco/tap/opencode-v2).
  • Homebrew core's opencode formula moved to v2 on 2026-09-28 (Homebrew/homebrew-core@480c4e864d), so brew upgrade opencode replaces 1.x with 2.x unless the formula is pinned.

v1 is still published (opencode-ai on npm, opencode.ai/install, anomalyco/tap/opencode), and the README lists "OpenCode v1.2+".

What breaks on v2

From the v2 migration guide and the plugin migration guide:

  • "V1 plugin implementations do not run in V2." The v2 loader (packages/core/src/plugin/module.ts at v2.0.22) only accepts a default export of { id, setup } or { id, effect }. The { id, server } export from Preserve MCP tools for Claude requests #19 fails with "Plugin must export a default definition with an id and an effect or setup function."
  • The bridge's core mechanism, auth.loader returning a custom fetch for the anthropic provider, has no v2 equivalent.

What v2 offers instead

From the guide's hook table and the v2.0.22 plugin types:

  • ctx.session.hook("http.request" | "http.response", ..., { providerID: "anthropic" }) passes a mutable web Request/Response (packages/plugin/src/promise/session.ts, wired in packages/core/src/session/model-request.ts). That looks like it could cover the header and body rewrite and the SSE handling.
  • ctx.integration OAuth method registration and credential resolution (packages/plugin/src/promise/integration.ts) for the auth.methods side.
  • ctx.session.hook("context", ...) in place of experimental.chat.system.transform.
  • The guide's dual-export shape (...Plugin.define({ id, setup }) plus server) lets one package serve v1 and v2.

So a port looks possible, but as a rewrite rather than a rename. Everything above comes from the v2 docs and the v2.0.22 source, not from running the bridge on v2. Open questions: whether http.request sees all Anthropic traffic (it fires for session model requests), and whether v2's built-in anthropic provider accepts the rewritten OAuth request.

Questions

  1. Do you plan to support v2? If so, as a dual v1/v2 package or as a separate major version?
  2. Until then, would you note in the README that the bridge requires OpenCode 1.x?

Activity

  1. added a commit that references this issue on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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