Skip to content

fix(web): model picker search finds a model by its ID - #42041

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/issue-42029
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/issue-42029

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

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 advertised opencode/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-free gave 0 results ('No models found'); deepseek-v4.1-flash-free gave 0 results; DeepSeek V4.1 Flash gave 1 result, 'DeepSeek V4.1 Flash Free'. The scoring function itself also returns null for the reporter's exact queries opencode-go/deepseek-v4.1-flash and deepseek-v4.1-flash against 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.

Search Before — 110ed776c9 After — d95df4847f
Display name Before: display name finds DeepSeek After: display name finds DeepSeek
Full model ID Before: full ID returns no models After: full ID finds DeepSeek
Short model ID Before: short ID returns no models After: short ID finds DeepSeek

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:

  • The reporter's exact OpenCode Go model was not exercised because no OpenCode Go account is available; the real free OpenCode DeepSeek model used during triage demonstrated the same search defect.
  • Mobile and desktop-shell behavior were not exercised; this proof covers the web composer model picker.

Tests

  • vp test run src/modelSearch.test.ts (packages/client-runtime, without the fix): 1 failed (the repro test), 6 passed
  • vp test run src/modelSearch.test.ts src/composerModelMentions.test.ts (with the fix): 31 passed
  • vp test run src/components/chat/ProviderModelPicker.logic.test.ts (apps/web): 1 passed
  • vp run check:changed: format, lint, knip, typecheck (7 packages), tests and react compiler all pass
  • PR CI: all 8 required checks passed on d95df48

Not in this change

  • The composer @ model mention search (rankComposerModelMentions / matchComposerModelItems) still does not match on the model ID.
  • Grouping OpenCode Go models into their own subgroup, suggested in the report, is a feature request.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 24, 2026 09:11
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>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Model picker search now includes a model’s normalized slug when available. Tests cover finding an OpenCode Go model by its full slug or bare model ID.

Changes: Model slug search

Layer / File(s) Summary
Add slugs to model search
packages/client-runtime/src/modelSearch.ts, apps/web/src/components/chat/ModelPickerContent.tsx, packages/client-runtime/src/modelSearch.test.ts
The searchable model type accepts an optional slug, and search fields include its normalized value when present. Tests check searches by full slug and bare model ID. The model picker’s existing ranking callback continues to supply each model’s slug.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#42039: Targets the same issue with a competing implementation that adds model slugs to picker search.

Suggested labels: bugfix

Suggested reviewers: maria-rcks, macroscopeapp

Merge Risk: Minimal · up to d95df

Model picker search now also matches a model's slug, so models can be found by their public ID. The change is small, tested and easy to revert, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: model picker search now matches a model by its ID. It follows the conventional commit format and fits the changeset, which adds an optional slug to the search fields a…
Linked Issues check Passed Issue #42029 requires that model-picker search match a model's public ID or slug, for example opencode-go/deepseek-v4.1-flash or deepseek-v4.1-flash, even when the display name differs. The review…
Out of Scope Changes check Passed The changes fall into three groups. The modelSearch.ts change adds slug to the search fields and is the core fix for #42029. The modelSearch.test.ts change adds a regression test and a test catalo…
Description check Passed The description covers the problem (model picker search fails when a display name differs from the model ID), the change (adds the model ID as a searchable field), scope (links issue #42029 and explai…
Full details: Title check

Explanation

The title names the main change: model picker search now matches a model by its ID. It follows the conventional commit format and fits the changeset, which adds an optional slug to the search fields and a test for slug and bare-ID searches.

Full details: Linked Issues check

Explanation

Issue #42029 requires that model-picker search match a model's public ID or slug, for example opencode-go/deepseek-v4.1-flash or deepseek-v4.1-flash, even when the display name differs. The reviewed head adds an optional slug?: string to ModelPickerSearchableModel in packages/client-runtime/src/modelSearch.ts. getModelPickerSearchFields now appends normalizeSearchQuery(model.slug) when a slug is present. The existing scoring and ranking logic is unchanged. The PR adds a ranking test in modelSearch.test.ts that checks the full slug and the bare model ID both return the OpenCode Go model. The PR also adds that model to the test catalog. The issue's suggested subgrouping of OpenCode Go models is a feature suggestion, not a stated requirement. The PR excludes it, and the issue's related references (#29099, #31977) are distinct topics. The issue's ID-search requirement is therefore covered. Caveat: ModelPickerContent.tsx could not be read as a diff. The raw summary states the ranking callback already supplies slug. Test results are taken from the PR description and were not re-run.

Full details: Out of Scope Changes check

Explanation

The changes fall into three groups. The modelSearch.ts change adds slug to the search fields and is the core fix for #42029. The modelSearch.test.ts change adds a regression test and a test catalog entry for the same behavior. The ModelPickerContent.tsx change is reported as a no-behavior-change, with a +1/-0 line delta. None of these changes implements the excluded items named in the PR: composer @ mention search and OpenCode Go subgrouping. No unrelated change was identified. The ModelPickerContent.tsx diff could not be read directly, so its exact content rests on the raw summary.

Full details: Description check

Explanation

The description covers the problem (model picker search fails when a display name differs from the model ID), the change (adds the model ID as a searchable field), scope (links issue #42029 and explains the bug is reported), and verification (specific test commands, before/after evidence, and CI status). It also states what was not checked: the exact OpenCode Go account and mobile/desktop shell behavior. It includes the required agent attribution at the end. The Problem, Change, Scope, and Verification sections are all present and substantive, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 110ed77 and d95df48.

Files selected for processing: 3

  • apps/web/src/components/chat/ModelPickerContent.tsx
  • packages/client-runtime/src/modelSearch.test.ts
  • packages/client-runtime/src/modelSearch.ts

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

@juliusmarminge
juliusmarminge merged commit 2ced06e into main Nov 24, 2026
41 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-42029 branch November 24, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Model picker cannot find OpenCode Go models by ID after unfavoriting

1 participant