Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Windows elevated sandbox setup fails when `node_repl.exe` is running (OS error 32)

Open
#52,389 7 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
18/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

The failure comes from the Windows elevated sandbox setup helper, which logs an ACL validation on the node_repl.exe runtime under cua_node; the issue does not name the source file, so first locate where the helper opens ACL targets for the runtime root-only update. Reproduce by running a sandboxed codex exec while an interactive session holds node_repl.exe open. Done would mean setup succeeds with that executable in use, without weakening the sandbox ACL requirements.

Written by the indexing model from the issue text.

Description

bug CLI mcp sandbox windows-os

Environment

  • Windows 11 Home, build 10.0.26300
  • windows.sandbox = "elevated"
  • Affected setup helpers:
    • npm CLI 0.160.1 (@openai/codex-win32-x64, codex-windows-sandbox-setup.exe)
    • App-server daemon 0.161.0 and 0.162.0
  • Codex runtime present at %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe, used by the node_repl MCP server

Observed behavior

Sandboxed Codex commands intermittently fail with:

helper_unknown_error: setup refresh had errors

The sandbox log (~/.codex/.sandbox/sandbox.<date>.log) reports:

runtime read/execute validation failed: validate runtime read/execute access on C:\Users\<user>\AppData\Local\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe: open ACL target for root-only update: The process cannot access the file because it is being used by another process. (os error 32)

setup refresh completed with errors: [...]
setup error: setup refresh had errors
setup refresh: exited with status ExitStatus(ExitStatus(1))

The same refresh also reports a non-fatal OS error 32 while attempting to update an ACE on the user-profile directory.

Evidence

  • Examined 28 failed sandbox refreshes over approximately 24 hours. All 28 reported the same node_repl.exe file-sharing error.
  • The failures began when node_repl was first used on this machine (~/.codex/node_repl/ created at the time of the first failure), although the cua_node runtime had been installed about two weeks earlier. Approximately 1,060 earlier refreshes in the examined logs had no recorded errors.
  • Failures also occurred with codex exec --ignore-user-config, suggesting the behavior is not controlled solely by the user's [mcp_servers.node_repl] configuration.
  • The executable already had an inherited Modify permission for CodexSandboxUsers. The helper nevertheless failed while opening the target for its ACL operation.
  • In observed sessions, sandbox refreshes resumed succeeding after the sessions hosting node_repl.exe exited and that process terminated.

The relationship between process lifetime and failures is supported by observations and timestamps, but was not captured through simultaneous process and file-handle tracing.

Possible cause (unconfirmed)

The sandbox setup helper may be opening runtime executables with access or sharing flags incompatible with a running executable.

This could cause a Windows sharing violation (ERROR_SHARING_VIOLATION, OS error 32) during ACL validation or modification.

The exact file-opening flags and internal helper behavior have not been verified.

Expected behavior

Codex sandbox initialization should succeed while other Codex sessions are using Codex-provided runtime executables.

Potential fixes to investigate include:

  • Opening ACL targets with compatible sharing flags.
  • Avoiding unnecessary ACL operations when effective permissions are already sufficient.
  • Handling executable-in-use sharing violations without aborting setup, provided sandbox security requirements remain satisfied.

Suggested reproduction (inferred; not deliberately reproduced)

  1. Install or initialize the Codex runtime containing cua_node.
  2. Configure Windows elevated sandbox mode.
  3. Start an interactive Codex session that launches the node_repl MCP server, and confirm node_repl.exe is running.
  4. In another terminal, execute:
codex exec --ignore-user-config -c windows.sandbox="elevated" --sandbox workspace-write "Run git status."
  1. Sandbox initialization may fail with setup refresh had errors. Inspect ~/.codex/.sandbox/sandbox.<date>.log for the sharing violation on node_repl.exe.

Workaround

Exit interactive Codex sessions hosting node_repl.exe and wait for that process to terminate before dispatching another sandboxed Codex worker.

This has restored successful sandbox initialization in the observed cases.

Dominant language
Rust
Stars
129k
Forks
20.3k
Avg merge
1m
Merged PRs (30d)
998

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.