feat(opencode): use native OpenCode 2 by default - #7863
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Reviewed the new OpenCode 2 Effect service modules (openCode2Runtime.ts, OpenCode2Adapter.ts, OpenCode2Provider.ts, OpenCode2TextGeneration.ts, OpenCode2Driver.ts) against the Effect service conventions. Five findings, all in apps/server/src/provider/openCode2Runtime.ts and its immediate consumers: error modelling (Data.TaggedError + free-form detail, kind discriminator driving user-facing messages, detail copied from cause.detail), a pass-through error factory, service-instance parameters on makeOpenCode2Runtime, and a standalone OpenCode2RuntimeShape interface. Everything else (driver registration, settings schema, web wiring) looks consistent with the existing provider conventions.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Reviewed the in-scope web changes (new OpenCode 2 notification, toast primitive change, provider metadata/placeholder additions). Two findings on the new notification component; the metadata/regex/placeholder additions and the disableSwipe plumbing look consistent with the existing contracts.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Reviewed the new commit (a757000, native service connection recovery) against the Effect service conventions. One new violation in the changed scope; the earlier findings on openCode2Runtime.ts (error modeling with Schema.TaggedErrorClass, kind driving caller-visible messages, the runtimeError pass-through helper, dependency acquisition in makeOpenCode2Runtime, the standalone OpenCode2RuntimeShape) and on the adapter's detail-from-cause wrappers are still open but already commented, so they are not repeated here.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
One finding: the OpenCode adapter contract is now declared in two places. Otherwise the OpenCode runtime service (inline Context.Service interface, make/layer, environment-acquired HttpClient/ChildProcessSpawner, Schema.TaggedErrorClass failures with derived messages, Effect.catchTags on the event stream) matches the conventions, and the earlier review points look addressed.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Reviewed the OpenCode service/runtime rewrite against the Effect service conventions. opencodeRuntime.ts now looks good: inline Context.Service interface, make/layer exports, dependencies (HttpClient, ChildProcessSpawner) acquired from the environment, structured Schema.TaggedErrorClass failures with derived messages and exported Schema.is predicates, and Effect.catchTags at the stream-failure boundary. One remaining finding on lost operation/stage context when wrapping runtime failures in ProviderAdapterProcessError.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
One finding: the new type re-export in Layers/OpenCodeAdapter.ts creates a second import path for OpenCodeAdapterShape. Everything else in the OpenCode 2 runtime/adapter rework matches the service conventions — inline service interface in Context.Service, environment-acquired HttpClient/ChildProcessSpawner in make, exported make/layer, Schema.TaggedErrorClass failures with derived messages and exported predicates, and Effect.catchTags for the tagged event-stream failures.
Posted via Macroscope — Effect Service Conventions
OpenCode now uses the native v2 HTTP and SSE adapter under the existing
opencodeidentity, so it appears once and existing settings and threads keep their stable provider identity. The runtime attaches to OpenCode's single shared daemon through the idempotent service command, supports both preview password command shapes, never stops the daemon, and preserves models, agents, skills, text generation, and stale resume recovery. Whenopencode2is detected, OpenCode is enabled by default and a first-run notice persists until the user dismisses it or opens provider settings from the notice. Verification covered 158 focused tests, targeted lint and formatting, plus a live attachment to the existing daemon that returned 29 models and 10 skills; the collaborative browser was unavailable for a new settings capture, so only still-accurate uploaded evidence is retained below, from GPT-5.6 Sol in T3 Code's Codex harness.