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")) }