Agent does not read AGENTS.override.md
See thread ID 019c5dec-2c1e-7a60-a6ad-c454f62c468a
I have have ~/.codex/AGENTS.md which is read.
The current project has as project root (the git root) $REPOBASE
and $REPOBASE/AGENTS.override.md exists.
Isn't the CLI responsible for feeding the agents these files?
In the above conversation chatgpt-codex-5.3 said it had (indeed) not read that file (after it read it).
This is $REPOBASE/AGENTS.override.md we are talking about!
I suppose you want to consider the rest as model behavior, but I think we need CLI support for this:
all "AGENTS.md" instructions apparently need to be fed to the model as "developer/system" message,
which is done by the CLI.
My instructions need to be dynamically generated because I can't rely on the model to follow instructions that mimic this dynamic generation from static files; and now it turns out that you can't even chain AGENTS.md files with the VERY CLEAR command: read this file next: ...
If even that doesn't work - then we need to be able to generate ALL instructions as one blob of text and have the CLI feed that to the model as-if it is the one and only AGENTS.md file.
9 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Not a duplicate; this issue is way more severe (not reading /AGENTS.override.md as opposed to subdirectories) and it is a suggestion to fix this once and for all by adding the possibility to inject text into the CLI that then will be represented to the model as genuine AGENTS.md text.
For details about how this works, refer to this documentation.
When the harness injects the contents of the AGENTS files, it doesn't provide the model with the path to these files, so the model won't know where the details came from. So if you ask the model whether it read these files, it will likely say no.
You can verify that the hardness read the files by looking at the session rollout file under
~/.codex/sessions/.This 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/
I had forgotten about this issue and was made aware of it again after @gimlichael added comment.
I'm sorry for @gimlichael but I'd like to close this issue because at the time I wrote this I had no idea whatsoever how this is supposed to work. If I ever notice a problem in the future related to AGENTS.md / AGENT.override.md with my current knowledge then I'll write a new issue.
Here is what I understand now: all AGENTS.md (or AGENTS.override.md if that exists) are added to a system prompt every turn again. The files included depend on the current directory at that moment (turn) and the root of the project. If you ask chatgpt about it, it is very possible that it answers wrongly as it often hallucinates not having seen "AGENTS.md" files by path: it NEVER uses the Read tool to read them - those files are provided as part of a system prompt, so you probably can't rely on what it says. The correct way to test if an AGENT.md file makes it is by adding explicit instructions to the AGENTS.md file itself along the lines of: "If you see this text then add 'I saw the text of path/AGENTS.md' to the next reply. It is important you do that."
Thanks for the hint, @CarloWood - its really frustrating how it then may choose to ignore this system prompt altogether. Haha.
I do think its an issue - at least Codex is never outputting the text .. and does not behave as it read it. GPT 5.4 is .. an odd construct. For coding I am not impressed .. sadly, Opus is to expensive, but superior to this model. Thanks anyway.
Well, this issues here are only for the Codex CLI (the related github repository). If the CLI catenates the right files and sends them as a system prompt to the model then that is all it can do. I switched to opencode by the way, because I think they have more options to change the CLI without having to maintain branches that constantly collide with upstream changes, through the use of plugins. For example it is possible to write a plugin that reads and optionally changes the system prompt, and logs the result to a file - all without needing to make changes to the upstream code. To be honest, I am not even sure that that is not possible with Codex - does this project also support plugins?
Not sure .. I am trying to get acquainted with as many CLIs as possible. I have yet to discover the perfect tool OpenCode is horrible on the Windows platform and VSCode - here Codex shines (if you look aside from the inferior model compared to Opus 4.6). That is why it is so vital to have a system prompt; to correct some of the obvious flaws in GPT 5.4.
GitHub Copilot CLI also has potential - its just to new so LOTS of UI/UX inconveniences here as well. I might try PI or T3 code when that is more mature; the latter probably has potential to be the only one in my stack .. but way to "young" right now.
Happy vibing 🦾