Codex IDE restores chat history with a stale workspace root and silently edits files in the old project
What version of the IDE extension are you using?
Version: 26.707.41301
What subscription do you have?
gpt plus
Which IDE are you using?
vscode
What platform is your computer?
ubuntu20.04
What issue are you seeing?
When I restore an existing Codex conversation after switching projects, the conversation history and current IDE file context are restored, but Codex remains bound to the previous workspace directory.
The IDE showed a file from the current project, while Codex silently resolved its relative path against the old workspace. It then read and modified files in the old project without warning.
This creates a serious risk of silently editing the wrong version of a project. Codex should validate the IDE workspace root when restoring a conversation, block writes when the workspace has changed, and clearly display the target project before modifying files.
What steps can reproduce the bug?
- Open Project A in the IDE and start a Codex conversation.
- Work with a file that uses a common relative path, such as
src/main.cpp. - Close or switch away from Project A.
- Open Project B, which contains a file with the same relative path.
- Restore or continue the Codex conversation created in Project A.
- Ask Codex to inspect or modify the active file shown by the IDE.
- Observe that the IDE context refers to Project B, while Codex may still use Project A as its workspace root and modify files there without warning.
What is the expected behavior?
_No response_
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗