Repository navigation
OpenCode v2 support plans? #34
Description
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
opencodeformula moved to v2 on 2026-09-28 (Homebrew/homebrew-core@480c4e864d), sobrew upgrade opencodereplaces 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.tsat 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.loaderreturning a customfetchfor theanthropicprovider, 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 webRequest/Response(packages/plugin/src/promise/session.ts, wired inpackages/core/src/session/model-request.ts). That looks like it could cover the header and body rewrite and the SSE handling.ctx.integrationOAuth method registration and credential resolution (packages/plugin/src/promise/integration.ts) for theauth.methodsside.ctx.session.hook("context", ...)in place ofexperimental.chat.system.transform.- The guide's dual-export shape (
...Plugin.define({ id, setup })plusserver) 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
- Do you plan to support v2? If so, as a dual v1/v2 package or as a separate major version?
- Until then, would you note in the README that the bridge requires OpenCode 1.x?
Activity
Migrate opencode to v2