Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Oct 1, 2025

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:

  • aitk-github - aitk
  • aitk-foundry - aitk

Users couldn't identify which model they were selecting.

Solution

The fix properly displays model names by:

  1. Adding support for the name property from VS Code Language Model API
  2. Mapping VS Code LM models to include the name property when sending to the webview
  3. Updating the VSCodeLM component to display model.name when available
  4. Providing intelligent fallbacks (vendor/family format or model ID) when name is not available

Changes

  • Backend: Map VS Code LM models to include name property in webviewMessageHandler.ts
  • Type Definition: Extend vsCodeLmModels type to include optional name property in ExtensionMessage.ts
  • Frontend: Update VSCodeLM.tsx to display model names with proper fallbacks

Testing

  • ✅ All existing tests pass
  • ✅ Linting passes
  • ✅ Type checking passes
  • ✅ Implementation review shows 95% confidence

Fixes #8443


Important

Improves VS Code LM API model name display by using the name property with fallbacks in the dropdown.

  • Behavior:
    • Improves model name display in VS Code LM API provider dropdown by using name property.
    • Provides fallbacks to vendor/family format or model ID if name is unavailable.
  • Backend:
    • Maps VS Code LM models to include name property in webviewMessageHandler.ts.
  • Type Definition:
    • Extends vsCodeLmModels type to include optional name property in ExtensionMessage.ts.
  • Frontend:
    • Updates VSCodeLM.tsx to display model names using name property with fallbacks.

This description was created by Ellipsis for 4d97efc. You can customize this summary. It will automatically update as commits are pushed.

- 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
@roomote roomote bot requested review from cte, jr and mrubens as code owners October 1, 2025 17:12
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 1, 2025
@dosubot dosubot bot added the bug Something isn't working label Oct 1, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 1, 2025
Copy link
Contributor Author

@roomote roomote bot left a 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
Copy link
Contributor Author

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 =
Copy link
Contributor Author

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 }[]
Copy link
Contributor Author

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) => ({
Copy link
Contributor Author

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

@daniel-lxs
Copy link
Member

#8443 (comment)

@daniel-lxs daniel-lxs closed this Oct 27, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 27, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] VS Code LM API provider not working

4 participants