Skip to content

feat(opencode): use native OpenCode 2 by default - #7863

Draft
maria-rcks wants to merge 16 commits into
pingdotgg:mainfrom
maria-rcks:feat/opencode2-native
Draft

feat(opencode): use native OpenCode 2 by default#7863
maria-rcks wants to merge 16 commits into
pingdotgg:mainfrom
maria-rcks:feat/opencode2-native

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

OpenCode now uses the native v2 HTTP and SSE adapter under the existing opencode identity, 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. When opencode2 is 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.

Persistent OpenCode 2 auto-enable notice

Native OpenCode 2 turn through the adapter

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a407784-0a95-4f05-9f1e-296653e98736

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 22, 2026
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Provider.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/OpenCode2AutoEnableNotification.tsx Outdated
Comment thread apps/web/src/components/OpenCode2AutoEnableNotification.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/openCode2Runtime.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCode2Adapter.ts Outdated
@maria-rcks maria-rcks changed the title feat(opencode): add native OpenCode 2 support feat(opencode): use native OpenCode 2 by default Aug 22, 2026
Comment thread packages/contracts/src/settings.ts
Comment thread docs/internals/overview.md Outdated
Comment thread apps/server/src/textGeneration/OpenCodeTextGeneration.ts
Comment thread apps/server/src/provider/Drivers/OpenCodeDriver.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeProvider.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant