Codex IDE restores chat history with a stale workspace root and silently edits files in the old project

Open 💬 1 comment Opened Jul 11, 2026 by zplincuhk

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?

  1. Open Project A in the IDE and start a Codex conversation.
  2. Work with a file that uses a common relative path, such as src/main.cpp.
  3. Close or switch away from Project A.
  4. Open Project B, which contains a file with the same relative path.
  5. Restore or continue the Codex conversation created in Project A.
  6. Ask Codex to inspect or modify the active file shown by the IDE.
  7. 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_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗