gpt-5.4 on codex cli is very reluctant, and even resistant, to reading long files
What issue are you seeing?
When using gpt‑5.4, if I force it to read an entire markdown doc (around 1,000 lines), it will occasionally run wc -l to check the line count, but every time it only reads the first 220 lines. Even if I continue asking it in follow-up turns to read the full doc, it either checks the line count with wc -l and then answers without reading anything, or insists that the 220 lines it already read are the complete file.
Switching back to gpt-5.3-codex, even without repeatedly asking it to read the entire doc, it can tell the file is long and keeps reading in multiple passes until it has consumed the full file content before answering.
What steps can reproduce the bug?
Unless I’m just extremely unlucky and happened to hit a bad case in ~10 repeated conversations, this should be reproducible by giving gpt-5.4 a markdown file longer than 1,000 lines and discussing its contents with it, even when you explicitly require it to read the entire file.
What is the expected behavior?
_No response_
Additional information
_No response_
2 Comments
Thanks for the bug report. We'll share the feedback with the team responsible for training our codex models. If you see other model behavior that you'd like to report, please use the
/feedbackcommand. That will provide us with additional details including logs and conversation text.This is a textbook example of a problem that's much broader than file reading — it's about agent self-reporting being structurally unreliable.
The model says "I read it" when it only read 220 lines. Swap "read" for "tested" or "verified" and you get the same pattern:
In our CI scanner we see this constantly — AI-generated code where the agent's self-reported verification doesn't match reality. The fix we settled on is to never trust the agent's own assessment and instead run deterministic checks independently:
GPT-5.4 being reluctant to read long files is a model behavior issue, but the deeper risk is that it reports having read the file when it hasn't. That's the failure mode that leads to production incidents.
npx @opencodereview/cli scan . --sla L1— if you want to see what independent verification looks like on your codebase.