{"record":{"id":"1206fb1cbe4b4e79","repo":"nikivdev/code","slug":"opencode-returned-empty-commit-message","errorCode":null,"errorMessage":"opencode returned empty commit message","messagePattern":"opencode returned empty commit message","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":12721,"sourceCode":"    let stdout = String::from_utf8_lossy(&output.stdout);\n    let mut message = String::new();\n    for line in stdout.lines() {\n        if let Ok(json) = serde_json::from_str::<serde_json::Value>(line) {\n            if json.get(\"type\").and_then(|t| t.as_str()) == Some(\"text\") {\n                if let Some(text) = json\n                    .get(\"part\")\n                    .and_then(|p| p.get(\"text\"))\n                    .and_then(|t| t.as_str())\n                {\n                    message.push_str(text);\n                }\n            }\n        }\n    }\n\n    let message = message.trim().to_string();\n    if message.is_empty() {\n        bail!(\"opencode returned empty commit message\");\n    }\n\n    Ok(trim_quotes(&message))\n}\n\n/// Generate commit message using Claude Code CLI.\nfn generate_commit_message_claude(diff: &str, status: &str, truncated: bool) -> Result<String> {\n    let mut prompt = String::from(\n        \"Write a git commit message for these changes. Output ONLY the commit message, nothing else.\\n\\n\\\n         Guidelines:\\n\\\n         - Use imperative mood (\\\"Add feature\\\" not \\\"Added feature\\\")\\n\\\n         - First line: concise summary under 72 chars\\n\\\n         - Focus on WHAT and WHY, not just listing files\\n\\n\\\n         Git diff:\\n\",\n    );\n    prompt.push_str(diff);\n\n    if truncated {","sourceCodeStart":12703,"sourceCodeEnd":12739,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L12703-L12739","documentation":"Error \"opencode returned empty commit message\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/commit.rs:12721 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}