Repository navigation
fix(opencode): select the Connect protocol per model - #8856
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. Hygiene✅ Deterministic PR hygiene checks passed. |
|
Maintainer review of #8856 at 8d625b1: the design is approved. OpenCode V1 1.19.4 and V2 2.2.6 each selected Chat and Responses correctly from one generated config against mock upstreams, and refreshing a legacy managed config works. One CI blocker: Non-blocking: |
…oute; document the perModel matrix exception
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Maintainer update: this supersedes my earlier request. The CI failure was the route test's old expectation, not a parity bug. |
|
Maintainer integration into
|
Human Summary
I started out thinking we should move all OpenCode requests to Responses. #8829
Then I realized OpenCode already does the part we need for OpenCode Go: it can choose an API adapter per model.
"Connect" can use that same mechanism. If a model already has a direct Chat route, OpenCode can send Chat and the proxy can keep that path. Everything else uses Responses. From the user’s point of view, nothing changes: they still just pick a model.
Summary
OpenCode Connect currently generates Chat Completions for every model. This draft is a per-model alternative to #8829: both config generations default to Responses and opt a concrete model into Chat only when the existing router resolves it to a native-eligible Chat route from both ingress protocols. Native Responses models and dynamic routes keep the Responses default. Model selectors, managed ownership, and upstream routing are unchanged.
This reuses OpenCode's model-level adapter selection, so a user picks a model without selecting an API. It reuses the proxy's existing native paths; the regular per-request eligibility and admission checks still apply. Remote admission uses the same dedicated header, in the location each OpenCode generation reads.
Verification
bun run typecheck,bun run structure:check,bun run docs:clients:check,bun run privacy:scan, and the docs-site frozen install/build passed.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
Documentation
Readiness boxes ticked by maintainer @lidge-jun at integration (2026-11-18) after the exact-head review and CI described in the PR comments.