[Windows][Codex Desktop] Existing task retains deleted workspace path after project folder is moved
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
On Windows, an existing Codex Desktop task keeps its original workspace path after the project directory is moved or renamed outside Codex. Restarting the desktop application restores the same task with the stale path instead of detecting that the workspace moved or asking the user to select its new location.
This leaves the task in a partially functional state:
- commands without an explicit working directory fail because the persisted cwd no longer exists;
- commands with an explicit new working directory can still run;
- file inspection, builds, and tests may work against the new directory;
- the managed patch editor rejects files in the new ordinary directory with a misleading
path contains a reparse pointerror; - restarting the application does not repair or rebind the task.
No repository, username, private path, credentials, or project-specific content is included in this report.
Environment
- Surface: Codex Desktop
- Platform: Windows x64
- OS family observed: Windows 10
- Workspace type: local directory
- Date observed: 2026-08-31
- The old and new directories were on the same local NTFS volume.
- Neither project directory was intended to be a symlink or junction.
Steps to reproduce
- Open a local project directory in Codex Desktop, for example:
D:\Workspace\OldProjectName - Start a task and perform normal file/build operations.
- Move or rename the project directory outside Codex:
D:\Workspace\OldProjectName→D:\Workspace\NewProjectName - Continue the existing task.
- Restart Codex Desktop and reopen the same task.
- Ask the task to run a command without an explicit working directory.
- Ask it to edit a file under the new directory using the managed patch mechanism.
Actual behavior
The task remains bound to the deleted original path.
A command using the task default cwd fails before the shell starts:
CreateProcessAsUserW failed: 267 (The directory name is invalid.)
cwd=D:\Workspace\OldProjectName
When an explicit workdir=D:\Workspace\NewProjectName is supplied, shell commands can read, build, and test the moved project successfully.
However, the managed patch operation against a normal file under the new directory fails with:
Failed to read file to update D:\Workspace\NewProjectName\README.md:
path contains a reparse point
Independent filesystem inspection shows that the new project directory and its parents are ordinary directories, not reparse points.
Restarting the application restores the same stale workspace binding. Repeated restarts do not prompt for the new location and do not update the task cwd.
Expected behavior
When reopening an existing task whose workspace path no longer exists, Codex Desktop should:
- detect the missing workspace before starting tool execution;
- offer to locate/rebind the moved project;
- validate and persist the newly selected canonical path;
- update the task cwd and managed filesystem scope together;
- distinguish an out-of-workspace path from an actual symlink/junction/reparse point;
- avoid restoring the task into a partially functional state.
If automatic rebinding is unsafe, the task should fail closed with an actionable message such as:
The original workspace no longer exists. Select the project's new location or create a new task.
Impact
Long-running tasks lose practical continuity after a legitimate local project rename or product rebranding. Users can still run some explicit-workdir commands, which makes the task appear usable, but managed edits remain blocked and error messages incorrectly suggest filesystem indirection.
This can also leave the old directory locked while the task is open, complicating cleanup and making diagnosis confusing.
Suggested hardening
- Persist a stable workspace identity in addition to the raw path where possible.
- On resume, verify that the canonical workspace exists before restoring the task.
- Add an explicit Rebind workspace action for existing tasks.
- Update command cwd, sandbox roots, trust state, file-edit scope, watchers, and UI project metadata atomically.
- Report separate errors for:
- missing original workspace;
- path outside the authorized workspace;
- actual reparse point;
- stale watcher or task binding.
- Add a Windows integration test covering same-volume directory rename followed by app restart and task resume.
Workaround
Create a new Codex task opened directly on the renamed project directory. Restarting the existing task or application is not sufficient.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing existing-task resume after app restart, including the persisted workspace path, task cwd, and managed patch scope on Windows. Reproduce the same-volume directory rename from OldProjectName to NewProjectName, then add the suggested Windows integration test and verify that resume rebinds the workspace or returns an actionable missing-workspace error without reporting a false reparse point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100