Agent regresses JavaDoc and corrupts line endings during multi-file refactors

Hey, thanks for the detailed report.

About the doubled blank lines, this is a known issue we’re tracking. It shows up when the agent does a full-file rewrite on files with CRLF line endings on Windows. Each line break ends up with a duplicated carriage return, and you get a real blank line between lines of code on disk. The same symptom is described here: 161703 Agent Write tool inserts blank line between every line in file contents and 168205 Agent adding new lines. I added your report to what we’re already tracking. I can’t share an ETA yet, but I’ll post an update if I hear anything.

How to clean up an affected file:

  • Open the file, click the line ending indicator in the bottom-right corner of the status bar, switch to LF, and save. If your project needs CRLF, switch back after.
  • Or run your usual formatter on the file. That also removes the extra lines.
  • Just don’t ask the agent to fix this with regex passes on \n\n. That’s exactly what removed your legitimate blank lines.

About the removed JavaDoc and comments, that happens when the model chooses to rewrite the whole file instead of doing targeted edits, and it can lose comments in the process. Instructions in rules help, but they don’t guarantee the result. For larger refactors, it’s better to split the plan into smaller steps and review each file diff before you accept.

If you hit this again, please send the Request ID from the affected chat right-side chat context menu in the top-right corner > Copy Request ID. That’ll help us narrow down the details.