From 922c72bc5a9cc82ac80ea1bce1caebdbf9b0e25b Mon Sep 17 00:00:00 2001 From: LM40R4Y Date: Sat, 7 Feb 2026 14:25:47 +0700 Subject: [PATCH 1/3] Honor explicit 'disable' for reasoning effort --- .../base-openai-compatible-provider.ts | 30 ++++++++++++++++--- .../settings/providers/OpenAICompatible.tsx | 3 ++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/api/providers/base-openai-compatible-provider.ts b/src/api/providers/base-openai-compatible-provider.ts index b8923210c21..1df7b912449 100644 --- a/src/api/providers/base-openai-compatible-provider.ts +++ b/src/api/providers/base-openai-compatible-provider.ts @@ -102,8 +102,19 @@ export abstract class BaseOpenAiCompatibleProvider } // Add thinking parameter if reasoning is enabled and model supports it - if (this.options.enableReasoningEffort && info.supportsReasoningBinary) { - ;(params as any).thinking = { type: "enabled" } + if (this.options.enableReasoningEffort) { + const effort = this.options.reasoningEffort || info.reasoningEffort + const isExplicitlyDisabled = effort === "disable" + + if (info.supportsReasoningBinary && !isExplicitlyDisabled) { + ;(params as any).thinking = { type: "enabled" } + } + + if (info.supportsReasoningEffort && !isExplicitlyDisabled) { + if (effort) { + ;(params as any).reasoning_effort = effort + } + } } try { @@ -233,8 +244,19 @@ export abstract class BaseOpenAiCompatibleProvider } // Add thinking parameter if reasoning is enabled and model supports it - if (this.options.enableReasoningEffort && modelInfo.supportsReasoningBinary) { - ;(params as any).thinking = { type: "enabled" } + if (this.options.enableReasoningEffort) { + const effort = this.options.reasoningEffort || modelInfo.reasoningEffort + const isExplicitlyDisabled = effort === "disable" + + if (modelInfo.supportsReasoningBinary && !isExplicitlyDisabled) { + ;(params as any).thinking = { type: "enabled" } + } + + if (modelInfo.supportsReasoningEffort && !isExplicitlyDisabled) { + if (effort) { + ;(params as any).reasoning_effort = effort + } + } } try { diff --git a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx index 4eea6f09f1b..7c9ee8a73aa 100644 --- a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx +++ b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx @@ -264,6 +264,9 @@ export const OpenAICompatible = ({ ...openAiCustomModelInfo, reasoningEffort: value as ReasoningEffort, }) + setApiConfigurationField("reasoningEffort", value as ReasoningEffort) + } else { + setApiConfigurationField(field, value) } }} modelInfo={{ From 00d314f4b07292b838d9aa75bdebc2bc9f7877ff Mon Sep 17 00:00:00 2001 From: Kevin van Dijk Date: Sun, 15 Feb 2026 15:42:47 +0100 Subject: [PATCH 2/3] Add markers --- src/api/providers/base-openai-compatible-provider.ts | 6 ++++-- .../src/components/settings/providers/OpenAICompatible.tsx | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/providers/base-openai-compatible-provider.ts b/src/api/providers/base-openai-compatible-provider.ts index 1df7b912449..6cce5687404 100644 --- a/src/api/providers/base-openai-compatible-provider.ts +++ b/src/api/providers/base-openai-compatible-provider.ts @@ -101,7 +101,7 @@ export abstract class BaseOpenAiCompatibleProvider }), } - // Add thinking parameter if reasoning is enabled and model supports it + // kilocode_change start - Add reasoning effort and thinking parameters if (this.options.enableReasoningEffort) { const effort = this.options.reasoningEffort || info.reasoningEffort const isExplicitlyDisabled = effort === "disable" @@ -116,6 +116,7 @@ export abstract class BaseOpenAiCompatibleProvider } } } + // kilocode_change end try { return this.client.chat.completions.create(params, requestOptions) @@ -243,7 +244,7 @@ export abstract class BaseOpenAiCompatibleProvider messages: [{ role: "user", content: prompt }], } - // Add thinking parameter if reasoning is enabled and model supports it + // kilocode_change start - Add reasoning effort and thinking parameters if (this.options.enableReasoningEffort) { const effort = this.options.reasoningEffort || modelInfo.reasoningEffort const isExplicitlyDisabled = effort === "disable" @@ -258,6 +259,7 @@ export abstract class BaseOpenAiCompatibleProvider } } } + // kilocode_change end try { const response = await this.client.chat.completions.create(params) diff --git a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx index 7c9ee8a73aa..bd9853e23f6 100644 --- a/webview-ui/src/components/settings/providers/OpenAICompatible.tsx +++ b/webview-ui/src/components/settings/providers/OpenAICompatible.tsx @@ -264,9 +264,11 @@ export const OpenAICompatible = ({ ...openAiCustomModelInfo, reasoningEffort: value as ReasoningEffort, }) + // kilocode_change start - also set reasoningEffort on API config setApiConfigurationField("reasoningEffort", value as ReasoningEffort) } else { setApiConfigurationField(field, value) + // kilocode_change end } }} modelInfo={{ From fc023426ee2dc1497f81fdea30c23b6f939faeea Mon Sep 17 00:00:00 2001 From: Kevin van Dijk Date: Sun, 15 Feb 2026 16:02:08 +0100 Subject: [PATCH 3/3] Add changeset --- .changeset/heavy-cases-sing.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/heavy-cases-sing.md diff --git a/.changeset/heavy-cases-sing.md b/.changeset/heavy-cases-sing.md new file mode 100644 index 00000000000..3e61762dbaa --- /dev/null +++ b/.changeset/heavy-cases-sing.md @@ -0,0 +1,5 @@ +--- +"kilo-code": patch +--- + +Fix: Honor explicit 'disable' for reasoning effort