I was getting a bug in the Windows desktop app this morning when trying to create a work chat under a project folder. It returned “could not use this project for a local chat”
I had ChatGPT itself look at the project folder.
The error appears to be in Windows: local Work chat creation fails because node_repl.exe locks the ChatGPT project mirror.
If anyone encounters the same problem they can look at this. Other processes may cause the same issue.
Summary
On Codex desktop for Windows, creating a local Work chat from an existing ChatGPT project repeatedly failed with:
Could not use this project for a local chat
The desktop log recorded:
ChatGPT project context sync failed
stage=filesystem
sourceCount=0
syncFileCount=0
The project data was not corrupt. The bundled node_repl.exe MCP process held an open Windows directory handle to the project’s local mirror:
%USERPROFILE%\.codex\.chatgpt-projects\<project-id>
Codex synchronizes project context by building a staging directory and rotating the active mirror using directory renames. Windows rejected that rename while node_repl.exe had inherited the project mirror as its working directory.
Environment
-
Windows 10 Pro 22H2, build
19045.6466 -
Codex desktop production Win32 release
26.820.71523 -
Bundled Node runtime
v24.19.0 -
Browser and Computer Use bundled capabilities enabled
-
Existing ChatGPT project with zero synchronized source files
Reproduction
-
Open Codex desktop on Windows.
-
Select an existing ChatGPT project.
-
Attempt to create a new local Work chat.
-
Allow the task runtime and bundled MCP helpers to initialize.
-
Codex attempts to synchronize and rotate the project mirror.
-
The UI reports “Could not use this project for a local chat.”
-
The log reports
stage=filesystemwithout the failing path, operation, Windows error code, or lock-holder information.
The failure survived project-cache rebuilding and application restarts.
Expected behavior
Codex should synchronize the ChatGPT project and create the local Work chat. Bundled helper processes should not prevent replacement of the local project mirror.
Actual behavior
The active mirror could not be renamed:
The process cannot access the file because it is being used by another process.
Codex then displayed the generic local-chat error.
Confirmed findings
Windows Resource Monitor identified node_repl.exe as holding the project-mirror path. This recurred under different PIDs after retries and restarts, including PIDs 16328, 15660, 16512, and 27876.
The result was isolated repeatedly:
-
With the identified process running, a reversible rename of the mirror root failed with
System.IO.IOException. -
Stopping only the identified PID caused the same rename to pass immediately.
-
Other
node_repl.exeinstances that were not using this mirror could remain running. -
Restarting Codex created another lock-holding instance and reproduced the failure.
The generated configuration contained:
[mcp_servers.node_repl]
args = []
command = '...\cua_node\...\bin\node_repl.exe'
startup_timeout_sec = 120
It did not specify a working directory, so the helper inherited the task/project directory.
Codex officially supports mcp_servers.<id>.cwd for setting an MCP stdio server’s working directory. However, manually adding it was not persistent: Codex regenerated the node_repl section during restart and removed the setting.
Successful diagnostic mitigation
After Codex had started:
- Add a stable working directory outside all project mirrors:
[mcp_servers.node_repl]
args = []
command = '...\node_repl.exe'
cwd = 'C:\stable\codex-node-repl'
startup_timeout_sec = 120
-
Stop only the existing
node_repl.exeinstance holding the affected project mirror. -
Retry creating the Work chat without restarting Codex.
After applying this mitigation:
-
The project cache and metadata refreshed successfully.
-
The new local task was created.
-
New helper processes started without blocking creation.
-
No subsequent project-context sync failure was recorded.
This is only a diagnostic workaround because Codex removes the manual cwd setting during restart.
Likely root cause
The bundled Browser/Computer Use configuration launches node_repl.exe without a stable process working directory. On Windows, it inherits the rotatable ChatGPT-project mirror and keeps a directory handle open.
A later project-context synchronization attempts to rename the same mirror and fails with a Windows sharing violation.
There may also be a sequencing race:
-
Project selection refreshes the mirror.
-
The task and MCP helper start against that mirror.
-
Chat creation triggers another synchronization.
-
The second synchronization cannot rotate the now-locked mirror.
Recommended fixes
-
Give bundled MCP servers, especially
node_repl, an explicit app-owned working directory outside project mirrors. -
Do not rely on working-directory inheritance for bundled helpers.
-
Preserve an existing supported
mcp_servers.node_repl.cwdvalue when regenerating configuration. -
Complete all project synchronization before launching task processes or MCP servers.
-
Consider immutable/versioned mirrors with indirection instead of renaming directories used by active tasks.
-
Detect
ERROR_SHARING_VIOLATION, identify known bundled child processes holding the mirror, safely rebase or restart them, and retry. -
Improve logging to include the failing operation, source and destination paths, native Windows error code, and lock-holder information.
-
Replace the generic UI error with an actionable local-folder-lock message.
Suggested regression test
On Windows:
-
Create an active ChatGPT-project mirror.
-
Start the bundled
node_replMCP server for a task associated with that mirror. -
Trigger project-context synchronization and mirror rotation.
-
Verify synchronization succeeds.
-
Verify no bundled helper uses the rotatable mirror as its operating-system working directory.
-
Repeat while selecting the project and immediately creating a Work chat to exercise the race condition.
Useful log signature
[electron-message-handler] ChatGPT project context sync failed
fileOrdinal=null
projectSaveCount=0
sourceCount=0
stage=filesystem
status=null
syncFileCount=0
The zero file counts are significant: the failure occurred before project content processing and was caused by local filesystem state.