9router/open-sse/translator/request
thienpv 46e6c01a01 fix(claude): reconcile max_tokens vs thinking budget and lift per-model ceiling (#2381)
On the translated OpenAI->Claude path, adjustMaxTokens capped max_tokens
before applyThinking set thinking.budget_tokens, so max-effort budget
(128000) could exceed a 64k-clamped max_tokens -> Anthropic 400.
prepareClaudeRequest now reconciles after the budget is known: prefer
raising max_tokens, only shrink budget when it meets/exceeds the ceiling.

Also lift the global 64000 cap: the ceiling is now the model's real
maxOutput, so high-output models (fable/mythos, opus-4.8/sonnet-4.6) get
their full budget. adjustMaxTokens gains an optional ceiling arg (default
unchanged, callers untouched); openai-to-claude passes the model maxOutput.

Native Claude Code passthrough is unaffected.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 17:38:16 +07:00
..
antigravity-to-openai.js fix(translator): strict Anthropic content block compliance (#2225) 2026-07-03 10:58:39 +07:00
claude-to-kiro.js fix(kiro): deliver system prompt natively, add Opus 4.5/4.7/4.8, tolerate dash version ids (#2366) 2026-07-05 17:34:04 +07:00
claude-to-openai.js fix(kiro): deliver system prompt natively, add Opus 4.5/4.7/4.8, tolerate dash version ids (#2366) 2026-07-05 17:34:04 +07:00
gemini-to-openai.js fix(translator): ESM-safe registry + tool-id pairing + responses max_tokens; add real-creds tests 2026-06-15 11:38:43 +07:00
openai-responses.js fix(reasoning): preserve effort through Codex translations 2026-06-26 12:06:35 +07:00
openai-to-claude.js fix(claude): reconcile max_tokens vs thinking budget and lift per-model ceiling (#2381) 2026-07-05 17:38:16 +07:00
openai-to-commandcode.js refactor(open-sse): translator DRY + schema enums, bug fixes, dead code cleanup 2026-06-14 18:49:38 +07:00
openai-to-cursor.js refactor(open-sse): translator DRY + schema enums, bug fixes, dead code cleanup 2026-06-14 18:49:38 +07:00
openai-to-gemini.js fix(gemini): normalize contents to prevent 400 invalid_argument (#2192) 2026-06-29 15:38:03 +07:00
openai-to-kiro.js fix(kiro): deliver system prompt natively, add Opus 4.5/4.7/4.8, tolerate dash version ids (#2366) 2026-07-05 17:34:04 +07:00
openai-to-ollama.js refactor(open-sse): translator DRY + schema enums, bug fixes, dead code cleanup 2026-06-14 18:49:38 +07:00
openai-to-vertex.js fix(translator): correct thought signatures for AG, Gemini CLI, Vertex; fix missing Vertex response translator 2026-04-05 00:38:36 +07:00