Skip to content

fix(anthropic): raise adaptive-thinking max_tokens default#237

Open
jonathanli12 wants to merge 1 commit into
lidge-jun:devfrom
jonathanli12:fix/anthropic-adaptive-max-tokens
Open

fix(anthropic): raise adaptive-thinking max_tokens default#237
jonathanli12 wants to merge 1 commit into
lidge-jun:devfrom
jonathanli12:fix/anthropic-adaptive-max-tokens

Conversation

@jonathanli12

Copy link
Copy Markdown

Summary

  • Adaptive Claude models (claude-fable-5, claude-sonnet-5, claude-opus-4-7, claude-opus-4-8) previously kept the generic max_tokens = 8192 default when Codex omitted max_output_tokens.
  • The adaptive path only set thinking.type = "adaptive" and output_config.effort, and never resized max_tokens.
  • Long Codex parent turns hit that ceiling mid-work and finished with no final message, even though those models support a 128k output ceiling.
  • Default adaptive max_tokens to 128000 when Codex omits a budget, and preserve explicit maxOutputTokens.

Verification

  • bun test tests/anthropic-reasoning.test.ts
  • Added regression coverage that adaptive models default to 128000 and preserve explicit budgets.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Target branch corrected

This pull request now targets dev.

The [WRONG BRANCH] title prefix has been removed. The pull request has been marked ready for review again.

@github-actions github-actions Bot changed the title fix(anthropic): raise adaptive-thinking max_tokens default [WRONG BRANCH] fix(anthropic): raise adaptive-thinking max_tokens default Jul 22, 2026
@github-actions
github-actions Bot marked this pull request as draft July 22, 2026 01:42
@jonathanli12 jonathanli12 changed the title [WRONG BRANCH] fix(anthropic): raise adaptive-thinking max_tokens default fix(anthropic): raise adaptive-thinking max_tokens default Jul 22, 2026
@jonathanli12
jonathanli12 changed the base branch from main to dev July 22, 2026 01:45
Adaptive Claude models (Fable 5, Sonnet 5, Opus 4.7+) previously kept the
generic 8192 max_tokens default because the adaptive path only set
thinking/effort and never resized max_tokens. Long Codex turns hit the cap
mid-work and finished with no final message even though those models support
128k output.

Default adaptive max_tokens to 128000 when Codex omits max_output_tokens, and
preserve explicit budgets. Add regression coverage.
@github-actions
github-actions Bot marked this pull request as ready for review July 22, 2026 01:45
@jonathanli12
jonathanli12 force-pushed the fix/anthropic-adaptive-max-tokens branch from 37581a8 to 239dbb6 Compare July 22, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant