From b8182e75387dedd45a1203e5ae898b3b8bd189d9 Mon Sep 17 00:00:00 2001 From: SidneyZhang Date: Wed, 27 May 2026 14:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dkimi=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 4 ++-- src/llm/kimi.rs | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00087dc..3647339 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quicommit" -version = "0.2.3" +version = "0.2.4" edition = "2024" authors = ["Sidney Zhang "] description = "A powerful Git assistant tool with AI-powered commit/tag/changelog generation(alpha version)" @@ -86,7 +86,7 @@ wiremock = "0.6" [profile.release] opt-level = "s" lto = "thin" -codegen-units = 2 +codegen-units = 1 panic = "abort" strip = true debug = false diff --git a/src/llm/kimi.rs b/src/llm/kimi.rs index e8f15e4..fb46163 100644 --- a/src/llm/kimi.rs +++ b/src/llm/kimi.rs @@ -346,7 +346,17 @@ impl KimiClient { .choices .into_iter() .next() - .map(|c| c.message.content.trim().to_string()) + .map(|c| { + let content = c.message.content.trim().to_string(); + if content.is_empty() { + c.reasoning_content + .or(c.message.reasoning_content) + .map(|r| r.trim().to_string()) + .unwrap_or_default() + } else { + content + } + }) .filter(|s| !s.is_empty()) .ok_or_else(|| anyhow::anyhow!("No response from Kimi")) }