Repository navigation
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Adds an
opencode2provider driver beside the existingopencode(v1) driver.OpenCode 2 is a different architecture than v1 — one shared background service instead of a spawned per-thread server, and an Effect-native client instead of promises — so it can't be handled by the v1 driver.
opencode2Runtime.ts: connects to the background service (or a configuredserverUrl), 2.x version gate, loads model/skill inventory.OpenCode2Adapter.ts: drives turns fromsession.execution.*events; reconnects with backoff and reconciles, since v2 streams have no replay. Resume re-adopts a versioned session cursor, rollback forks, compaction is native.buildOpenCode2SessionRules: maps T3 runtime modes onto server-enforced permission rules, so supervised modes hold on a shared server.OpenCode2Provider/OpenCode2Driver: health + inventory probe, manual-only maintenance, text generation viagenerate.text.Also registers the driver in the web and mobile pickers/settings, and adds
OpenCode2Settingsto contracts.Why
T3 Code lists OpenCode as supported, but the v1 driver targets a different product and cannot connect to OpenCode 2. Users on v2 have no working path today.
Building on
@opencode/client/effectavoids promise bridging, per-thread server processes, and string-matching on errors, and lets supervised modes be enforced server-side.Verified against a live OpenCode 2.0.3 service: inventory loads, MCP tool calls work through the per-thread token, title generation succeeds, sessions resume across restarts.
Also, note that it uses official opencode Effect client instead of wrapping promise-based client like #8207 does. Besides this, runtime code was duplicated intentionally instead of reusing OpenCode 1's code - keeping it separate.
UI Changes
One provider entry: Settings row, model picker, icon mapping, default model
openai/gpt-6-astra(v1-eragpt-5is gone from the v2 catalog).Checklist
Summary by CodeRabbit