From d4fa2db1c5dfd961776c77a619767e9ef17abce9 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 22 Jun 2026 06:11:59 -0700 Subject: [PATCH] fix(desktop): show all of a provider's models when searching the composer picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The composer model picker capped each provider's search matches at 12 (PER_PROVIDER_SEARCH). A provider serving more than 12 models (e.g. opencode-go with 19) showed only a truncated subset when the user typed its name to find it — exactly the models they were searching for got cut. Edit Models showed the full list because it never applied this cap. A search is already a narrowing action, so capping a single provider's own matches is wrong. Remove the slice; search now lists every matching model for the provider. The no-search default still shows the curated top-N per provider via the visibility set. Follow-up to #47077 (the backend dedup fix); this closes the remaining frontend truncation users saw in the composer. --- apps/desktop/src/app/shell/model-menu-panel.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/desktop/src/app/shell/model-menu-panel.tsx b/apps/desktop/src/app/shell/model-menu-panel.tsx index 6f785e8fabf..1444bd51af6 100644 --- a/apps/desktop/src/app/shell/model-menu-panel.tsx +++ b/apps/desktop/src/app/shell/model-menu-panel.tsx @@ -326,8 +326,10 @@ export function ModelMenuPanel({ gateway, onSelectModel, requestGateway }: Model } // Collapsed we show the user's chosen models (or the curated default); typing -// spans every available model so anything is reachable past the cut. -const PER_PROVIDER_SEARCH = 12 +// spans every available model so anything is reachable past the cut. A search +// is itself a narrowing action, so we do NOT cap per-provider matches — a +// provider serving 19 models (e.g. opencode-go) must show all 19 when the user +// searches for it, not a truncated subset. (#47077 follow-up) function groupModels( providers: ModelOptionProvider[], @@ -374,11 +376,7 @@ function groupModels( ? allFamilies.find(family => family.id === current.model || family.fastId === current.model)?.id : undefined - let families = allFamilies.filter(family => shown.has(family.id) || family.id === activeId) - - if (q) { - families = families.slice(0, PER_PROVIDER_SEARCH) - } + const families = allFamilies.filter(family => shown.has(family.id) || family.id === activeId) if (families.length > 0) { groups.push({ families, provider })