From ee5ecae7c0915ac8f478703a1171eae62d0059e3 Mon Sep 17 00:00:00 2001 From: Jeremy Rose <172423086+nornagon-openai@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:27:50 -0700 Subject: [PATCH] tweak "failed to find expected lines" message in apply_patch (#3374) It was hard for me to read the expected lines as a `["one", "two", "three"]` array, maybe not so hard for the model but probably not having to un-escape in its head would help it out :) Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> --- codex-rs/apply-patch/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codex-rs/apply-patch/src/lib.rs b/codex-rs/apply-patch/src/lib.rs index 18d3bd4d..1fdd6928 100644 --- a/codex-rs/apply-patch/src/lib.rs +++ b/codex-rs/apply-patch/src/lib.rs @@ -726,9 +726,9 @@ fn compute_replacements( line_index = start_idx + pattern.len(); } else { return Err(ApplyPatchError::ComputeReplacements(format!( - "Failed to find expected lines {:?} in {}", - chunk.old_lines, - path.display() + "Failed to find expected lines in {}:\n{}", + path.display(), + chunk.old_lines.join("\n"), ))); } }