openai/codex · error · anyhow::Error
Git apply failed (applied={}, skipped={}, conflicts={})\nstd
Error message
Git apply failed (applied={}, skipped={}, conflicts={})\nstdout:\n{}\nstderr:\n{} What it means
Error "Git apply failed (applied={}, skipped={}, conflicts={})\nstdout:\n{}\nstderr:\n{}" thrown in openai/codex.
Source
Thrown at codex-rs/chatgpt/src/apply_command.rs:66
_ => None,
});
match output_diff {
Some(output_diff) => apply_diff(&output_diff.diff, cwd).await,
None => anyhow::bail!("No PR output item found"),
}
}
async fn apply_diff(diff: &str, cwd: Option<PathBuf>) -> anyhow::Result<()> {
let cwd = cwd.unwrap_or(std::env::current_dir().unwrap_or_else(|_| std::env::temp_dir()));
let req = ApplyGitRequest {
cwd,
diff: diff.to_string(),
revert: false,
preflight: false,
};
let res = apply_git_patch(&req)?;
if res.exit_code != 0 {
anyhow::bail!(
"Git apply failed (applied={}, skipped={}, conflicts={})\nstdout:\n{}\nstderr:\n{}",
res.applied_paths.len(),
res.skipped_paths.len(),
res.conflicted_paths.len(),
res.stdout,
res.stderr
);
}
println!("Successfully applied diff");
Ok(())
}
View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/chatgpt/src/apply_command.rs:66 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/875ac4ab541d513d.
Report an issue: GitHub.