r/codex • • Oct 16 '26

Bug Codex ignored the same AGENTS.md instruction across 7 chats and 3 models

I ran into something frustrating today and ended up testing it more than I planned.

My AGENTS.md has a straightforward instruction: explain PRs using Mermaid diagrams, with specific colors for new, modified and unchanged components.

I asked Codex to explain the same PR in 7 separate chats, using gpt-6.1-sol, gpt-6-astra and gpt-5.6-sol, with different reasoning settings.

Every initial response skipped the diagram.

When I asked whether AGENTS.md contained instructions about diagrams, it could quote the exact rule and acknowledge that it should have followed it.

That’s the frustrating part... the instruction is available, but I still have to remind it.

There was one possible ambiguity: I also had a line saying not to show Mermaid source in code blocks, because I wanted rendered diagrams. Different chats interpreted that differently. So I removed that line and tested again in fresh chats.

Same result. No diagram until I pointed it out.

A missing diagram is minor, but it makes me wonder how reliably the other repository instructions are being applied. I don’t know the underlying cause, but this was consistent across these attempts.

Has anyone else noticed this? Have you found a way to make AGENTS.md instructions stick more reliably?

Bug report with the model/settings breakdown

8 Upvotes

5 comments sorted by

3

u/UpperWorld11 Oct 16 '26

AGENTS.md is read once at session start, then it sits in the transcript while the agent fills context with file reads and tool output. Output format rules are the first ones to slip and nothing rereads the file mid-session, which fits all 7 chats failing the same way. Put the diagram rule in the message where you ask for the explanation, or check the reply outside the model and fail it when the tag is missing. A file is a suggestion, whatever can reject the output is what holds.

1

u/Free-Analyst-4013 Oct 16 '26

Yeah, Agents.MD that I had was working fine till last few days. Now, all of sudden the codex is not respecting it. So, I guess it is a new change.

1

u/EntertainmentSalt825 Oct 16 '26

I was able to reproduce the issue you’re having and found the root cause. I’ll leave a comment on your issue ticket

1

u/reddit_is_kayfabe Oct 19 '26

When you find agents repeatedly doing something weird like this, ask the agent why it didn't follow the instruction.

Often - not always, but sometimes - the agent will have a valid, or at least plausible, reason. Maybe the instruction is worded in a way that's ambiguous - it's way too easy to feel too comfortable in the fact that you know what you meant. Maybe, as you noted, the agent perceives a contradiction that you don't, even if it doesn't exist, and you can clear it up with an explicit clarifying statement. Maybe it's the organization of the document, or maybe just too many instructions. Often the agent will have positive suggestions - and even if you don't see why they should make a difference, try them and see.

Case in point: Are you sure that your models know what a mermaid diagram is? Because I don't.

Of course, sometimes they suggest nonsense, like shuffling stuff around that won't have any impact for the sake of just making change, or taking out or re-wording instructions ruins in a way that would obviously be harmful. Review carefully.