Skip to content

fix(server): label OpenCode 2 models with their provider in the model picker - #14971

Closed
MaxAnderson95 wants to merge 1 commit into
pingdotgg:mainfrom
MaxAnderson95:fix/opencode2-model-subprovider
Closed

MaxAnderson95 wants to merge 1 commit into
pingdotgg:mainfrom
MaxAnderson95:fix/opencode2-model-subprovider

Conversation

@MaxAnderson95

@MaxAnderson95 MaxAnderson95 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With OpenCode 2, every model in the picker is labeled only OpenCode. A model served by several connected providers shows up as identical rows: on my machine, Claude Opus 5.5 appears three times with nothing to tell the rows apart. OpenCode 1.x labeled each row OpenCode · <provider>.

Model picker before the fix: every OpenCode 2 row labeled only OpenCode

Closes #14962

Change

The OpenCode 2 status check built models without subProvider, and OpenCode 2's model.list carries only a providerID. The driver now reads provider.list alongside model.list and attaches each model's provider name, and checkOpenCode2 sets subProvider from that name, falling back to providerID when a provider has none. A failed provider.list also falls back to provider ids instead of failing the model list. The picker already renders subProvider on web and mobile, so no client change is needed.

Scope and approval

Triaged in #14962: #14962 (comment). The triage comment proposes this fix: join provider.list's name onto each model as subProvider, fall back to providerID, and add a test with one model name shared across two provider ids.

Verification

  • Added an OpenCode 2 case to OpenCodeProvider.test.ts with two Claude Opus 5.5 models from different providers, one with a provider name and one without. It asserts distinct slugs labeled Anthropic and github-copilot. It fails without the fix and passes with it: vp test run apps/server/src/provider/Layers/OpenCodeProvider.test.ts apps/server/src/provider/Drivers/OpenCodeDriver.test.ts (2 files, 33 tests).
  • vp lint and vp fmt on the changed files, and tsc --noEmit for apps/server, report nothing in the changed files.
  • Against a live OpenCode 2.0.22 server, /api/model lists Claude Opus 5.5 under anthropic, openrouter, github-copilot, and opencode, and /api/provider names all four providers.
  • Built this branch and opened the web picker against the same OpenCode 2 setup as the screenshot above. Each Claude Opus 5.5 row now names its provider:

Model picker after the fix: OpenCode 2 rows labeled OpenCode · Anthropic, OpenCode · GitHub Copilot, and OpenCode · OpenCode Zen

  • Paired the iOS app with the same build. Its thread settings model list shows each provider name as the row subtitle, with no mobile change:

iOS thread settings after the fix: Claude Opus rows subtitled Anthropic, GitHub Copilot, and OpenCode Zen

Model: Claude Opus 5.5. Harness: OpenCode.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 3, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 3, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 6583063

Macroscope's review found this PR approvable — This is a narrowly scoped OpenCode 2 model-picker fix that enriches existing models with provider labels while preserving provider-ID fallbacks and existing model-list error handling. The changes affect display metadata only and introduce no new workflow, schema, deployment, or static-analysis configuration behavior.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

No code changes detected at 165ddc4. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f5bba8c-a792-47cd-8679-697566bb8019
📥 Commits

Reviewing files that changed from the base of the PR and between 8ed276c and 6583063.

📒 Files selected for processing (3)
  • apps/server/src/provider/Drivers/OpenCodeDriver.ts
  • apps/server/src/provider/Layers/OpenCodeProvider.test.ts
  • apps/server/src/provider/Layers/OpenCodeProvider.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

OpenCode 2 model loading now fetches provider metadata with models and attaches matching provider names. Model picker entries use the provider name as the sub-provider label, or the provider ID when the name is missing or blank.

Changes

OpenCode 2 provider labels

Layer / File(s) Summary
Load and apply provider labels
apps/server/src/provider/Drivers/OpenCodeDriver.ts, apps/server/src/provider/Layers/OpenCodeProvider.ts, apps/server/src/provider/Layers/OpenCodeProvider.test.ts
The driver fetches models and provider metadata concurrently. The model type can carry a provider name. Model entries use the trimmed name as subProvider, falling back to the provider ID. The test checks both label choices.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to 65830

This change labels OpenCode 2 models in the model picker with their provider name, falling back to the provider ID. Failures when loading provider names do not block the model list. No merge-blocking risk was identified.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 65830

Provider names affect display labels, not which model runs, connection destinations, or permissions. A slow label lookup can temporarily delay available choices, but the reviewed change introduces no material security risk.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The added lookup inherits the existing configured external or locally owned OpenCode server connection, authentication, and workspace location. It does not select an additional destination or introduce a separate credential scope.

Trust Boundaries and Controls

  • observed — Server-supplied provider names are mapped to display metadata rather than trusted as routing or authentication inputs. The traced execution consumers continue constructing model references from provider-ID/model-ID slugs, and provider status remains based on model-loading results rather than provider names.

Resilience and Maintainability Implications

  • observed — The loader retains a per-instance last-nonempty snapshot. Only a completed nonempty load replaces it; timeout or interruption does not publish partially enriched data. Concurrent successful loads retain the existing completion-order cache policy, which can change labels between display names and provider-ID fallbacks without changing model identity.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #14962 requires OpenCode 2 model rows to identify their provider. The driver joins provider names to models, and the layer sets subProvider from that name or falls back to providerID. The ad…
Out of Scope Changes check ✅ Passed The changes are limited to OpenCode 2 provider metadata, label construction, and a focused regression test. These changes directly support issue #14962. No unrelated changes are reported.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Title check ✅ Passed The title clearly and concisely describes the main change: labeling OpenCode 2 models with their provider in the model picker.
Description check ✅ Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the issue and fix, links the triaged issue, and reports focused tests and additional c…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 3, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 3, 2026 02:47

Dismissing prior approval to re-evaluate 6583063

… picker

OpenCode 2's model list carries only a provider id, so every OpenCode 2 model showed as plain "OpenCode" and models served by several providers looked identical. Read provider.list alongside model.list and set subProvider from the provider's name, falling back to the provider id.
@y-u-s-u-f

Copy link
Copy Markdown

Making T3 Unusable for me right now, please merge ASAP!

@juliusmarminge

Copy link
Copy Markdown
Member

Note

Grok responding on behalf of Julius.

Thanks for working on this! #17424 just landed on main (7b09ac7) and fixes #14962 the same way: it reads OpenCode 2's provider list alongside the model list and sets each model's subProvider, so the picker can tell same-named models apart. Closing this one as superseded. If there's a piece this PR covers that #17424 doesn't, please open a small follow-up against current main scoped to just that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OpenCode 2 models show only "OpenCode" in the model picker, with no sub-provider

3 participants