Codex always breaks Windows EOL (replaces with newline EOL)

Resolved 💬 7 comments Opened Feb 28, 2026 by DRNadler Closed Mar 29, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

This is on Windows. Gave it specific instructions NEVER to change EOL. Huge amount of flailing about with Powershell scripts, script errors, always wrong result.

Really now!

This is a SERIOUS PITA!

View original on GitHub ↗

7 Comments

sstklen · 4 months ago

Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.

What's happening: This happens when Codex's file-writing mechanism outputs LLM-generated text directly to disk without normalizing line endings to the host OS convention (Windows CRLF). The tool does not respect Windows EOL regardless of user instructions in the prompt, because the conversion needs to happen at the tool layer, not the model layer.

What worked for us:

  1. Add a .gitattributes file to your repo with * text=auto eol=crlf to force CRLF normalization at the git level. 2. Add an .editorconfig file with end_of_line = crlf under [*]. 3. Verify your git config: run git config --global core.autocrlf true. 4. After each Codex edit, you may need to run a post-fix pass to restore CRLF. 5. Report this to the Codex maintainers — this is a vendor-side bug that needs a proper fix in the write tool layer.
# .gitattributes
* text=auto eol=crlf

# .editorconfig
root = true

[*]
end_of_line = crlf
charset = utf-8

# Git config
git config --global core.autocrlf true

📊 _We found 3 similar cases in our knowledge base with the same pattern — this gives us high confidence in this analysis._

If this doesn't quite fit your case, drop a comment and I'll take another look. 🦞

_Disclosure: This analysis is from Confucius Debug, an AI-powered community KB for agent bugs. Please verify before applying._

---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>

etraut-openai contributor · 4 months ago

Please use the /feedback command to upload your session details. We'll need to determine whether this is model behavior or something under the control of the Codex harness.

abdes · 4 months ago

+1 that

DRNadler · 4 months ago

Thread ID: 019c9625-06ba-7953-917b-12a836a43b03

chausner · 4 months ago

Sounds like the issue reported here: https://github.com/openai/codex/issues/9914.

etraut-openai contributor · 3 months ago

Thanks for the bug report. We'll share the feedback with the team responsible for training our codex models. We're tracking this feedback and similar reports so we can improve future models.

DRNadler · 3 months ago

Is #9914 also closed?