microsoft / microsoft/vscode

Extensions can add language model provider groups but not remove them

Open
#328,577 0 comments 0 reactions 1 assignee Claimed by @vritant24 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Extensions that provide language models through the Language Model Chat Provider API can create provider groups programmatically with the `lm.addLanguageModelsProviderGroup` command (and `lm.migrateLanguageModelsProviderGroup`, which also ends in an add). There is no counterpart for removal, so the programmatic surface is add-only.

This matters for vendor extensions that sync declarative configuration into provider groups. Our extension (litellm-vscode-chat) mirrors a `servers` user setting into groups: each configured server becomes a group. When the user removes or renames a server in settings, we can add the group for the new name but the old group stays behind permanently. The user sees it in Manage Language Models until they delete it by hand or edit chatLanguageModels.json themselves. Our current workaround is to keep answering discovery for orphaned groups with an empty model list, which works but leaves confusing empty shells in the UI.

Everything below the command layer already exists. `ILanguageModelsService.removeLanguageModelsProviderGroup(vendorId, name)` is what the Manage Language Models editor's Delete action calls today, and it also cleans up the group's stored secrets. The request is a registered command in front of it, symmetrical with add:

```ts
await vscode.commands.executeCommand('lm.removeLanguageModelsProviderGroup', { name, vendor });
```

On scoping: the command layer receives no caller identity, and neither the add command nor the native editor's Delete path restricts who can remove a group, so an unscoped command matches the existing trust model (the backing store is user-editable JSON in the profile in any case). A non-interactive update command would round out the surface for the same sync scenario, but removal is the gap that leaves permanent residue.

I have a working prototype (one small addition to chatLanguageModelActions.ts) and would be happy to submit it as a PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.