[cherry-pick] Fix default thinking effort - #328873
Merged
Merged
Conversation
lramos15
approved these changes
Aug 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
This PR improves model configuration UX and schema defaults when models don’t advertise a default reasoning/thinking level, ensuring configuration remains reachable and has a sensible default selection.
Changes:
- Only show effort/token labels when a concrete config value is present; otherwise provide a fallback “Configure” label so the button isn’t hidden.
- Introduce shared default-resolution logic for thinking level schemas in the agent host and cover it with a new test.
- Ensure Copilot CLI chooses a valid default reasoning effort when the model’s declared default is missing/invalid.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerConfiguration.ts | Adds explicit value checks and a fallback label/ARIA label so the config button remains visible/reachable. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Adds a regression test validating default thinkingLevel selection when no model default is provided. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Routes thinking-level schema defaults through a new resolver and filters to Copilot-supported levels. |
| src/vs/platform/agentHost/common/reasoningEffort.ts | Introduces resolveDefaultReasoningEffort helper to avoid undefined defaults. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts | Ensures CLI schema default is always one of the supported reasoning efforts. |
| const labelParts: string[] = []; | ||
| const ariaParts: string[] = []; | ||
| if (effortConfig) { | ||
| if (effortConfig && effortConfig.value !== undefined) { |
| ariaParts.push(localize('chat.modelPicker.effortAriaLabel', "Thinking Effort: {0}", effortLabel)); | ||
| } | ||
| if (tokensConfig) { | ||
| if (tokensConfig && tokensConfig.value !== undefined) { |
Comment on lines
+93
to
+100
| if (!labelParts.length) { | ||
| // First-party producers always supply a default, but configuration schemas can also come | ||
| // from third-party extensions via the LM API. Fall back to a generic label rather than | ||
| // hiding the button, so the configuration stays reachable. | ||
| const fallbackLabel = effortConfig?.schema.title ?? tokensConfig?.schema.title ?? localize('chat.modelPicker.configureLabel', "Configure"); | ||
| labelParts.push(fallbackLabel); | ||
| ariaParts.push(fallbackLabel); | ||
| } |
Comment on lines
+65
to
+75
| export function resolveDefaultReasoningEffort(supportedEfforts: readonly string[] | undefined, declaredDefault?: string, modelId?: string): string | undefined { | ||
| if (!supportedEfforts?.length) { | ||
| return undefined; | ||
| } | ||
| if (declaredDefault && supportedEfforts.includes(declaredDefault)) { | ||
| return declaredDefault; | ||
| } | ||
| const lowerId = modelId?.toLowerCase() ?? ''; | ||
| const preferred = lowerId.startsWith('claude') || lowerId.includes('kimi-k3') ? 'high' : 'medium'; | ||
| return supportedEfforts.includes(preferred) ? preferred : supportedEfforts[0]; | ||
| } |
Comment on lines
+2169
to
+2174
| assert.deepStrictEqual(models.map(model => [model.id, model.configSchema?.properties.thinkingLevel?.enum, model.configSchema?.properties.thinkingLevel?.default]), [ | ||
| ['gpt-5.6-terra', ['low', 'medium', 'high', 'xhigh'], 'medium'], | ||
| ['claude-opus-5', ['low', 'medium', 'high', 'xhigh'], 'high'], | ||
| ['no-preferred', ['xhigh'], 'xhigh'], | ||
| ['unsupported-only', undefined, undefined], | ||
| ]); |
pwang347
approved these changes
Aug 3, 2026
pwang347
enabled auto-merge (squash)
August 3, 2026 23:54
Contributor
hediet
approved these changes
Aug 4, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry-pick of #328783 from
main.