From 8021853ee447bb549fc29d02be93db6eb2185cf8 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 20 Aug 2025 19:16:14 +0530 Subject: [PATCH 1/3] fix: disable system message tools for kimi k2 --- core/config/shouldAutoEnableSystemMessageTools.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/config/shouldAutoEnableSystemMessageTools.ts b/core/config/shouldAutoEnableSystemMessageTools.ts index bdebaab1c..480b14ae8 100644 --- a/core/config/shouldAutoEnableSystemMessageTools.ts +++ b/core/config/shouldAutoEnableSystemMessageTools.ts @@ -21,9 +21,12 @@ import { ModelDescription } from "../index.d"; export function shouldAutoEnableSystemMessageTools( model: ModelDescription, ): boolean | undefined { - // Auto-enable for OpenRouter, but exclude Claude models which have good native tool calling + // Auto-enable for OpenRouter, but exclude Claude/KimiK2 models which have good native tool calling if (model.provider === "openrouter") { - return !model.model.toLowerCase().includes("claude"); + return ( + !model.model.toLowerCase().includes("claude") && + !model.model.toLowerCase().includes("kimi-k2") + ); } // No auto-preference for all other providers - use manual setting From 65a44988aa0ff6bc938c1b323cfc22bdeb9128d4 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:33:24 +0530 Subject: [PATCH 2/3] revert in shouldAutoEnableSystemMessageTools --- core/config/shouldAutoEnableSystemMessageTools.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/config/shouldAutoEnableSystemMessageTools.ts b/core/config/shouldAutoEnableSystemMessageTools.ts index 480b14ae8..bdebaab1c 100644 --- a/core/config/shouldAutoEnableSystemMessageTools.ts +++ b/core/config/shouldAutoEnableSystemMessageTools.ts @@ -21,12 +21,9 @@ import { ModelDescription } from "../index.d"; export function shouldAutoEnableSystemMessageTools( model: ModelDescription, ): boolean | undefined { - // Auto-enable for OpenRouter, but exclude Claude/KimiK2 models which have good native tool calling + // Auto-enable for OpenRouter, but exclude Claude models which have good native tool calling if (model.provider === "openrouter") { - return ( - !model.model.toLowerCase().includes("claude") && - !model.model.toLowerCase().includes("kimi-k2") - ); + return !model.model.toLowerCase().includes("claude"); } // No auto-preference for all other providers - use manual setting From 9183b3a235c03bd8801cf86707f6849464d386c4 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:34:32 +0530 Subject: [PATCH 3/3] add in tool support --- core/llm/toolSupport.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 7c89dbfa4..47da712e3 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -302,6 +302,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "meta-llama/llama-3-70b-instruct", "arcee-ai/caller-large", "nousresearch/hermes-3-llama-3.1-70b", + "moonshotai/kimi-k2", ]; for (const model of specificModels) { if (model.toLowerCase() === model) {