If long context = default context. Show a single long context option in picker - #323116
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates model-configuration UI/schema generation so that when “long context” is effectively the default (no surcharge), the UI can still display a single long-context option as an indicator rather than hiding the setting entirely.
Changes:
- Allow single-item
enumconfiguration properties to surface in model configuration action menus and the chat model picker. - Emit a single-option
contextSizeschema/option when long-context has no surcharge (agent host + Copilot extension + Copilot CLI). - Adjust/extend unit tests to validate the new single-option behavior.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/common/languageModels.test.ts | Updates tests to expect single-item enums to produce actions (and fixes coverage for the new behavior). |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Includes single-item enum properties when generating per-model configuration submenu actions. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts | Allows single-item enums to appear in the combined (UBB) model configuration UI. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Updates agent host test to expect a single long-context contextSize option instead of omitting the property. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Synthesizes a single-option contextSize schema when long-context has no surcharge. |
| extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts | Returns a single long-context option when there is no surcharge, enabling the picker indicator. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts | Emits a single long-context option (instead of two) when there is no surcharge in Copilot CLI schema. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Low
Comment on lines
+839
to
+849
| return { | ||
| type: 'number', | ||
| title: localize('copilot.modelContextSize.title', "Context Size"), | ||
| description: localize('copilot.modelContextSize.description', "Selects the context window size for this model."), | ||
| default: longContextMax, | ||
| enum: [longContextMax], | ||
| enumLabels: [formatTokenCount(longContextMax)], | ||
| enumDescriptions: [ | ||
| localize('copilot.modelContextSize.longerSessions', "Longer sessions"), | ||
| ], | ||
| }; |
Comment on lines
296
to
301
| for (const [key, propSchema] of Object.entries(schema.properties)) { | ||
| if (propSchema.group !== group) { | ||
| continue; | ||
| } | ||
| if (!propSchema.enum || propSchema.enum.length < 2) { | ||
| if (!propSchema.enum || propSchema.enum.length < 1) { | ||
| continue; |
| }); | ||
|
|
||
| test('builds one submenu per enum property with >= 2 values', () => { | ||
| test('builds one submenu per enum property with >= 1 values', () => { |
Benjamin Christopher Simmonds (benibenj)
approved these changes
Jun 26, 2026
Sandeep Somavarapu (sandy081)
approved these changes
Jun 26, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.