VS Code extension: wrong working directory after automatic context compaction
What version of the IDE extension are you using?
26.304.20706
What subscription do you have?
Plus
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
After automatic context compaction in the VS Code extension, Codex appears to switch to the wrong working directory.
Expected workspace/cwd:C:\projects\roly-poly
Observed after compaction:C:\projects\poly
I see evidence in responses such as:
"I'm in c:\projects\poly and that script path isn't present here, so I'll locate the equivalent..."
If this is not caught immediately by the user, Codex can continue operating against a different folder entirely. It may run scripts/tools and resolve local paths using the wrong directory prefix, which can cause unintended file access/edits and incorrect command execution.
After this happens, path resolution fails or Codex starts looking for files in the wrong location.
What steps can reproduce the bug?
- Open VS Code workspace at
C:\projects\roly-poly. - Start/continue a Codex thread and work long enough for automatic context compaction to occur.
- Continue in the same thread.
- Observe Codex behavior/messages indicating cwd has changed to
C:\projects\poly.
What is the expected behavior?
CWD/workspace context should remain pinned to C:\projects\roly-poly across automatic context compaction.
Additional information
- Thread ID:
019ca480-8b20-7531-b24e-0c77db4588f9 - I already submitted
/feedbackfor this. - Possible clue: path includes a hyphen (
roly-poly), and truncation may be related. - Related issues that seem similar but not exact:
- #11757 (rehydrate stale workspace instructions)
- #5957 (compaction-related context drift)
- #4222, #7281, #9989 (extension cwd/workspace mismatch in related flows)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗