{"record":{"id":"fa56078a15990d28","repo":"tinyhumansai/openhuman","slug":"git-command-failed-stderr","errorCode":null,"errorMessage":"Git command failed: {stderr}","messagePattern":"Git command failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/filesystem/git_operations.rs","lineNumber":101,"sourceCode":"\n    /// Check if an operation is read-only\n    fn is_read_only(&self, operation: &str) -> bool {\n        matches!(\n            operation,\n            \"status\" | \"diff\" | \"log\" | \"show\" | \"branch\" | \"rev-parse\"\n        )\n    }\n\n    async fn run_git_command_in(&self, cwd: &Path, args: &[&str]) -> anyhow::Result<String> {\n        let output = tokio::process::Command::new(\"git\")\n            .args(args)\n            .current_dir(cwd)\n            .output()\n            .await?;\n\n        if !output.status.success() {\n            let stderr = String::from_utf8_lossy(&output.stderr);\n            anyhow::bail!(\"Git command failed: {stderr}\");\n        }\n\n        Ok(String::from_utf8_lossy(&output.stdout).to_string())\n    }\n\n    async fn git_status(&self, cwd: &Path, _args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let output = self\n            .run_git_command_in(cwd, &[\"status\", \"--porcelain=2\", \"--branch\"])\n            .await?;\n\n        // Parse git status output into structured format\n        let mut result = serde_json::Map::new();\n        let mut branch = String::new();\n        let mut staged = Vec::new();\n        let mut unstaged = Vec::new();\n        let mut untracked = Vec::new();\n\n        for line in output.lines() {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/filesystem/git_operations.rs#L83-L119","documentation":"The spawned git process completed but exited non-zero; this message wraps git's own stderr as the failure reason. It reports a repository-level problem (bad revision, nothing to commit, merge conflict, missing object), not a failure to launch git.","triggerScenarios":"Thrown at src/openhuman/tools/impl/filesystem/git_operations.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded git stderr to identify the failing operation","For 'nothing to commit' stage changes first or skip the commit","For bad revisions or conflicts, verify branch names and resolve the repository state before retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}