fix(model-settings): enable DeepSeek reasoning effort

This commit is contained in:
acamq
2026-05-10 10:12:22 -06:00
parent c5e89f1eea
commit fd670a8169
2 changed files with 46 additions and 1 deletions
@@ -73,6 +73,12 @@ export const HEURISTIC_MODEL_FAMILY_REGISTRY: ReadonlyArray<HeuristicModelFamily
family: "deepseek",
includes: ["deepseek"],
variants: ["low", "medium", "high"],
reasoningEfforts: ["high", "max"],
reasoningEffortAliases: {
low: "high",
medium: "high",
xhigh: "max",
},
},
{
family: "mistral",
@@ -257,7 +257,7 @@ describe("resolveCompatibleModelSettings", () => {
{ name: "Kimi (k2)", modelID: "k2-v2", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
{ name: "GLM", modelID: "glm-5", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
{ name: "Minimax", modelID: "minimax-m2.5", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
{ name: "DeepSeek", modelID: "deepseek-r2", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
{ name: "DeepSeek", modelID: "deepseek-r2", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: true },
{ name: "Mistral", modelID: "mistral-large-next", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
{ name: "Codestral → Mistral", modelID: "codestral-2506", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
{ name: "Llama", modelID: "llama-4-maverick", expectedVariants: ["low", "medium", "high"], hasReasoningEffort: false },
@@ -320,6 +320,45 @@ describe("resolveCompatibleModelSettings", () => {
})
})
test("DeepSeek keeps canonical high and max reasoningEffort values", () => {
for (const reasoningEffort of ["high", "max"]) {
const result = resolveCompatibleModelSettings({
providerID: "openai-compatible",
modelID: "deepseek-v4-pro",
desired: { reasoningEffort },
})
expect(result.reasoningEffort).toBe(reasoningEffort)
expect(result.changes).toEqual([])
}
})
test("DeepSeek maps generic reasoningEffort levels to canonical API values", () => {
const cases = [
{ requested: "low", expected: "high" },
{ requested: "medium", expected: "high" },
{ requested: "xhigh", expected: "max" },
]
for (const { requested, expected } of cases) {
const result = resolveCompatibleModelSettings({
providerID: "openai-compatible",
modelID: "deepseek-v4-pro",
desired: { reasoningEffort: requested },
})
expect(result.reasoningEffort).toBe(expected)
expect(result.changes).toEqual([
{
field: "reasoningEffort",
from: requested,
to: expected,
reason: "unsupported-by-model-family",
},
])
}
})
test("GPT-5 downgrades unsupported max variant to xhigh", () => {
const result = resolveCompatibleModelSettings({
providerID: "openai",