修复bug
This commit is contained in:
@@ -211,10 +211,21 @@ impl LlmClient {
|
||||
|
||||
/// Parse commit response from LLM
|
||||
fn parse_commit_response(&self, response: &str, format: crate::config::CommitFormat) -> Result<GeneratedCommit> {
|
||||
let lines: Vec<&str> = response.lines().collect();
|
||||
|
||||
let lines: Vec<&str> = response.lines()
|
||||
.map(|l| l.trim())
|
||||
.filter(|l| !l.is_empty())
|
||||
.collect();
|
||||
|
||||
if lines.is_empty() {
|
||||
bail!("Empty response from LLM");
|
||||
let preview: String = response.chars().take(200).collect();
|
||||
bail!(
|
||||
"LLM returned empty or whitespace-only response. \
|
||||
Raw response preview: '{}'. \
|
||||
Hint: If using DeepSeek/Kimi with thinking enabled, \
|
||||
the model may have returned reasoning_content only. \
|
||||
Try disabling thinking mode or switching models.",
|
||||
preview
|
||||
);
|
||||
}
|
||||
|
||||
let first_line = lines[0];
|
||||
|
||||
Reference in New Issue
Block a user