You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model picker search should match pasted model slugs
#13898
Pasting a model id into the model picker search finds nothing, even when the model is right there in the list. Concrete repro: an OpenCode instance with an OpenRouter key has openrouter/stealth/space-bunny-alpha in its catalog. Searching bunny finds it (display name "Space Bunny Alpha"). Pasting stealth/space-bunny-alpha finds nothing.
Why: getModelPickerSearchFields (apps/web/src/components/chat/modelPickerSearch.ts) indexes display name, short name, sub-provider, driver kind, and instance display name, but never the model slug. The scorer is tokenized and every token must match a field; fuzzy is a subsequence match, so a pasted slug dies on its / and - characters, which exist only in the slug and in no indexed field.
Proposal: index the model slug as one more search field, so pasting an id like stealth/space-bunny-alpha or openrouter/stealth/space-bunny-alpha surfaces the model. The picker row data already carries the slug. T3 slugs carry the driver provider prefix (the model above is openrouter/stealth/space-bunny-alpha on an OpenCode instance), but the prefix does not block a match: the includes tier of scoreQueryMatch (packages/shared/src/searchRanking.ts) treats the prefixless paste as a substring, and / is already a boundary marker there.
Looks like a small change to the search fields plus tests, no UX change otherwise. Happy to send a PR if maintainers want it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Pasting a model id into the model picker search finds nothing, even when the model is right there in the list. Concrete repro: an OpenCode instance with an OpenRouter key has
openrouter/stealth/space-bunny-alphain its catalog. Searchingbunnyfinds it (display name "Space Bunny Alpha"). Pastingstealth/space-bunny-alphafinds nothing.Why:
getModelPickerSearchFields(apps/web/src/components/chat/modelPickerSearch.ts) indexes display name, short name, sub-provider, driver kind, and instance display name, but never the model slug. The scorer is tokenized and every token must match a field; fuzzy is a subsequence match, so a pasted slug dies on its/and-characters, which exist only in the slug and in no indexed field.Proposal: index the model slug as one more search field, so pasting an id like
stealth/space-bunny-alphaoropenrouter/stealth/space-bunny-alphasurfaces the model. The picker row data already carries the slug. T3 slugs carry the driver provider prefix (the model above isopenrouter/stealth/space-bunny-alphaon an OpenCode instance), but the prefix does not block a match: the includes tier ofscoreQueryMatch(packages/shared/src/searchRanking.ts) treats the prefixless paste as a substring, and/is already a boundary marker there.Looks like a small change to the search fields plus tests, no UX change otherwise. Happy to send a PR if maintainers want it.
All reactions