From 5e1e666b5d07a36c9d165decbbc2fc847b5b96f1 Mon Sep 17 00:00:00 2001 From: lin200083 Date: Sat, 4 Jul 2026 16:22:05 +0800 Subject: [PATCH] fix: pass reasoning_effort='none' when thinking is disabled for OpenAI-compatible providers When [thinking] enabled = false in config.toml, thinkingEffortToReasoningEffort('off') returned undefined, causing the reasoning_effort parameter to be omitted from API requests. OpenAI-compatible providers like DeepSeek V4 Flash would then use their server-side default (medium), keeping thinking mode on. Fix this by mapping 'off' -> 'none' instead of undefined, so the request explicitly signals that reasoning should be disabled. Fixes https://github.com/MoonshotAI/kimi-code/issues/1362 --- packages/kosong/src/providers/openai-common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kosong/src/providers/openai-common.ts b/packages/kosong/src/providers/openai-common.ts index b83377e4ec..ae829077af 100644 --- a/packages/kosong/src/providers/openai-common.ts +++ b/packages/kosong/src/providers/openai-common.ts @@ -151,7 +151,7 @@ export function isFunctionToolCall( export function thinkingEffortToReasoningEffort(effort: ThinkingEffort): string | undefined { switch (effort) { case 'off': - return undefined; + return 'none'; case 'low': return 'low'; case 'medium':