From 2f8b4b42fecf2388f0f3326eab16c72eca3f62b0 Mon Sep 17 00:00:00 2001 From: Michael Yu Date: Tue, 11 Aug 2026 17:15:11 +0800 Subject: [PATCH] fix(ai): expose low reasoning effort for native DeepSeek V4 Flash (#7807) --- packages/ai/scripts/generate-models.ts | 8 +++++++- packages/ai/test/supports-xhigh.test.ts | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/ai/scripts/generate-models.ts b/packages/ai/scripts/generate-models.ts index 95c939c70..d44c75e97 100644 --- a/packages/ai/scripts/generate-models.ts +++ b/packages/ai/scripts/generate-models.ts @@ -267,6 +267,10 @@ const DEEPSEEK_V4_THINKING_LEVEL_MAP = { high: "high", max: "max", } as const; +const DEEPSEEK_V4_FLASH_THINKING_LEVEL_MAP = { + ...DEEPSEEK_V4_THINKING_LEVEL_MAP, + low: "low", +} as const; const QWEN_TOKEN_PLAN_HIGH_MAX_THINKING_LEVEL_MAP = { minimal: null, low: null, @@ -875,7 +879,9 @@ function applyThinkingLevelMetadata(model: Model): void { model, model.provider === "openrouter" ? { ...DEEPSEEK_V4_THINKING_LEVEL_MAP, xhigh: "xhigh", max: null } - : DEEPSEEK_V4_THINKING_LEVEL_MAP, + : model.provider === "deepseek" && model.id === "deepseek-v4-flash" + ? DEEPSEEK_V4_FLASH_THINKING_LEVEL_MAP + : DEEPSEEK_V4_THINKING_LEVEL_MAP, ); } if (isGoogleThinkingApi(model) && isGemini3ProModel(model.id)) { diff --git a/packages/ai/test/supports-xhigh.test.ts b/packages/ai/test/supports-xhigh.test.ts index 29e16fa82..a1fd7ff8f 100644 --- a/packages/ai/test/supports-xhigh.test.ts +++ b/packages/ai/test/supports-xhigh.test.ts @@ -82,10 +82,10 @@ describe("getSupportedThinkingLevels", () => { expect(getSupportedThinkingLevels(model!)).toEqual(["medium", "high", "xhigh"]); }); - it("includes only high/max plus off for DeepSeek V4 Flash on the DeepSeek provider", () => { + it("includes low/high/max plus off for DeepSeek V4 Flash on the DeepSeek provider", () => { const model = getModel("deepseek", "deepseek-v4-flash"); expect(model).toBeDefined(); - expect(getSupportedThinkingLevels(model!)).toEqual(["off", "high", "max"]); + expect(getSupportedThinkingLevels(model!)).toEqual(["off", "low", "high", "max"]); }); it("includes only high/max plus off for DeepSeek V4 Flash on opencode-go", () => {