microsoft / microsoft/vscode

Newly added `configurationSchema` property does not appear in the model-settings dropdown until a config write (chat session snapshot stale; hover shows it)

Open
#333,413 0 comments 0 reactions 1 assignee Claimed by @lramos15 View on GitHub
bug model-byok model-picker
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

**Labels:** `chat` `model-picker` `bug` `third-party-provider`

---

**Does this issue occur when all extensions are disabled?:** No (requires a third-party `LanguageModelChatProvider`, extension API `chatProvider`).

**VS Code Version:** 1.135.0 (commit 08d4889f9ec4a1685d257b9b95de036c8e1ce1e5)
**OS:** Windows 11 x64

## Steps to Reproduce

1. An extension registers a `LanguageModelChatProvider` (BYOK, `isBYOK: true`) whose model metadata declares:

```json
"configurationSchema": {
"properties": {
"reasoningEffort": { "type": "string", "enum": ["A", "B", "C"], "enumItemLabels": ["A", "B", "C"], "default": "A", "group": "navigation", "title": "Model Mode" }
}
}
```

2. Use the model in a chat session (Agent mode, "Local / Default permissions"). The settings button next to the model name shows the mode dropdown — correct.
3. Update the extension so the same model additionally declares a second property:

```json
"maxOutputTokens": { "type": "number", "enum": [32768, 16384, 8192], "enumItemLabels": ["32K", "16K", "8K"], "default": 32768, "group": "tokens", "title": "Output Length" }
```

4. Fully quit and relaunch VS Code (provider re-registers; the new schema is confirmed present — see evidence below).
5. Open the settings dropdown (the `[Think (Deep) ⥮]` button in the chat input) → **only the "Model Mode" section renders**. The "Output length" section is missing.
6. Open the chat model picker list and hover the model → the hover card shows **both** "Configurable" chips: `Model Mode` **and** `Output length` (rendered from the same `model.metadata.configurationSchema` in `modelPickerHover.ts`, gated only by `SUPPORTED_CONFIG_GROUPS = ['navigation','tokens']` + `seenGroups`).
7. Click the `Output length` chip in the hover → the section menu opens correctly (32K/16K/8K). Select a value → `setModelConfiguration` writes.
8. Open the settings dropdown from step 5 again → the "Output length" section now renders there too. From then on, everything works.

## Expected

The settings dropdown (`ModelPickerConfiguration._buildItems` → `appendConfigSection('tokens')` → `_getConfigProperty('tokens')`) renders the new section as soon as the provider's re-registered metadata contains the property — no user write should be required to make a schema-declared section appear.

## Actual

The chat input's view of the model's configuration schema is stale per session/scope. `_getConfigProperty('tokens')` finds no matching property (so no section, and the button label omits the tokens value), while the model-picker hover — reading the live `ILanguageModelsService` metadata — shows it. Only an explicit config write through the live path (hover chip, or Models editor "Configure...") heals the input widget's snapshot.

Suspects (from `release/1.135` / the 08d4889 tree):
- `ChatModelConfigurationStore` — per-editor `_overrides` snapshot seeded before the provider re-registers; the documented "heal" on `onDidChangeLanguageModels` merges `{...schemaDefaults, ...override}` into non-empty snapshots, but the *schema itself* used for section discovery in `modelPickerConfiguration.ts` (`model.metadata.configurationSchema` of `getSelectedModel()`) still appears to be the pre-update copy in the selected-model resolution path.
- Possibly session-restored model state (`restoreModelConfiguration`) pinning the old schema shape.

## Evidence

- Same model, same moment: hover card (model list) shows two `Configurable` chips; input settings button shows one section. Both read `configurationSchema` — the divergence is purely where `getSelectedModel()`'s metadata comes from.
- The model appears exactly once in the picker (not an agent-host duplicate issue).
- Provider verified to emit the full two-property schema (unit tests + Models editor "Configure..." panel shows both properties; `languageModelsConfigurationService` settings UI confirms).

## Workaround used by the extension

Docs instruct users to open the model list once and click the new chip — that write heals the widget. Not something an extension can do on the user's behalf (no API to write per-scope model configuration).

## Environment

Third-party BYOK provider via proposed `chatProvider` API. Reproduced with a local (non-remote) window. Happy to provide a minimal repro provider extension on request.

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.