Skip to content

Windows sandbox setup fails before PowerShell starts: node_repl.exe sharing violation (os error 32) #51875

Open

Description

@rhove-zz

What version of the Codex App are you using (From “About Codex” dialog)?

1.141.0

What subscription do you have?

Pro

What platform is your computer?

Windows

What issue are you seeing?

Environment:

  • Windows, VS Code, OpenAI Codex extension.
  • Extension version: 26.1002.51308-win32-x64.

Steps to reproduce:

  1. Open Codex in VS Code.
  2. Ask Codex to run a minimal read-only PowerShell command.
  3. Execution fails before PowerShell starts.

Actual result:
exec_command fails with:
helper_unknown_error: setup refresh had errors

The Windows sandbox setup log reports:
runtime read/execute validation failed
open ACL target for root-only update
os error 32: The process cannot access the file because it is being used by another process.

Affected runtime:
%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe

Latest observed occurrence:
2026-10-07T21:51:15Z.

Troubleshooting already performed:
Closed VS Code and Codex. Get-Process -Name node_repl returned no processes. After reopening VS Code and attempting one minimal command, the same error occurred again.

Expected result:
Sandbox setup completes and the PowerShell command starts.

No sandbox permissions or runtime files were modified. The process holding the conflicting file handle has not been identified. Please advise on a supported recovery procedure.

What steps can reproduce the bug?

  1. Open VS Code on Windows with the OpenAI Codex extension enabled.
  2. Open a local workspace and a Codex conversation.
  3. Ask Codex to execute a minimal read-only PowerShell command, such as Get-Location, through its execution tool.
  4. Execution fails before PowerShell starts, with:

helper_unknown_error: setup refresh had errors

The sandbox setup log reports a failure while opening this runtime file for an ACL update:

%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe

Windows reports error 32: the file is being used by another process.

Recovery attempt:
Close VS Code and Codex, then run Get-Process -Name node_repl -ErrorAction SilentlyContinue in a separate PowerShell window. The command returned no processes. Reopen VS Code and request one minimal read-only command. The same setup failure occurs again.

Expected: PowerShell starts and returns the command output.
Actual: Sandbox setup fails; no PowerShell session or native exit code is produced.

The process holding the conflicting file handle has not been identified.

What is the expected behavior?

No response

Additional information

Environment:

  • Windows, VS Code.
  • OpenAI Codex extension: 26.1002.51308-win32-x64.
  • Execution context: CodexSandboxOffline.

Latest recorded occurrence:
2026-10-07T21:51:15Z.

Relevant sandbox log:
runtime read/execute validation failed: validate runtime read/execute access on ...\cua_node\3dd31cfff853001c\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)

Followed by:
setup refresh completed with errors
setup error: setup refresh had errors

The failure persists after closing VS Code and Codex, confirming that no node_repl processes were listed, and reopening VS Code.

No runtime files, ACLs, or sandbox permissions were manually changed. Browser/computer-use tools were not explicitly initialized during the latest minimal execution attempt.

The failure prevents local command execution and blocks development. The pending project operation was never submitted.

The process holding the conflicting file handle remains unidentified. Please advise on a supported recovery procedure that preserves the sandbox execution context.

Activity

  1. added
    app
    on Oct 7, 2026
  2. added
    bug
    extension
    windows-os
    sandbox
    tool-calls
    on Oct 7, 2026
  3. rhove-zz commented on Oct 7, 2026

    @rhove-zz
    Author

    Clarification: the reported execution failure occurs in the Codex extension for VS Code on Windows, version 26.1002.51308-win32-x64. The version 1.141.0 entered in the form refers to the desktop app, not the VS Code extension. Please triage this issue for the IDE extension / Windows sandbox component.

  4. Yuhao-Zhang666 commented on Oct 8, 2026

    @Yuhao-Zhang666

    Windows sandbox setup fails on every tool call: cannot open running runtimebinaries to update their ACL (ERROR_SHARING_VIOLATION / os error 32)SUMMARYOn Windows 11 25H2 (build 26200), every tool call fails to set up the CodexWindows sandbox, and the app falls back to elevated/unsandboxed execution.Today: 52 of 52 "setup refresh" runs failed, 0 succeeded.ERROR (from %USERPROFILE%.codex.sandbox\sandbox..log) runtime read/execute validation failed: validate runtime read/execute access on ...\AppData\Local\OpenAI\Codex\runtimes\cua_node<hash>\bin\node_repl.exe: open ACL target for root-only update: (os error 32) setup refresh: processed 3 write roots (read roots delegated); errors=[...] setup refresh: exited with status ExitStatus(ExitStatus(1))ROOT CAUSEcodex-windows-sandbox-setup.exe opens each file underruntimes\cua_node<hash>\ with write access in order to update its DACL.But those same binaries are already running as children of codex.exe /ChatGPT.exe (node.exe, node_repl.exe), and Windows does not permit opening amapped executable image with write access, so the open fails withERROR_SHARING_VIOLATION.Verified by exclusive-open test — these are locked while running: node.exe, node_repl.exe, codex-computer-use-swift.exe, MSVCP140.dll, VCRUNTIME140.dll, VCRUNTIME140_1.dll(2365 files in that runtime folder; exactly these were locked.)Note the ordering: codex.exe itself launches node.exe --experimental-vm-modules --eval (the sandbox capability probe)a few hundred ms BEFORE the validation runs. So the setup tries toexclusively open a process that codex.exe just started itself.REGRESSIONStarted with the build installed 2026-10-07 ~20:10. Working build (2026-10-03): setup binary ...\Codex\bin\8aaf1547b825b104\codex-windows-sandbox-setup.exe payload_len=4516 Log shows NO runtime validation step at all, and ends with: setup refresh: processed 0 write roots (read roots delegated); errors=[] codex-windows-sandbox-setup.exe] setup binary completed Broken build (2026-10-08): setup binary ...\Codex\bin\9691020b546a15b2\codex-windows-sandbox-setup.exe payload_len=4576 Every run performs runtime validation and fails with os error 32.SUGGESTED FIX1. Open runtime files with WRITE_DAC only, without data-write access. Changing a DACL does not require write access, which avoids the sharing violation entirely.2. Skip runtime files that are currently mapped/running.3. Or run the runtime validation before spawning the runtime helpers.IMPACTThe Windows sandbox can never initialise on this machine; every tool calldegrades to elevated execution with an approval prompt. Reads/writes onlywork through that fallback path.
    01a11984-bb88-7821-a895-ba44e3c98d68

  5. ZenOpsZA commented on Oct 8, 2026

    @ZenOpsZA

    +1 - really annoying!

  6. zainmitchell commented on Oct 9, 2026

    @zainmitchell

    Latest stable 0.162.0 still fails elevated Windows sandbox startup; 0.162.0-alpha.20 passes.

    As of the October 9, 2026 check, GitHub's official latest stable release is still 0.162.0: https://github.com/openai/codex/releases/latest . Our retained October 8 tests of that stable release failed all five isolated sandbox preflight checks. The prerelease succeeded. This report is specifically calling attention to the failure remaining in the latest stable, not merely reporting an older CLI problem.

    Additional Windows CLI/app-server reproduction and stable-versus-prerelease results for this issue, captured on October 8, 2026.

    Summary

    We reproduced the same elevated Windows sandbox setup failure with Codex CLI 0.161.0. Official stable 0.162.0 also failed all five isolated app-server command preflight checks. The official 0.162.0-alpha.20 prerelease passed the formerly failing commands and preserved read-only write denial when its matching companion executables were present.

    This blocks sandboxed command execution used by independent code reviews across two projects. We are temporarily using the verified prerelease while retaining the elevated sandbox.

    Environment and observed error

    • Native Windows, x86_64-pc-windows-msvc release binaries; PowerShell commands.
    • Codex app-server, both directly in isolated diagnostics and through a third-party T3 integration. The isolated checks do not depend on launching T3 or a model.
    • Windows sandbox backend: elevated. Tested filesystem policies: workspace-write and read-only.
    • The exact Windows build was not captured in the retained diagnostic record.
    • Official downloaded executables were verified against published SHA256 digests.

    Execution fails before the requested command starts:

    exec failed: windows sandbox: helper_unknown_error: setup refresh had errors
    

    For the original 0.161.0 failures, the sandbox setup log identifies:

    runtime read/execute validation failed
    open ACL target for root-only update
    The process cannot access the file because it is being used by another process. (os error 32)
    

    Affected runtime path, with the user-specific prefix removed:

    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe
    

    The stable 0.162.0 command responses contain the same setup-refresh error. We do not claim that those responses alone prove the identical lower-level cause.

    Reproduction procedure used

    1. Prepare separate directories for the official stable 0.162.0 and official 0.162.0-alpha.20 Windows runtimes. Keep each runtime's own matching companion executables beside its CLI under the expected canonical filenames.
    2. Launch an isolated codex app-server with the elevated Windows sandbox selected. Initialize it and use model-free command/exec requests against an existing local checkout and a disposable owned scratch directory.
    3. Request the same bounded operations under the indicated policies: read repository HEAD and a few source lines under workspace-write; read a local instructions file; write and read a scratch file under workspace-write; run whoami; and attempt a scratch-file write under read-only while catching the expected denial.
    4. Compare results using the two runtimes, without disabling the sandbox or manually relaxing host runtime ACLs.

    Retained results

    Stable 0.162.0, 2026-10-08T21:26:34Z through 21:26:56Z:

    Preflight operation Result
    Repository HEAD and source reads, workspace-write Setup-refresh error; command did not execute
    Local instructions-file read Setup-refresh error; command did not execute
    Owned scratch write/read, workspace-write Setup-refresh error; command did not execute
    whoami Setup-refresh error; command did not execute
    Read-only write-denial check Setup-refresh error; enforcement check could not execute

    The stable CLI's version check and code-mode-host startup succeeded outside these sandbox command checks. Five matching official executables were present; this was not a CLI-only installation.

    Subsequent 0.162.0-alpha.20 checks, using the binary selected in the integration's settings and retaining elevated sandbox configuration:

    Timestamp (UTC) Operation Result
    2026-10-08T21:32:51Z Formerly failing repository HEAD/source reads Exit 0; expected content returned
    2026-10-08T21:33:22Z whoami Exit 0; restricted CodexSandboxOffline account
    2026-10-08T21:34:03Z Attempted write under read-only policy Expected access denial, reported as sandbox-write-denied by the check

    Earlier prerelease checks also passed the other project's instructions-file read and owned scratch write/read. These are direct command-startup and selected filesystem-enforcement checks, not claims of exhaustive runtime compatibility or product acceptance.

    Relevant upstream fix and stable-release gap

    PR #51822, commit dd12f892f1b857e5161abd33a2967125b265d550, restricts MAXIMUM_ALLOWED opens to directories during runtime ACL repair.

    Our October 8 inspection found that:

    • rust-v0.162.0-alpha.20 contains that fix.
    • Stable tag rust-v0.162.0 does not descend from that fix. The GitHub comparison was diverged, 2 ahead and 30 behind, with merge base ac9b5b8380517ded445b09dd3196d8d9e2ba3c59.
    • Stable codex-rs/windows-sandbox-rs/src/acl.rs, lines 528-535 at that tag, still used the unconditional root-only MAXIMUM_ALLOWED open. This conclusion was based on source inspection as well as ancestry.

    References:

    Packaging detail that mattered

    An initial prerelease attempt had the new CLI but lacked canonically named matching helpers. It resolved an older helper from PATH and still failed. Supplying the matching codex-windows-sandbox-setup.exe and codex-command-runner.exe beside codex.exe corrected that diagnostic setup.

    The integration's code-mode calls also required codex-code-mode-host.exe; omitting it caused a separate startup failure. Supplying the same release's checksum-verified host corrected the missing-file problem. The stable trial included its matching companions, including the sandbox service.

    No manual runtime ACL workaround or unsandboxed execution was used to obtain the successful prerelease command results. A temporary unelevated diagnostic alternative worked, but was not adopted as the shared provider configuration.

    Requested maintainer guidance

    Please confirm which supported stable Windows release includes #51822, or backport it if the current stable branch still lacks it. Please also confirm the supported Windows app-server distribution layout so integrations reliably use the matching sandbox helpers and code-mode host rather than finding an older helper on PATH.

    This report summarizes retained local diagnostic results; it does not claim a fresh reproduction on October 9. Private project source, user-specific paths, session transcripts, credentials and sandbox secrets are intentionally omitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugextensionsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions