fix(thinking): send explicit thinking:{type:adaptive} alongside output_config.effort

This commit is contained in:
luoyide
2026-07-16 11:08:46 +07:00
committed by decolua
parent a077ee85bd
commit ba508f2506
3 changed files with 15 additions and 2 deletions

View File

@@ -173,6 +173,12 @@ function applyFormat(fmt, body, cfg, caps) {
}
case "claude-adaptive": {
if (none && canDisable) { body.thinking = { type: "disabled" }; break; }
// output_config.effort alone does NOT turn thinking on: Anthropic requires
// an explicit thinking:{type:"adaptive"} on Opus 4.6/4.7/4.8 and Sonnet 4.6
// ("thinking is off unless you explicitly set it"), and Anthropic-compatible
// shims (e.g. GitHub Copilot /v1/messages) default thinking off even for
// Sonnet 5. Send both fields — the documented adaptive-thinking shape.
body.thinking = { type: "adaptive" };
const level = toLevel(eff);
body.output_config = { effort: level === "xhigh" ? "high" : level };
break;