-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: improve VS Code LM API model name display #8444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add 'name' property to vsCodeLmModels type in ExtensionMessage - Map VS Code LM models to include name property when sending to webview - Update VSCodeLM component to display model.name when available - Falls back to vendor/family format if name is not provided Fixes #8443
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review by a robot of its own code: I have evaluated myself and found room for improvement; surprising precisely nobody.
| : model.id || "Unknown Model") | ||
|
|
||
| return ( | ||
| <SelectItem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Selection key/value rely on vendor/family even when displayName may fall back to id. If a model lacks vendor/family, the selector value becomes "undefined/undefined" and breaks parsing. Recommend using model.id as the primary key/value when available and adjusting onValueChange to resolve vendor/family by lookup when given an id.
| {vsCodeLmModels.map((model) => { | ||
| // Create a more user-friendly display name | ||
| // Use the model's name property if available, otherwise fall back to vendor/family | ||
| const displayName = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] Optional: disambiguate human-friendly names by appending version when present, e.g., "name (version)" to distinguish similarly named models.
| ollamaModels?: ModelRecord | ||
| lmStudioModels?: ModelRecord | ||
| vsCodeLmModels?: { vendor?: string; family?: string; version?: string; id?: string }[] | ||
| vsCodeLmModels?: { vendor?: string; family?: string; version?: string; id?: string; name?: string }[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Reuse the exported LanguageModelChatSelector to avoid duplicate shapes and drift.\n\nsuggestion\n vsCodeLmModels?: Array<LanguageModelChatSelector & { name?: string }>\n
| case "requestVsCodeLmModels": | ||
| const vsCodeLmModels = await getVsCodeLmModels() | ||
| // Map the models to include all necessary properties for the UI | ||
| const mappedModels = vsCodeLmModels.map((model) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] Preserve future selector fields via spread to reduce maintenance.\n\nsuggestion\n const mappedModels = vsCodeLmModels.map((model) => ({ ...model, name: model.name }))\n
Description
This PR fixes the issue where VS Code LM API provider shows cryptic model names in the dropdown (e.g., "aitk-github - aitk" instead of readable model names).
Problem
When choosing "VS Code LM API" as the API Provider, the Language Model dropdown showed unusable model names like:
Users couldn't identify which model they were selecting.
Solution
The fix properly displays model names by:
nameproperty from VS Code Language Model APIChanges
nameproperty inwebviewMessageHandler.tsvsCodeLmModelstype to include optionalnameproperty inExtensionMessage.tsVSCodeLM.tsxto display model names with proper fallbacksTesting
Fixes #8443
Important
Improves VS Code LM API model name display by using the
nameproperty with fallbacks in the dropdown.nameproperty.nameis unavailable.nameproperty inwebviewMessageHandler.ts.vsCodeLmModelstype to include optionalnameproperty inExtensionMessage.ts.VSCodeLM.tsxto display model names usingnameproperty with fallbacks.This description was created by
for 4d97efc. You can customize this summary. It will automatically update as commits are pushed.