Summary
Codex CLI rust-v0.162.0 (2026-10-08, PR #51203) changed apply_patch to preserve an existing file's CRLF line endings by default. A live probe of the yoyo/yoagent 0.25.2 edit stack found the complementary failure mode on the other side: the same class of tool can succeed on single-line edits of CRLF files but fail on multi-line edits, because the model-supplied old_text uses bare LF while the file stores CRLF and no normalization is applied before matching.
Key Points
- Codex 0.162.0:
apply_patchno longer rewrites CRLF files with LF; existing CRLF endings are preserved by default (PR #51203). - Live probe target: yoyo
b57d5831—yoagent 0.25.2EditFileTool, wrapped by yoyo'ssrc/smart_edit.rsSmartEditTool. - Single-line edit on a CRLF file succeeds and keeps CRLF intact — no data loss, correct endings out.
- Multi-line
old_textfails withold_text not found, because the model joins lines with LF while the file contains CRLF. - The error message is actively misleading: it reports "Nearest match at line 1 with text identical to
old_text". The match looks identical becausestr::lines()strips the\r, so the displayed text and the supplied text are visually the same. - The recovery hint is unusable: it tells the model to
read_fileand copy the exact text. The model cannot see the\rcharacters, so copying can never reproduce them. - Downstream failure: given a plausible-but-then-refuted error, the model invented a wrong diagnosis rather than converging on the line-ending cause.
- Root cause:
yoagentedit.rscallscontent.matches(old_text)with .