mirror of
https://github.com/cline/cline.git
synced 2026-10-30 18:12:49 +08:00
fix(llms): fix disabled reasoning for Fable 5 error (#11397)
* fix(llms): avoid disabled reasoning for fable 5
* fix(llms): route fable reasoning by family
* Revert "fix(llms): route fable reasoning by family"
This reverts commit 6dd4e5dcf5.
* fix(llms): match claude fable reasoning workaround broadly
This commit is contained in:
@@ -581,10 +581,16 @@ export function buildGatewayReasoningOptions(
|
||||
explicitBudgetTokens: request.reasoning?.budgetTokens,
|
||||
})
|
||||
: request.reasoning?.budgetTokens;
|
||||
const shouldSendDisabledReasoning =
|
||||
request.reasoning?.enabled === false &&
|
||||
// FIXME: temporary OpenRouter compatibility patch for Claude Fable.
|
||||
// Remove once OpenRouter normalizes disabled reasoning like Vercel does,
|
||||
// or replace with a systematic policy for models that reject it.
|
||||
!request.modelId.toLowerCase().includes("claude-fable");
|
||||
const reasoning: Record<string, unknown> = {
|
||||
...(request.reasoning?.enabled === true
|
||||
? { enabled: true }
|
||||
: request.reasoning?.enabled === false
|
||||
: shouldSendDisabledReasoning
|
||||
? { enabled: false }
|
||||
: request.reasoning?.effort
|
||||
? { enabled: true }
|
||||
|
||||
@@ -1101,6 +1101,20 @@ describe("composeAiSdkProviderOptions: family/provider thinking patches", () =>
|
||||
context: { family: "kimi-k2.6" },
|
||||
expect: [{ bucket: "cline", has: { reasoning: { enabled: false } } }],
|
||||
},
|
||||
{
|
||||
name: "cline Claude Fable reasoning.enabled=false uses lowest supported reasoning",
|
||||
request: {
|
||||
providerId: "cline",
|
||||
modelId: "anthropic/claude-fable-5",
|
||||
reasoning: { enabled: false },
|
||||
},
|
||||
expect: [
|
||||
{
|
||||
bucket: "cline",
|
||||
has: { reasoning: { max_tokens: 1024 } },
|
||||
},
|
||||
],
|
||||
},
|
||||
// OpenRouter owns the reasoning object regardless of Moonshot family.
|
||||
{
|
||||
name: "openrouter non-K2.6 Moonshot Kimi reasoning.enabled=false -> reasoning.exclude",
|
||||
|
||||
Reference in New Issue
Block a user