Fix Ultrathink Token Limit Bug (#1284)

* auto-claude: subtask-1-1 - Update THINKING_BUDGET_MAP['ultrathink'] to 64000

- Changed ultrathink token limit from 60000 to 64000 (Claude API maximum)
- Updated comment to reflect it's within API limits (not below)
- Fixes potential API 400 errors when using ultrathink thinking level

* auto-claude: subtask-1-2 - Update frontend THINKING_BUDGET_MAP ultrathink to 64000

* auto-claude: subtask-1-3 - Update test assertions for ultrathink 64000 token limit

Update test_thinking_level_validation.py to expect 64000 for ultrathink
budget, matching the changes made to phase_config.py and the frontend.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Andy
2026-01-18 12:57:31 +01:00
committed by GitHub
parent f700b18d8b
commit e989300b87
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ THINKING_BUDGET_MAP: dict[str, int | None] = {
"low": 1024,
"medium": 4096, # Moderate analysis
"high": 16384, # Deep thinking for QA review
"ultrathink": 60000, # Maximum reasoning depth (must be < Opus 4.5's 64000 limit)
"ultrathink": 64000, # Maximum reasoning depth (within Claude API's 64000 token limit)
}
# Spec runner phase-specific thinking levels
+1 -1
View File
@@ -28,7 +28,7 @@ export const THINKING_BUDGET_MAP: Record<string, number | null> = {
low: 1024,
medium: 4096,
high: 16384,
ultrathink: 60000 // Maximum reasoning depth (must be < Opus 4.5's 64000 limit)
ultrathink: 64000 // Maximum reasoning depth (Claude API hard limit)
} as const;
// ============================================
+3 -3
View File
@@ -32,8 +32,8 @@ class TestThinkingLevelValidation:
assert get_thinking_budget("none") is None
def test_ultrathink_max_budget(self):
"""Test that 'ultrathink' returns maximum budget."""
assert get_thinking_budget("ultrathink") == 60000
"""Test that 'ultrathink' returns maximum budget (Claude API's 64000 token limit)."""
assert get_thinking_budget("ultrathink") == 64000
def test_invalid_level_logs_warning(self, caplog):
"""Test that invalid thinking level logs a warning."""
@@ -89,4 +89,4 @@ class TestThinkingLevelValidation:
assert get_thinking_budget("low") == 1024
assert get_thinking_budget("medium") == 4096
assert get_thinking_budget("high") == 16384
assert get_thinking_budget("ultrathink") == 60000
assert get_thinking_budget("ultrathink") == 64000