Skip to content

codex does not honor AGENTS.md in sub-folder #9836

@SunRunAway

Description

@SunRunAway

What version of Codex is running?

v0.89.0

What subscription do you have?

plus

Which model were you using?

gpt-5.1 high

What platform is your computer?

No response

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

codex does not honor AGENTS.md in /sub-folder

What steps can reproduce the bug?

mkdir -p testAGENTS/subdir && echo 'bob is a cat' > testAGENTS/subdir/AGENTS.md && cd testAGENTS && codex exec --skip-git-repo-check "directly write 111 into file subdir/test.txt and tell me whether bob is a cat immediately"                                                                                                                                                                                                 OpenAI Codex v0.89.0 (research preview)
--------
workdir: /Users/masked/code/testAGENTS
model: gpt-5.2
provider: openai-custom
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR, /Users/masked/[go/pkg/mod](https://www.golinks.io/pkg/mod?trackSource=github), /Users/masked/Library/Caches/go-build, /Users/masked/.cache, /Users/masked/.matplotlib] (network access enabled)
reasoning effort: high
reasoning summaries: auto
session id: 019bf308-af87-7550-99ee-47b379e37b38
--------
user
directly write 111 into file subdir/test.txt and tell me whether bob is a cat immediately
mcp startup: no servers

thinking
**Executing file operations**

I'm thinking through how to use `apply_patch` for adding or updating files, but there's the matter of creating directories first. From what I gather, `apply_patch` can’t create directories, so it might be wise to create the directory with a shell command first. I could do that with `exec_command`, then use `apply_patch` to add the file. After, I'll confirm with `cat`.

As for Bob, I can’t conclude if he's a cat based on the info I have!
exec
/bin/zsh -lc 'mkdir -p subdir && printf "111" > subdir/test.txt && wc -c subdir/test.txt && cat subdir/test.txt' in /Users/masked/code/testAGENTS succeeded in 52ms:
3 subdir/test.txt
111
codex
Wrote `111` to `subdir/test.txt`.

I can’t tell whether Bob is a cat from the information provided.
tokens used
2,271
Wrote `111` to `subdir/test.txt`.

I can’t tell whether Bob is a cat from the information provided.

What is the expected behavior?

No response

Additional information

thread ID 019bf308-af87-7550-99ee-47b379e37b38

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontextIssues related to context management (including compaction)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions