Repository navigation
fix(web): model picker search finds a model by its ID - #42041
Conversation
Reproduces #42029: searching an OpenCode model by its slug (opencode-go/deepseek-v4.1-flash or deepseek-v4.1-flash) returns nothing because the search fields leave out the slug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model picker scored a query only against the model's name, short name, sub-provider and provider, so searching by ID (as Favorites shows it, e.g. opencode-go/deepseek-v4.1-flash) found nothing when the display name is written differently. Score the slug as one more search field. Fixes #42029 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Searching the model picker by a model's ID (for example
opencode-go/deepseek-v4.1-flash, which is how Favorites shows it) returned "No models found" whenever the model's display name was written differently from its ID. The picker search now matches against the model ID as well as its name and provider.Fixes #42029
Reproduction on main
Commit 110ed77 (origin/main). Started an isolated dev server with T3CODE_DEV_SEED=0
vp run dev(web), paired the browser, then added the OpenCode provider (OpenCode CLI 1.19.6, connected through the hub) via Settings > Providers > Add provider. OpenCode advertisedopencode/deepseek-v4.1-flash-free, shown as "DeepSeek V4.1 Flash Free". Opened the composer model picker and selected the OpenCode provider (the model is listed there), then typed into 'Search models...':opencode/deepseek-v4.1-flash-freegave 0 results ('No models found');deepseek-v4.1-flash-freegave 0 results;DeepSeek V4.1 Flashgave 1 result, 'DeepSeek V4.1 Flash Free'. The scoring function itself also returns null for the reporter's exact queriesopencode-go/deepseek-v4.1-flashanddeepseek-v4.1-flashagainst name 'DeepSeek V4.1 Flash 1017' / subProvider 'OpenCode Go', and a score of 10 for 'DeepSeek V4.1 Flash'. No OpenCode Go account is available here, so a free OpenCode model with the same ID-versus-name mismatch stood in for the reporter's model; the search code does not depend on the sub-provider account.Evidence
Real web app, Chromium, 1280×800, light theme, fresh database per commit, OpenCode CLI 1.19.6. Open the composer model picker, select OpenCode, find DeepSeek by display name, favorite then unfavorite it, and search its full and short IDs. Both ID searches return “No models found” before and find DeepSeek afterward. scenarios:prove exited 0.
Before recording · After recording · Scenario driver
The available free OpenCode DeepSeek model reproduces the ID/display-name mismatch used during triage; the exact OpenCode Go account was unavailable.
Not shown:
Tests
vp test run src/modelSearch.test.ts(packages/client-runtime, without the fix): 1 failed (the repro test), 6 passedvp test run src/modelSearch.test.ts src/composerModelMentions.test.ts(with the fix): 31 passedvp test run src/components/chat/ProviderModelPicker.logic.test.ts(apps/web): 1 passedvp run check:changed: format, lint, knip, typecheck (7 packages), tests and react compiler all passNot in this change
@model mention search (rankComposerModelMentions / matchComposerModelItems) still does not match on the model ID.Who did the work
Run by the t3code factory in T3 Code.