AGENTS.md is loaded but not reliably followed in the unified desktop experience

Open 💬 2 comments Opened Jul 19, 2026 by pchalamet
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

Observed in the unified ChatGPT/Codex desktop experience with local runtime versions:

  • 0.144.2
  • 0.145.0-alpha.18

The affected sessions used gpt-5.6-sol with medium reasoning on macOS.

What happened?

Repository-level AGENTS.md files are still discovered and loaded, but their instructions are no longer followed reliably.

This is specifically not an AGENTS.md discovery problem. Inspection of local session rollout records confirms that:

  • the task working directory is the correct Git repository;
  • the file is located at the Git root;
  • there is no competing AGENTS.override.md;
  • the files are non-empty and well below the default 32 KiB combined limit;
  • the complete file appears in the initial task context under # AGENTS.md instructions for ....

Despite that, applicable and explicit rules are intermittently omitted until the user says something like “read AGENTS.md” and repeats the requirement. After the reminder, Codex generally complies.

The behavior became noticeably unreliable after moving to the unified ChatGPT/Codex desktop experience around the July 2026 rollout. Newer task records contain a substantially larger instruction/context stack, with repository guidance embedded in a combined user-context block after several developer instruction blocks. That prompt-layout change may or may not be causal; the verified regression is that loaded repository instructions are not applied consistently.

Steps to reproduce

  1. At the root of a Git repository, create a non-empty AGENTS.md containing clear completion requirements, for example:
  • update an Unreleased changelog entry for applicable changes;
  • run a named validation command;
  • follow a specific repository organization rule.
  1. Start a fresh task in that repository using the unified desktop app.
  2. Request an implementation without repeating the AGENTS.md rules in the task prompt.
  3. Let Codex complete the change.
  4. Inspect the resulting diff, validation performed, and local rollout record.
  5. Confirm that the rollout contains the complete automatically injected AGENTS.md.
  6. If a rule was omitted, tell Codex to read AGENTS.md; it will often then identify and perform the missing work.
  7. Repeat across fresh tasks. The failure is intermittent but frequent enough that durable repository guidance cannot be trusted.

Expected behavior

Applicable AGENTS.md instructions should be treated as binding repository policy throughout the task, including during final verification. Users should not need to repeat those instructions in every prompt.

If a later direct user instruction conflicts with AGENTS.md, the later instruction can take precedence, but absent such a conflict the repository policy should be followed consistently.

Actual behavior

The file is present in context, but rules can be silently omitted. The task may be declared complete without satisfying required changelog, validation, documentation, or repository-organization steps.

Explicitly reminding Codex to read the already-loaded file often fixes the omission, which further indicates an adherence/salience failure rather than file discovery failure.

Investigation performed

I audited local task metadata and rollout records across multiple repositories, without relying on model recollection:

  • verified Git roots and task working directories;
  • verified file placement, size, and lack of overrides;
  • verified the full AGENTS.md text was automatically injected;
  • compared task behavior before and after the unified-app transition;
  • found repeated post-transition user reminders to read the already-injected file;
  • also found occasional successful compliance, so the problem is intermittent rather than total loading failure.

No repository names, paths, source code, or proprietary instruction contents are included in this report.

Consequences

This undermines the main purpose of AGENTS.md as durable repository guidance:

  • users must manually repeat policy in ordinary task prompts;
  • required validation can be skipped;
  • changelog and documentation requirements can be missed;
  • repository structure and engineering conventions can be violated;
  • CI may fail only after the work is committed or pushed;
  • the final response can incorrectly claim completion;
  • trust in unattended or long-running Codex tasks is significantly reduced.

A policy file that is loaded but only intermittently obeyed is operationally equivalent to an unreliable policy mechanism.

Suggested resolution

  • Preserve repository guidance as a dedicated, high-salience instruction layer rather than burying it in a large combined context block.
  • Add a deterministic pre-final compliance pass against applicable AGENTS.md requirements.
  • Keep the instruction chain available across compaction, continuations, and subagent handoffs.
  • Expose which instruction files were loaded and whether their requirements were checked.
  • Add regression tests using large unified-app prompt stacks where repository instructions impose explicit completion gates.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #33070
  • #33331

Powered by Codex Action

vlastimilvajnorak · 9 days ago

Additional reproduction: PR completion gates are silently skipped

I am seeing the same class of failure in the unified Codex desktop app on Windows, with an especially high-impact PR workflow.

The applicable global AGENTS.md instructions were present in the task context and explicitly required:

After opening a pull request, wait for CI and automated/code review to complete. Do not report the task as finished merely because the PR exists.

They also required the agent to address every actionable review comment or open question, reply with how it was resolved, resolve the associated review thread, rerun relevant tests, push follow-up commits, and repeat until CI is green and no actionable feedback remains.

There was no later user instruction overriding these requirements.

Actual behavior

Intermittently, Codex still treats one of these intermediate states as completion:

  • the ready-for-review PR exists, but CI or automated review is still pending;
  • CI is green, but automated review has not completed;
  • review comments exist, but thread-level unresolved state was not inspected;
  • a review fix was pushed, but CI/re-review for the new HEAD was not awaited.

The final answer then presents the implementation as complete. When challenged about why the instructions were ignored, the agent recognizes the omission and proposes the missing gate itself: before saying "done," verify green CI, zero unresolved threads, review after the latest push, and mergeability. This strongly suggests a finalization/compliance failure rather than an ambiguous rule.

Expected behavior

For a PR created or updated by the task, Codex must not emit a successful terminal answer until all requirements apply to the current HEAD SHA:

  1. required CI is complete and green;
  2. configured automated review has completed;
  3. all actionable comments/open questions have been addressed;
  4. all associated review threads are resolved;
  5. after every follow-up push, CI and required review are checked again;
  6. the PR is mergeable and has no blocking review state.

If an external reviewer never responds or permissions prevent reading/resolving threads, the task should report a precise blocker instead of success.

Suggested regression test

Model a PR through these states:

  1. PR open, CI pending;
  2. CI green, review pending;
  3. review complete with one unresolved actionable thread;
  4. fix pushed, making previous checks/review stale;
  5. new-head CI and re-review complete, unresolved threads = 0.

The agent should continue waiting/working through states 1-4 and only be allowed to return a successful completion in state 5. The test should also run across context compaction, because long CI/review waits make compaction likely.

This is more serious than a style-rule omission: it can incorrectly certify unreviewed or known-problematic code as completed and ready to merge.

Environment: unified Codex desktop app on Windows. I could not reliably retrieve the exact app/runtime version during this report because the local Windows sandbox helper repeatedly failed before process startup with helper_unknown_error: setup refresh had errors; I am omitting the version rather than guessing. No private repository names, paths, source code, or credentials are included here.