fix(ai): expose low reasoning effort for native DeepSeek V4 Flash (#7807)

This commit is contained in:
Michael Yu 2026-08-11 17:15:11 +08:00 • committed by GitHub
parent b987ead358
commit 2f8b4b42fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -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<any>): 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)) {

View file

@ -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", () => {