You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agent file diffs and edits mishandle Windows (CRLF) line endings since #4864 #4871
On any Windows-style (CRLF) file, the agent's file-diff preview now shows every line as deleted and re-added, so a one-line change looks like a full rewrite and the added/removed counts are wrong. Edits have a related gap: when the text to replace matches as-is, the replacement is spliced in with the model's LF endings, leaving a CRLF file with mixed line endings. This came in with #4864, which started reading files with their original endings but only converts the model's text on one edit path.
🔍 Evidence and locations
Severity: 🟠 medium Lens: correctness Auto-fixable: yes — apply bug to let auto-fix open the PR
Reads the original with open(..., newline="") (CRLF kept), then diffs original_content.splitlines(keepends=True) against the model's LF new_content. Every line differs. Before c5c9141 it read with universal newlines, so both sides were LF. A diff isn't a write round trip, so reading exactly gains nothing here.
new_content = _retarget_newlines(new_content, current_content) only runs inside the if not offsets: retry branch. When old_content matches directly (e.g. a single-line old_content), a multi-line LF new_content is inserted unchanged into a CRLF file.
Not acting on this? Close it with the audit-wontfix label and the audit will never re-file it. Applying bug instead hands it to the existing auto-fix job.
Activity