mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 10:01:11 +00:00
fix(agents): land #31002 from @yfge
Co-authored-by: yfge <geyunfei@gmail.com>
This commit is contained in:
@@ -29,6 +29,14 @@ export function pickFallbackThinkingLevel(params: {
|
||||
}
|
||||
const supported = extractSupportedValues(raw);
|
||||
if (supported.length === 0) {
|
||||
// When the error clearly indicates the thinking level is unsupported but doesn't
|
||||
// list supported values (e.g. OpenAI's "think value \"low\" is not supported for
|
||||
// this model"), fall back to "off" to allow the request to succeed.
|
||||
// This commonly happens during model fallback when switching from Anthropic
|
||||
// (which supports thinking levels) to providers that don't.
|
||||
if (/not supported/i.test(raw) && !params.attempted.has("off")) {
|
||||
return "off";
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
for (const entry of supported) {
|
||||
|
||||
Reference in New Issue
Block a user