Skip to content

fix(opencode): distinguish configured model providers - #15327

Closed
fyzanshaik wants to merge 4 commits into
pingdotgg:mainfrom
fyzanshaik:fix/opencode-provider-labels
Closed

fyzanshaik wants to merge 4 commits into
pingdotgg:mainfrom
fyzanshaik:fix/opencode-provider-labels

Conversation

@fyzanshaik

Copy link
Copy Markdown

Problem

OpenCode can serve the same model through several configured providers, but T3 Code's OpenCode 2 catalog omitted provider names. Official DeepSeek and OpenCode Go appeared as indistinguishable rows, and selected model labels did not retain the upstream identity.

Change

Read OpenCode 2 provider names alongside the model catalog and preserve custom names. If names are unavailable, keep the catalog usable and derive a visible label from the provider-qualified model ID. Show that identity in web/desktop and mobile model rows and selected values, including scheduled-task Settings. Search both the displayed provider label and its raw ID.

Full model IDs, selection routing, and favorite keys remain unchanged. The known-name map only formats labels; it does not filter configured providers. Unrelated runtimes keep their existing selected-label presentation.

Scope and approval

Fixes #14962. The failure and provider-name lookup direction were established in the maintainer triage.

This overlaps the server catalog fix in #14971. This PR also covers selected-label visibility, provider-name search when metadata is missing, and mobile scheduled-task selection. These changes all address the same loss of upstream identity; no new provider settings or workflows are introduced.

Verification

  • 130 focused OpenCode server tests passed across 11 files, including custom provider names, nested model IDs, distinct provider-qualified slugs, partial/failed provider-name lookups, and fake-HTTP driver wiring.
  • Shared model tests: 35 passed. Mobile model option tests: 20 passed. Web search and picker-content tests: 30 passed. Existing model picker tests: 14 passed.
  • Scoped shared, web, mobile, and server typechecks passed. Targeted lint, server formatting checks, and git diff --check passed. No repo-wide checks were required.
  • In the running web app against the owner's OpenCode 2 catalog, selected official DeepSeek, switched to OpenCode Go, and switched back. Each selection checked its own row and displayed its provider on the closed picker. Searching litellm found the custom catalog, and zen found OpenCode Zen models.
  • Native mobile was not tested on-device. No provider turn was sent to test paid inference. Most checks used local Node 24.11.0, below the repository's declared 24.13.1 minimum; the final web search checks also passed under Node 22.23.1. CI remains the supported-toolchain check.

Before / After

Before: official DeepSeek and OpenCode Go appeared as indistinguishable rows.

OpenCode picker before - providers indistinguishable

After: each row carries its configured provider identity, and the closed picker/search retain it.

OpenCode picker after - provider labels shown

Implementation: DeepSeek Flash (official deepseek/deepseek-flash), OpenCode Build harness. Coordination and browser verification: GPT-6.1-Sol, Codex harness. Review: GPT-6-Astra, Codex harness.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 3, 2026
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: ce3268a2-ba8a-43ee-aefc-fee23c35c27e
📥 Commits

Reviewing files that changed from the base of the PR and between 4e45f02 and 62073fa.

📒 Files selected for processing (5)
  • apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
  • apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
  • apps/mobile/src/features/threads/ThreadComposer.tsx
  • apps/web/src/components/Sidebar.tsx
  • apps/web/src/components/chat/ModelPickerContent.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx

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

The change adds shared resolution for upstream provider IDs and labels. OpenCode model snapshots can include configured provider names. Web and mobile model controls display resolved provider labels, and web picker search includes OpenCode provider IDs.

Changes

OpenCode model provider labels

Layer / File(s) Summary
Resolve upstream provider labels
packages/shared/src/model.ts, packages/shared/src/model.test.ts
Shared helpers extract provider IDs from slugs and resolve labels from catalog names or, for OpenCode, the slug.
Keep CLI provider IDs distinct from display names
apps/server/src/provider/opencodeRuntime.ts, apps/server/src/provider/opencodeRuntime.cliParsers.test.ts, apps/server/src/provider/opencodeRuntime.inventory.test.ts
CLI parsing no longer assigns provider IDs as display names. Inventory entries use an empty name when the CLI does not provide one.
Add configured names to OpenCode model snapshots
apps/server/src/provider/Drivers/OpenCodeDriver.ts, apps/server/src/provider/Drivers/OpenCodeDriver.test.ts, apps/server/src/provider/Layers/OpenCodeProvider.ts, apps/server/src/provider/Layers/OpenCodeProvider.test.ts
The driver loads provider names. Status checks add matching names to model entries and continue without labels when the lookup fails or times out.
Display and search upstream providers in the web picker
apps/web/src/components/chat/modelPickerSearch.ts, apps/web/src/components/chat/modelPickerSearch.test.ts, apps/web/src/components/chat/providerIconUtils.ts, apps/web/src/components/chat/ModelListRow.tsx, apps/web/src/components/chat/ModelPickerContent.tsx, apps/web/src/components/chat/ProviderModelPicker.tsx, apps/web/src/components/Sidebar.tsx
Web model labels use resolved provider names. Picker search includes OpenCode provider IDs, and label formatting receives the provider driver kind.
Use resolved labels in mobile model controls
apps/mobile/src/lib/modelOptions.ts, apps/mobile/src/lib/modelOptions.test.ts, apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx, apps/mobile/src/features/threads/NewTaskDraftScreen.tsx, apps/mobile/src/features/threads/ThreadComposer.tsx
Mobile model options resolve provider subtitles for catalog and fallback selections. Selected-model controls display formatted labels.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 62073

OpenCode models gain clearer provider labels and provider-ID search, while lookup failures leave models available without the added label. No material merge risk is established; proceed with normal CI validation.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 62073

The inspected changes preserve selection identity and do not add privileges. No concrete security issue was identified, but incomplete coverage leaves limited residual uncertainty.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A party controlling configured provider names can influence visible labels and search ranking for models exposed by that provider instance. In the inspected changed paths, these values do not determine connection destinations, credential selection, or the instanceId/model selection payload.

Trust Boundaries and Controls

  • observed — The inspected entrypoint edits preserve control behavior. Mobile composer changes supply a different label to the same settings action; scheduled-task lookup still matches both instanceId and model; web picker activation retains its existing disabled-state, available-option, and driver-specific selection checks.

Resilience and Maintainability Implications

  • inferred — Failure of the additional metadata read is contained to label enrichment in the inspected status path. Fallback formatting leaves provider-qualified model identity intact rather than substituting a display name into routing.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: distinguishing configured providers for OpenCode models.
Description check ✅ Passed The description covers the problem, change, scope and approval, and focused verification. It also includes before-and-after screenshots and identifies the agents and harnesses used.
Linked Issues check ✅ Passed [#14962] The OpenCode 2 catalog change attaches configured provider names to models. ModelListRow appends the resolved upstream label to the configured provider name. The shared resolver preserves `…
Out of Scope Changes check ✅ Passed The server lookup, fallback labels, picker search, web and mobile selected labels, and scheduled-task model selection all preserve the upstream identity requested by [#14962]. The OpenCode CLI parser …
  • Fix all pre-merge checks with AI
✨ 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 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 62073fa

Macroscope's review found this PR approvable — This is a focused OpenCode model-identity correction: it adds provider labels and searchability while preserving model IDs, routing, stored selections, and non-OpenCode behavior. The additional provider lookup is bounded by timeout and failure fallback, with extensive focused test coverage.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

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

@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:L 100-499 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

2 participants