From 3fdf35e0c1b87b5f56bfa7ec78dd915babe83ada Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 10:29:40 -0700 Subject: [PATCH] fix(moonshot): add reasoning_content field support for Kimi models (#11806) Kimi-K2.5 returns 400 errors when thinking is enabled because reasoning_content is missing from assistant tool call messages. This adds the supportsReasoningContentField flag (as a getter gated on kimi-* models) matching the existing DeepSeek fix, so legacy moonshot-v1-* models are unaffected. Fixes #11600 Fixes #11711 --- core/llm/llms/Moonshot.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/llm/llms/Moonshot.ts b/core/llm/llms/Moonshot.ts index 2235b5ac2..966aeb02e 100644 --- a/core/llm/llms/Moonshot.ts +++ b/core/llm/llms/Moonshot.ts @@ -6,6 +6,13 @@ import OpenAI from "./OpenAI.js"; class Moonshot extends OpenAI { static providerName = "moonshot"; + + constructor(options: LLMOptions) { + super(options); + this.supportsReasoningContentField = + this.model?.startsWith("kimi") ?? false; + } + static defaultOptions: Partial = { apiBase: "https://api.moonshot.cn/v1/", model: "moonshot-v1-8k",