Draft
Conversation
Contributor
Screenshot ChangesBase: Changed (13) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a relative “cost tier” signal for chat language models and surfaces it in the chat model picker UI. It adds a priceTier field to model metadata, propagates it from Copilot’s endpoint metadata through the extension host, and renders a tier indicator (circles) alongside model details; it also extends the generic ActionList filter row to support a right-aligned label (“Cost”).
Changes:
- Add
priceTier?: stringto the proposed language model pricing API and internal chat model metadata. - Plumb
priceTierfrom Copilot model metadata (model_picker_price_category) into model info surfaced to the workbench and render a visual tier indicator in the model picker. - Add
filterLabelsupport to the ActionList filter row and styling to display the label; adjust model picker “Other Models” header to show a gear action in-row.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.languageModelPricing.d.ts | Extends proposed API with priceTier on LanguageModelChatInformation. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Adds priceTier to internal model metadata type used by the chat UI. |
| src/vs/workbench/contrib/chat/browser/widget/media/chat.css | Forces the “Other Models” section toggle row toolbar to be visible. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts | Renders price-tier icons in model descriptions; refactors manage-models affordance and filter header behavior. |
| src/vs/workbench/api/common/extHostLanguageModels.ts | Plumbs priceTier from extension-provided model info into workbench metadata. |
| src/vs/platform/actionWidget/browser/actionWidget.css | Styles a new optional filter-row label element. |
| src/vs/platform/actionWidget/browser/actionList.ts | Adds filterLabel?: string option and renders it when the filter row is shown. |
| extensions/copilot/src/platform/networking/common/networking.ts | Extends IChatEndpoint with priceTier. |
| extensions/copilot/src/platform/endpoint/node/chatEndpoint.ts | Maps service metadata model_picker_price_category to priceTier. |
| extensions/copilot/src/platform/endpoint/common/endpointProvider.ts | Extends model API response typing with model_picker_price_category. |
| extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts | Includes priceTier in model info contributed to VS Code. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.ts | Includes priceTier in Claude model info surfaced to the picker. |
Copilot's findings
Comments suppressed due to low confidence (3)
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts:186
- The description is rendered as a
MarkdownStringcontaining only codicon markup (e.g.$(circle-filled)), which will also be used verbatim for screen reader text via the ActionList accessibility provider. Consider appending a localized textual tier label (e.g. "Low cost") alongside the icons (or otherwise ensuring an accessible text alternative) so the description is meaningful to assistive tech users.
let descriptionOverride: MarkdownString | undefined;
if (priceTierIndicator) {
const md = new MarkdownString('', { isTrusted: false, supportThemeIcons: true });
if (textDescription) {
md.appendText(textDescription + ' · ');
}
md.appendMarkdown(priceTierIndicator);
descriptionOverride = md;
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts:447
manageModelsActionis no longer added as an ActionList item when the Other Models section exists; it's moved into the section toggle'stoolbarActions. This changes behavior relied on by existingchatModelPickertests (they currently assert a standalone "Manage Models..." entry and an extra separator). Either update the tests accordingly, or keep the Manage Models action as a regular list item to preserve the prior UI/keyboard navigation behavior.
const otherModelsToolbar = manageModelsAction
? [toAction({ id: manageModelsAction.id, label: manageModelsAction.tooltip ?? manageModelsAction.label, class: ThemeIcon.asClassName(Codicon.gear), run: () => manageModelsAction.run() })]
: undefined;
items.push({
item: {
id: 'otherModels',
enabled: true,
checked: false,
class: undefined,
tooltip: localize('chat.modelPicker.otherModels', "Other Models"),
label: localize('chat.modelPicker.otherModels', "Other Models"),
run: () => { /* toggle handled by isSectionToggle */ }
},
kind: ActionListItemKind.Action,
label: localize('chat.modelPicker.otherModels', "Other Models"),
group: { title: '', icon: Codicon.chevronDown },
hideIcon: false,
section: ModelPickerSection.Other,
isSectionToggle: true,
toolbarActions: otherModelsToolbar,
className: 'chat-model-picker-section-toggle',
});
for (const model of otherModels) {
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts:446
- The Manage Models gear is attached as
toolbarActionson the "Other Models" section toggle.ActionListWidgetonly provides explicit keyboard affordances (Right Arrow + aria hint) forsubmenuActions, nottoolbarActions, so this risks making the gear effectively mouse-only and undiscoverable to screen reader users. Consider exposing this action viasubmenuActions(or wiring ArrowRight/aria hint support fortoolbarActions), or keep "Manage Models..." as a regular list item so it remains keyboard accessible.
const otherModelsToolbar = manageModelsAction
? [toAction({ id: manageModelsAction.id, label: manageModelsAction.tooltip ?? manageModelsAction.label, class: ThemeIcon.asClassName(Codicon.gear), run: () => manageModelsAction.run() })]
: undefined;
items.push({
item: {
id: 'otherModels',
enabled: true,
checked: false,
class: undefined,
tooltip: localize('chat.modelPicker.otherModels', "Other Models"),
label: localize('chat.modelPicker.otherModels', "Other Models"),
run: () => { /* toggle handled by isSectionToggle */ }
},
kind: ActionListItemKind.Action,
label: localize('chat.modelPicker.otherModels', "Other Models"),
group: { title: '', icon: Codicon.chevronDown },
hideIcon: false,
section: ModelPickerSection.Other,
isSectionToggle: true,
toolbarActions: otherModelsToolbar,
className: 'chat-model-picker-section-toggle',
});
- Files reviewed: 11/12 changed files
- Comments generated: 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #314542