Codex Desktop ignored pasted context and summarized unrelated AGENTS.md
What happened
In Codex Desktop, the user attached/pasted a conversation transcript and explicitly asked the agent to read it carefully. The agent immediately responded with unrelated repository workflow instructions from AGENTS.md instead of the pasted conversation context.
When the user corrected the agent, the agent then tried to validate the attachment by checking the generated pasted-text.txt file on disk and reported that it contained only 58 physical lines, with no content after line 240. That was a poor and misleading diagnostic because the pasted conversation consisted of long wrapped paragraphs; physical line count did not reflect how much user-visible context needed to be understood. The model treated that filesystem check as evidence that it had read the complete context, while the user-visible failure was that the agent had not meaningfully absorbed/summarized the supplied conversation.
Expected behavior
When a user explicitly asks Codex to read an attached/pasted context carefully, Codex should:
- prioritize the user-supplied pasted/attached content over ambient repository instructions when summarizing the requested context;
- avoid reporting unrelated
AGENTS.mdworkflow rules as the answer unless the user asked about repo workflow; - not use physical line count of
pasted-text.txtas a confidence signal for semantic completeness; - give a faithful summary of the actual pasted conversation or ask for clarification if the attachment boundary is ambiguous.
Actual behavior
The first response was almost entirely unrelated to the pasted conversation. It summarized repo worktree rules and only included one bullet related to the attached conversation.
After correction, the agent admitted it had only read an initial chunk, then stated that the attachment had only 58 lines and that later line ranges were empty. This further undermined trust because it focused on filesystem line count rather than the user-visible context failure.
Reproduction sketch
- In Codex Desktop, provide a pasted-text attachment containing a conversation transcript.
- Ask: "here is your context. read it carefully, token by token. take your time."
- Observe the agent answer with unrelated repo/AGENTS.md workflow constraints instead of the transcript content.
- Correct the agent by saying it skipped the rest of the conversation.
- Observe the agent use
wc -l/sedagainstpasted-text.txtand treat physical line count as evidence about context completeness.
Environment
- Codex Desktop / bundled CLI:
codex-cli 0.142.5 - macOS: 26.5.2 (Build 25F84)
- Model shown in app: GPT-5.5, Extra High reasoning
Impact
This is a high-trust context handling failure: the user explicitly asked the agent to carefully read supplied context, and the agent immediately substituted unrelated ambient instructions. The follow-up diagnostic made the failure worse by asserting completeness using an implementation detail of the pasted attachment file rather than addressing the semantic miss.
No logs or private transcript are attached here because this is a public issue.