mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix(translator): clamp thinking effort max->xhigh for OpenAI format (#2466)
Claude Code sends reasoning_effort "max" (its top level); OpenAI enum caps at "xhigh" and rejects "max" with HTTP 400 "max effort not support". applyFormat case "openai" now clamps "max"->"xhigh" before assigning body.reasoning_effort; other levels pass through unchanged. Add regression test covering client output_config.effort, direct reasoning_effort, passthrough of xhigh/high, and budget_tokens capping. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
d75471bbbc
commit
288940960a
@@ -184,7 +184,8 @@ function applyFormat(fmt, body, cfg, caps) {
|
||||
case "openai": {
|
||||
if (none && canDisable) { body.reasoning_effort = "none"; break; }
|
||||
const level = toLevel(eff);
|
||||
if (level) body.reasoning_effort = level;
|
||||
// OpenAI reasoning_effort enum caps at "xhigh" (no "max"); clamp Claude Code's "max".
|
||||
if (level) body.reasoning_effort = level === "max" ? "xhigh" : level;
|
||||
break;
|
||||
}
|
||||
case "claude-adaptive": {
|
||||
|
||||
Reference in New Issue
Block a user