fix(codebuddy): only send reasoning params when client requests reasoning

Forcing reasoning_effort:"medium" + reasoning_summary:"auto" on plain
requests tripped CodeBuddy's content filter and returned an error (#2071).
Make reasoning params opt-in: only set reasoning_summary when the client
sent an explicit reasoning_effort; none/off still drops it.

Fixes #2071

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Rex
2026-06-26 10:51:16 +07:00
committed by decolua
co-authored by Cursor
parent 77b3856402
commit d1e98d9a60
2 changed files with 43 additions and 2 deletions
+6 -2
View File
@@ -25,10 +25,14 @@ export class CodeBuddyExecutor extends DefaultExecutor {
const eff = transformed.reasoning_effort;
if (eff === "none" || eff === "off") {
delete transformed.reasoning_effort; // gateway has no "none" — just omit
} else {
if (!eff) transformed.reasoning_effort = "medium";
} else if (eff) {
// Client explicitly asked for reasoning — mirror the CLI's reasoning_summary
// so CodeBuddy surfaces the model's reasoning.
transformed.reasoning_summary = "auto";
}
// No reasoning requested: leave both unset. Forcing reasoning_effort:"medium"
// + reasoning_summary on plain requests makes CodeBuddy trip its content
// filter and return an error (#2071).
return transformed;
}
}