feat(vscode): improve model selector — Recommended group, standard styles, free badge, auto-scroll#7137
feat(vscode): improve model selector — Recommended group, standard styles, free badge, auto-scroll#7137
Conversation
Models with a recommendedIndex are grouped into a dedicated 'Recommended' section at the top of the model picker, sorted by index. Adds model.group.recommended i18n key for all 16 supported languages.
…ng with kilo-ui design system
…e-prefix models together
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments: None. Files Reviewed (8 files)
|
|
Looks pretty good to me!
Hrm, do folks sometimes search on these? I think I've probably searched by company/provider before than model name to get the list. For example I think I once searched for |
What changed is that we know filter on what people actually see on the list. Provider name + model name exists so this filter will work. They only thing that won't work if you search by model ID. The reason for that is if you search |
OK, I read that as we removed provide name matching but as long as we keep that I'm good with this 👍 |
| export function isFree(model: Pick<EnrichedModel, "isFree" | "cost">): boolean { | ||
| if (model.isFree !== undefined) return model.isFree | ||
| // TODO: fallback to cost check — delete once backend ships isFree attribute | ||
| return model.cost?.input === 0 && model.cost?.output === 0 |
There was a problem hiding this comment.
WARNING: Zero-cost fallback will mislabel unknown-price models as free
The provider payload normalizes missing pricing to cost: { input: 0, output: 0 }, so this check now returns true for any custom or BYOK model that simply does not publish cost metadata. The TUI/app still gate the free badge to Kilo/opencode models, so this change starts showing Free on models whose price is actually unknown rather than free.
There was a problem hiding this comment.
solved with a temporary fallback
packages/kilo-vscode/webview-ui/src/components/shared/model-selector-utils.ts
Outdated
Show resolved
Hide resolved
packages/kilo-vscode/webview-ui/src/components/shared/model-selector-utils.ts
Outdated
Show resolved
Hide resolved
Pull request was converted to draft
Add isFree field to the full model data pipeline: gateway schema, ModelsDev.Model, Provider.Model, OpenAPI spec, and SDK types. Remove cost-based isFree fallback in the extension model selector — rely solely on the backend-provided value.


Context
fixes #7123
Improves the model selector in the VS Code extension webview across several dimensions: surfaces recommended models, adopts design-system tokens throughout, upgrades the free badge to a proper
kilo-uicomponent, and auto-scrolls to the active model when the picker opens.Implementation
Recommended group
recommendedIndexare collected and sorted by that index, then rendered as the first group before the per-provider groups.model.group.recommendedi18n key to all locale files.Standard styles (kilo-ui design system)
model-selector-group-labelnow uses CSS variable tokens (--font-size-x-small,--font-weight-medium,--line-height-large,--letter-spacing-normal) instead of hard-coded values, matching the kilo-ui design system..model-selector-item.activenow applies--surface-interactive-activebackground and--text-on-interactive-baseforeground (with VSCode fallbacks) so the selected row is visually distinct. Bold weight is moved to the inner name span only.--border-weak-base/--vscode-panel-borderfallback..model-selector-tagCSS block is removed entirely — replaced by the<Tag>component fromkilo-ui(see below).Free badge via
kilo-uiTagisFreelogic is updated to prefer the explicitmodel.isFreeboolean attribute from the backend, with a fallback tocost.input === 0 && cost.output === 0for the transition period (TODO comment marks it for cleanup once backend ships the attribute).<span class="model-selector-tag">is replaced with<Tag data-variant="member">from@kilocode/kilo-ui/tag, which carries the correct design-system styling.Auto-scroll to selected model
scrollIntoView({ block: "center" })is called on the.model-selector-item.activeelement, so the currently active model is visible without manual scrolling.Search scope
model.nameonly (previously also matchedproviderNameandid), reducing noise in search results.Alphabetical sorting within groups
Screenshots
Before
After
How to Test
Get in Touch