mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
ResponsesToAnthropicRequest defaults max_tokens to 8192 when the Responses request has no max_output_tokens, and turns any effort above low into thinking.type=enabled with an effort-derived budget: 10240 for high, 32768 for xhigh/max. Anthropic requires max_tokens to be greater than budget_tokens, so every effort above medium was rejected with "budget_tokens must be less than max_tokens". Codex never sends max_output_tokens, so its users could not work around it. After the conversion, raise max_tokens to budget_tokens + 1000 when an enabled budget does not fit, the same rule and padding the Antigravity transformer applies in ensureMaxTokensGreaterThanBudget. Requests that already fit, adaptive thinking, and requests without thinking are unchanged. Fixes #6569