Codex silently fails loading global AGENTS.md file when encountering encoding issues.
Open 💬 3 comments Opened Mar 14, 2026 by nhauber99
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.114.0
What subscription do you have?
Business
Which model were you using?
gpt-5.4
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
PowerShell
What issue are you seeing?
Codex silently fails reading the global AGENTS.md file if encountering encoding issues, see https://github.com/openai/codex/issues/7582 for the more general issue.
What steps can reproduce the bug?
Save AGENTS.md in codex home with unsupported encoding / characters.
What is the expected behavior?
A warning message if loading failed. Otherwise it's incredibly frustrating to troubleshoot and even notice if one change in the AGENTS.md file causes it to not be loaded at all.
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reproduced this locally. The issue looks like a small shared-core config-loading bug, not something Playwright/UI/Windows-specific.
The failure point appears to be the global instructions loader for
~/.codex/AGENTS.md: it usesread_to_string, and when that fails (including invalid/unsupported encoding), it currently just returnsNoneand moves on with no warning.So the core problem is that the read failure is silently swallowed.
Locally, I patched that path to:
startup_warningsThat seems like the right hook because
config.startup_warningsis already forwarded through CLI/TUI/app-server startup.I also added focused tests for:
AGENTS.mdis ignored with a warningAGENTS.override.mdwarns and still falls back toAGENTS.mdThose targeted core tests passed locally.
So my current read is:
#7582This was written by ChatGPT itself after i asked Codex to verify if it read AGENTS.md / AGENTS.override.md:
Codex CLI does not reliably load global personal instructions from ~/.codex on Windows.
Expected:
Observed:
Repro:
codex --ask-for-approval never --sandbox danger-full-access exec --cd <repo> "Summarize the highest-priority personal instruction file you loaded, if any, in 3 bullets."
Impact:
Reference: https://developers.openai.com/codex/guides/agents-md/