Files not in worktree will show in `@` suggest list
What version of the Codex App are you using (From “About Codex” dialog)?
26.217.1959 (669)
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.2.0 arm64 arm
What issue are you seeing?
I created a PRD.md file in the project root directory and then switched to worktree mode in codex app, asking the agent to implement it.
The agent searched for a long time but couldn't find the file, and finally gave up.
According to this post that the agent can't read the file not in the worktree is expected behavior.
But it shows in the @ suggest list, I think this behavior is misleading. Files that the agent can't actually locate shouldn't be @-mentionable.
Upon entering a worktree, the app should either limit @ mentions to files within that worktree, or still allow mentions of files from the main directory by providing the agent with their absolute paths.
What steps can reproduce the bug?
- clone codex repo
- create an md in the root dir
- switch to worktree mode, @ the file and let it read it
<img width="972" height="696" alt="Image" src="https://github.com/user-attachments/assets/37327a51-9e83-4de7-9bab-bfef333e7145" />
<img width="972" height="299" alt="Image" src="https://github.com/user-attachments/assets/b3076ac8-eb68-4260-934b-6da92b011938" />
What is the expected behavior?
Upon entering a worktree, the app should either limit @ mentions to files within that worktree, or still allow mentions of files from the main directory by providing the agent with their absolute paths.
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗