Skip to content

[codex] fix apply_diff line endings#56

Merged
YMRYMR merged 8 commits intomainfrom
codex/apply-diff-crlf-fix
Apr 29, 2026
Merged

[codex] fix apply_diff line endings#56
YMRYMR merged 8 commits intomainfrom
codex/apply-diff-crlf-fix

Conversation

@YMRYMR
Copy link
Copy Markdown
Owner

@YMRYMR YMRYMR commented Apr 29, 2026

What changed

  • Normalize line endings in apply_diff before matching blocks
  • Preserve the file's original newline style when writing back
  • Add a CRLF regression test so Windows files patch correctly

Why

  • apply_diff was brittle when the diff text used LF but the target file used CRLF.
  • That made DeepSeek fall back to shell editing even when the diff was otherwise correct.

Validation

  • dotnet test .\Aire.Tests\Aire.Tests.csproj --filter "FullyQualifiedName~FileSystemServiceTests.ExecuteAsync_ApplyDiff|FullyQualifiedName~FileSystemServiceCoverageTests.ExecuteAsync_ApplyDiff" -v minimal
  • dotnet build .\Aire\Aire.csproj -c Debug -m:1

@YMRYMR YMRYMR merged commit 39924e6 into main Apr 29, 2026
6 checks passed
@YMRYMR YMRYMR deleted the codex/apply-diff-crlf-fix branch April 29, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants