What version of Codex is running?
codex-cli 0.27.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
AI_GENERATED_CONTENT_DISCLAIMER :)
codex-bug-workspace-mismatch.md
What is the expected behavior?
Expected Behavior
After a user asks to "set workspace" (or otherwise selects a workspace), all subsequent write operations should target that workspace consistently, not the session CWD.
Alternatively, the agent should be required to choose a single active workspace and all tools should use it implicitly.
If multiple projects are trusted and the agent is about to write relative to a different workspace than referenced by recent reads or user instruction, Codex CLI should warn and ask for confirmation.
What do you see instead?
Actual Behavior
apply_patch writes to the session CWD, ignoring the user's requested workspace and the read workdir used by the agent, leading to edits in the wrong repo.
Additional information
it's all in the doc codex made :)
What version of Codex is running?
codex-cli 0.27.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
AI_GENERATED_CONTENT_DISCLAIMER :)
codex-bug-workspace-mismatch.md
What is the expected behavior?
Expected Behavior
After a user asks to "set workspace" (or otherwise selects a workspace), all subsequent write operations should target that workspace consistently, not the session CWD.
Alternatively, the agent should be required to choose a single active workspace and all tools should use it implicitly.
If multiple projects are trusted and the agent is about to write relative to a different workspace than referenced by recent reads or user instruction, Codex CLI should warn and ask for confirmation.
What do you see instead?
Actual Behavior
apply_patch writes to the session CWD, ignoring the user's requested workspace and the read workdir used by the agent, leading to edits in the wrong repo.
Additional information
it's all in the doc codex made :)