{"record":{"id":"c13ab85e2fa9d429","repo":"openai/codex","slug":"patch-detected-without-explicit-call-to-apply-patc","errorCode":null,"errorMessage":"patch detected without explicit call to apply_patch. Rerun as [\"apply_patch\", \"<patch>\"]","messagePattern":"patch detected without explicit call to apply_patch\\. Rerun as \\[\"apply_patch\", \"<patch>\"\\]","errorType":"exception","errorClass":"ApplyPatchError","httpStatus":null,"severity":"error","filePath":"codex-rs/apply-patch/src/lib.rs","lineNumber":111,"sourceCode":"        Ok(\"1\") => ApplyPatchFileUpdateMode::PreserveLineEndings,\n        _ => ApplyPatchFileUpdateMode::NormalizeToLf,\n    }\n}\n\n#[derive(Debug, Error, PartialEq)]\npub enum ApplyPatchError {\n    #[error(transparent)]\n    ParseError(#[from] ParseError),\n    #[error(transparent)]\n    IoError(#[from] IoError),\n    /// Error that occurs while computing replacements when applying patch chunks\n    #[error(\"{0}\")]\n    ComputeReplacements(String),\n    /// A patch path could not be resolved as a path URI.\n    #[error(transparent)]\n    PathUri(#[from] PathUriParseError),\n    /// A raw patch body was provided without an explicit `apply_patch` invocation.\n    #[error(\n        \"patch detected without explicit call to apply_patch. Rerun as [\\\"apply_patch\\\", \\\"<patch>\\\"]\"\n    )]\n    ImplicitInvocation,\n}\n\nimpl From<std::io::Error> for ApplyPatchError {\n    fn from(err: std::io::Error) -> Self {\n        ApplyPatchError::IoError(IoError {\n            context: \"I/O error\".to_string(),\n            source: err,\n        })\n    }\n}\n\nimpl From<&std::io::Error> for ApplyPatchError {\n    fn from(err: &std::io::Error) -> Self {\n        ApplyPatchError::IoError(IoError {\n            context: \"I/O error\".to_string(),","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/apply-patch/src/lib.rs#L93-L129","documentation":"Error \"patch detected without explicit call to apply_patch. Rerun as [\"apply_patch\", \"<patch>\"]\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/apply-patch/src/lib.rs:111 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":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}