Skip to content

Disambiguate OpenCode model dropdown labels by provider#1024

Open
yusufemreboyraz wants to merge 1 commit into
backnotprop:mainfrom
yusufemreboyraz:fix-opencode-duplicate-model-labels
Open

Disambiguate OpenCode model dropdown labels by provider#1024
yusufemreboyraz wants to merge 1 commit into
backnotprop:mainfrom
yusufemreboyraz:fix-opencode-duplicate-model-labels

Conversation

@yusufemreboyraz

@yusufemreboyraz yusufemreboyraz commented Jul 8, 2026

Copy link
Copy Markdown

Summary

  • fetchModels() in packages/ai/providers/opencode-sdk.ts built each model's dropdown label from model.name ?? model.id alone.
  • OpenCode lets multiple providers expose models with the same name (e.g. deepseek-v4-pro via both DeepSeek and OpenRouter). The id field already disambiguates them (${provider.id}/${model.id}), but the label shown in the dropdown did not, so identical entries appeared side by side with no way to tell them apart.
  • Fix: append the provider's display name to the label, e.g. deepseek-v4-pro (DeepSeek) vs. deepseek-v4-pro (OpenRouter).

Test plan

  • bun x tsc --noEmit -p packages/ai/tsconfig.json — clean.
  • bun test packages/ai/ai.test.ts — 102/102 pass.
  • bun test (full suite) — same pass/fail counts as main (5 pre-existing failures unrelated to this change, caused by missing generated codegen files, reproduced identically on main without this diff).

Fixes #988

fetchModels() built the dropdown label from the model name alone,
so models with identical names from different providers (e.g.
deepseek-v4-pro via DeepSeek vs. via OpenRouter) were indistinguishable
in the UI even though their ids were already unique.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenCode provider: model dropdown shows duplicate labels when multiple providers share model names

1 participant