Support effort parameter for extended thinking, graduate thinking budget setting, and clean up CAPI path#4670
Open
Support effort parameter for extended thinking, graduate thinking budget setting, and clean up CAPI path#4670
Conversation
…get setting, and clean up CAPI thinking budget path
18c0345 to
3ed6a9f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Anthropic “thinking” configuration and request shaping to align with current Anthropic API semantics, promotes the thinking budget setting to a stable configuration, and removes now-unneeded Chat Completions (CAPI) thinking-budget handling and its associated tests.
Changes:
- Send
output_config.effortwhenever Anthropic thinking is enabled (not only for adaptive thinking) on the Messages API path. - Graduate
AnthropicThinkingBudgetto a stableConfigType.Simplesetting and expose it outside of preview configuration. - Remove legacy
thinking_budgethandling on the Chat Completions (CAPI) path and delete the tests that covered that path.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/platform/endpoint/node/messagesApi.ts | Broadens when effort is included and switches thinking budget read to getConfig(). |
| src/platform/configuration/common/configurationService.ts | Changes AnthropicThinkingBudget from experiment-based to simple config. |
| src/extension/byok/vscode-node/anthropicProvider.ts | Updates thinking budget retrieval to getConfig(). |
| src/platform/endpoint/node/chatEndpoint.ts | Removes Anthropic thinking_budget mutation from the CAPI request body path. |
| src/platform/endpoint/node/test/copilotChatEndpoint.spec.ts | Deletes tests and helpers for the removed CAPI thinking-budget behavior. |
| package.json | Moves github.copilot.chat.anthropic.thinking.budgetTokens out of preview and makes it stable. |
Comments suppressed due to low confidence (1)
src/platform/endpoint/node/chatEndpoint.ts:349
- Removing the
thinking_budgetmutation fromcustomizeCapiBodymeans Anthropic extended-thinking budget is no longer applied when a Claude/Anthropic model is routed through the Chat Completions (CAPI) path (e.g., whenUseAnthropicMessagesApiis off or whensupported_endpointsdoesn’t includeMessages). If that routing can still happen,enableThinking+AnthropicThinkingBudgetbecomes a silent no-op for those requests. Consider either (1) guaranteeing Anthropic models never use the CAPI path (and/or adding an explicit assertion/telemetry when they do), or (2) preserving equivalent thinking-budget behavior for the CAPI body so the setting continues to work under fallback routing.
protected customizeCapiBody(body: IEndpointBody, options: ICreateEndpointBodyOptions): IEndpointBody {
// Apply Gemini function calling mode if configured
const hasTools = !!options.requestOptions?.tools?.length;
if (hasTools && this.family.toLowerCase().includes('gemini-3')) {
const geminiFunctionCallingMode = this._configurationService.getExperimentBasedConfig(
ConfigKey.TeamInternal.GeminiFunctionCallingMode,
Yoyokrazy
approved these changes
Mar 25, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 25, 2026
…get setting, and clean up CAPI thinking budget path (#4670)
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.
Summary
Three related changes to Anthropic thinking/effort configuration:
1. Support effort parameter for extended thinking
Previously, the
effortparameter inoutput_configwas only set when adaptive thinking was enabled (thinkingConfig.type === "adaptive"). The Anthropic docs confirm thateffortworks with both adaptive and extended thinking. This change broadens the condition to seteffortwhenever anythinkingConfigis present.File:
src/platform/endpoint/node/messagesApi.ts2. Graduate
AnthropicThinkingBudgetfrom experimental to stableConfigType.ExperimentBasedtoConfigType.Simplewith a default of 16,000 tokens"preview"section inpackage.jsonto the main configuration section"preview"and"onExp"tagsgetExperimentBasedConfig()togetConfig()Files:
configurationService.ts,package.json,anthropicProvider.ts,messagesApi.ts,chatEndpoint.ts3. Clean up CAPI thinking budget path
The
thinking_budgetlogic incustomizeCapiBody(Chat Completions API path) was already removed from production code. This PR removes the corresponding 17 tests incopilotChatEndpoint.spec.tsthat were testing that defunct code path, along with unused imports and helper functions (createAnthropicModelMetadata,createUserMessage,ConfigKey,ChatLocation).File:
src/platform/endpoint/node/test/copilotChatEndpoint.spec.ts