Skip to content

[cherry-pick] Fix default thinking effort - #328873

Merged
pwang347 merged 1 commit into
release/1.132from
cherry-pick/328783
Aug 4, 2026
Merged

[cherry-pick] Fix default thinking effort#328873
pwang347 merged 1 commit into
release/1.132from
cherry-pick/328783

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Cherry-pick of #328783 from main.

Copilot AI review requested due to automatic review settings August 3, 2026 23:53
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
pwang347 enabled auto-merge (squash) August 3, 2026 23:54
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 82b074f3 Current: f60992f1

Changed (1)

chat/input/chatInput/VoiceModeConnecting/Dark
Before After
before after

1 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

@pwang347
pwang347 merged commit bdc4ace into release/1.132 Aug 4, 2026
28 of 29 checks passed
@pwang347
pwang347 deleted the cherry-pick/328783 branch August 4, 2026 00:24
@vs-code-engineering vs-code-engineering Bot added this to the 1.132.0 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants