AGENTS.md is not resolved per repository in multi-root workspaces
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.803.10989.0
What subscription do you have?
ChatGPT subscription with Codex access (behavior appears tier-independent)
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
In a Codex Desktop workspace containing multiple Git repositories, only the AGENTS.md instructions for the initial working directory are loaded. Codex can still edit files in other attached repositories without first loading their own AGENTS.md files.
This is silent: the secondary repository is visible and writable, but neither the user nor the agent is warned that its repository-specific instructions are missing.
What steps can reproduce the bug?
- Add two Git repositories, each with a different AGENTS.md, to one Codex workspace.
- Start a task with repository A as the working directory.
- Ask Codex to make related changes in repositories A and B.
- Observe that Codex can change repository B without automatically loading or following repo-b/AGENTS.md.
The same problem can occur with nested repositories, but nesting is not required.
What is the expected behavior?
Before Codex works on a path, it should discover and apply the AGENTS.md chain governing that path's repository. When work crosses into another repository, Codex should update the active instructions before reading, modifying, testing, committing, deploying, or delegating work there.
If discovery fails, Codex should block the operation or warn clearly. Instructions may be loaded lazily; they do not all need to occupy the prompt at once.
Additional information
- Related: https://github.com/openai/codex/issues/26338
- Related: https://github.com/openai/codex/issues/27943
- Nested-repository case: https://github.com/openai/codex/issues/30789
- Reproduction is sanitized; no proprietary repository details are included.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with two Git repositories in one Codex workspace, using distinct AGENTS.md files and crossing from repository A into B. Trace how AGENTS.md instructions are discovered and applied when the active path changes, including nested repositories. Done means repository-specific instruction chains are refreshed before work in each repository, with a clear warning or blocked operation when discovery fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100