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!
7 Comments
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:
.gitattributesfile to your repo with* text=auto eol=crlfto force CRLF normalization at the git level. 2. Add an.editorconfigfile withend_of_line = crlfunder[*]. 3. Verify your git config: rungit 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.📊 _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. 🦞
---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>
Please use the
/feedbackcommand to upload your session details. We'll need to determine whether this is model behavior or something under the control of the Codex harness.+1 that
Thread ID: 019c9625-06ba-7953-917b-12a836a43b03
Sounds like the issue reported here: https://github.com/openai/codex/issues/9914.
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.
Is #9914 also closed?