fix(provider): honor reasoning option semantics (#37519)

This commit is contained in:
Aiden Cline
2026-07-17 14:23:33 -05:00
committed by GitHub
parent 0df2f6245a
commit 49d2dd8a38
3 changed files with 30 additions and 11 deletions
@@ -1477,7 +1477,7 @@ test("models.dev normalization fills required response fields", () => {
expect(model.release_date).toBe("")
})
test("models.dev reasoning options replace generated variants and unsupported options fall back", () => {
test("models.dev reasoning options replace generated variants and unsupported toggles fall back", () => {
const provider = {
id: "reasoning",
name: "Reasoning",
@@ -1514,6 +1514,14 @@ test("models.dev reasoning options replace generated variants and unsupported op
limit: { context: 128_000, output: 64_000 },
experimental: { modes: { fast: {} } },
},
anthropicCompatible: {
id: "k3",
name: "Anthropic Compatible",
reasoning: true,
reasoning_options: [{ type: "effort", values: ["max"] }],
provider: { npm: "@ai-sdk/anthropic" },
limit: { context: 1_048_576, output: 131_072 },
},
},
} as unknown as ModelsDev.Provider
@@ -1530,6 +1538,7 @@ test("models.dev reasoning options replace generated variants and unsupported op
expect(models.override.variants).toEqual({
high: { thinkingConfig: { includeThoughts: true, thinkingLevel: "high" } },
})
expect(models.anthropicCompatible.variants).toEqual({ max: { effort: "max" } })
expect(models["gemini-3-pro-fast"].variants).toEqual(models.override.variants)
})