Skip to content

Commit 83e7994

Browse files
authored
update Anthropic thinking budget to default to 4000 (#2588)
* update Anthropic thinking budget to default to 4000 * test: update thinking_budget test to use default value of 4000
1 parent 44629da commit 83e7994

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,13 +3258,11 @@
32583258
]
32593259
},
32603260
"github.copilot.chat.anthropic.thinking.budgetTokens": {
3261-
"type": [
3262-
"number",
3263-
"null"
3264-
],
3261+
"type": "number",
32653262
"markdownDescription": "%github.copilot.config.anthropic.thinking.budgetTokens%",
32663263
"minimum": 0,
32673264
"maximum": 32000,
3265+
"default": 4000,
32683266
"tags": [
32693267
"experimental",
32703268
"onExp"
@@ -5130,4 +5128,4 @@
51305128
"string_decoder": "npm:[email protected]",
51315129
"node-gyp": "npm:[email protected]"
51325130
}
5133-
}
5131+
}

src/platform/configuration/common/configurationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ export namespace ConfigKey {
815815
export const ResponsesApiReasoningSummary = defineSetting<'off' | 'detailed'>('chat.responsesApiReasoningSummary', ConfigType.ExperimentBased, 'detailed');
816816
export const EnableChatImageUpload = defineSetting<boolean>('chat.imageUpload.enabled', ConfigType.ExperimentBased, true);
817817
/** Thinking token budget for Anthropic extended thinking. If set, enables extended thinking. */
818-
export const AnthropicThinkingBudget = defineSetting<number | undefined>('chat.anthropic.thinking.budgetTokens', ConfigType.ExperimentBased, undefined);
818+
export const AnthropicThinkingBudget = defineSetting<number>('chat.anthropic.thinking.budgetTokens', ConfigType.ExperimentBased, 4000);
819819
/** Enable Anthropic web search tool for BYOK Claude models */
820820
export const AnthropicWebSearchToolEnabled = defineSetting<boolean>('chat.anthropic.tools.websearch.enabled', ConfigType.ExperimentBased, false);
821821
/** Maximum number of web searches allowed per request */

src/platform/endpoint/node/test/copilotChatEndpoint.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ describe('ChatEndpoint - Anthropic Thinking Budget', () => {
374374
expect(body.thinking_budget).toBe(maxOutputTokens - 1);
375375
});
376376

377-
it('should not set thinking_budget when configuredBudget is undefined', () => {
377+
it('should use default thinking_budget of 4000', () => {
378378
mockServices.configurationService.setConfig(ConfigKey.AnthropicThinkingBudget, undefined);
379379
const modelMetadata = createAnthropicModelMetadata('claude-sonnet-4-5');
380380

@@ -396,7 +396,7 @@ describe('ChatEndpoint - Anthropic Thinking Budget', () => {
396396
const options = createTestOptions([createUserMessage('Hello')]);
397397
const body = endpoint.createRequestBody(options);
398398

399-
expect(body.thinking_budget).toBeUndefined();
399+
expect(body.thinking_budget).toBe(4000);
400400
});
401401

402402
it('should not set thinking_budget for non-Anthropic models (gpt)', () => {

0 commit comments

Comments
 (0)