Skip to content

Commit 59e0b10

Browse files
authored
Cap Thinking Budget to prevent runaway thought loops (#12416)
1 parent 9d642f3 commit 59e0b10

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/get-started/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ their corresponding top-level category object in your `settings.json` file.
548548

549549
- **`experimental.codebaseInvestigatorSettings.thinkingBudget`** (number):
550550
- **Description:** The thinking budget for the Codebase Investigator agent.
551-
- **Default:** `-1`
551+
- **Default:** `8192`
552552
- **Requires restart:** Yes
553553

554554
- **`experimental.codebaseInvestigatorSettings.model`** (string):

packages/cli/src/config/settingsSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ const SETTINGS_SCHEMA = {
12531253
label: 'Thinking Budget',
12541254
category: 'Experimental',
12551255
requiresRestart: true,
1256-
default: -1,
1256+
default: 8192,
12571257
description:
12581258
'The thinking budget for the Codebase Investigator agent.',
12591259
showInDialog: false,

packages/core/src/config/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export const DEFAULT_GEMINI_MODEL_AUTO = 'auto';
1212

1313
export const DEFAULT_GEMINI_EMBEDDING_MODEL = 'gemini-embedding-001';
1414

15-
// Some thinking models do not default to dynamic thinking which is done by a value of -1
16-
export const DEFAULT_THINKING_MODE = -1;
15+
// Cap the thinking at 8192 to prevent run-away thinking loops.
16+
export const DEFAULT_THINKING_MODE = 8192;
1717

1818
/**
1919
* Determines the effective model to use, applying fallback logic if necessary.

schemas/settings.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@
832832
"thinkingBudget": {
833833
"title": "Thinking Budget",
834834
"description": "The thinking budget for the Codebase Investigator agent.",
835-
"markdownDescription": "The thinking budget for the Codebase Investigator agent.\n\n- Category: `Experimental`\n- Requires restart: `yes`\n- Default: `-1`",
836-
"default": -1,
835+
"markdownDescription": "The thinking budget for the Codebase Investigator agent.\n\n- Category: `Experimental`\n- Requires restart: `yes`\n- Default: `8192`",
836+
"default": 8192,
837837
"type": "number"
838838
},
839839
"model": {

0 commit comments

Comments
 (0)