Skip to content

Windows sandbox refresh fails before command execution: node_repl.exe ACL update hits sharing violation (os error 32) #52054

Open

Description

@florynstefanache-source

Summary

Local command execution is blocked before the requested command starts by helper_unknown_error: setup refresh had errors. The sandbox refresh attempts a root-only ACL update on the bundled CUA node_repl.exe, but Windows returns a sharing violation (os error 32). This appears to match #52046; reporting an additional case with the relevant log details.

Environment

  • Desktop app version reported by the app updater: 26.1002.52244, build 13536, release channel prod. The updater reported up_to_date when checked.
  • Windows desktop environment; exact OS build has not been collected.
  • Sandbox setup binary: %LOCALAPPDATA%\OpenAI\Codex\bin\9691020b546a15b2\codex-windows-sandbox-setup.exe.
  • Affected runtime: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe.

Reproduction in the affected environment

  1. Open an existing local workspace in the desktop app.
  2. Request a minimal read-only PowerShell operation, such as Get-Item -LiteralPath <existing workspace ZIP>.
  3. The operation never starts. Process creation is rejected with helper_unknown_error: setup refresh had errors.
  4. Repeated attempts over October 7–8, 2026 produce the same initialization failure.

Relevant sandbox log (personal paths anonymized)

setup refresh: spawning ...\codex-windows-sandbox-setup.exe (payload_len=3436)
failed to grant non-inheriting read-attributes ACE on user profile <USERPROFILE>: open ACL target for root-only update: El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso. (os error 32); continuing setup
read-acl-only mode: applying read ACLs
read ACL run completed
runtime read/execute validation failed: validate runtime read/execute access on <LOCALAPPDATA>\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_repl.exe: open ACL target for root-only update: El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso. (os error 32)
setup refresh: processed 3 write roots (read roots delegated)
setup refresh completed with errors
setup error: setup refresh had errors
setup refresh: exited with status ExitStatus(ExitStatus(1))

setup_error.json contains only:

{"code":"helper_unknown_error","message":"setup refresh had errors"}

Troubleshooting and limits of available evidence

  • Retried read-only commands repeatedly; none reached execution.
  • Reset the Node REPL session through its reset tool; reset returned success, but shell setup still failed.
  • The user confirmed terminating the Node helper task. A subsequent sandbox log still identified the same sharing violation on node_repl.exe.
  • App/Windows restarts were suggested; the user returned requesting checks, which still failed. A complete Windows restart was not explicitly confirmed, so this report does not claim that it was conclusively tested.
  • We have not identified which process holds the conflicting handle.
  • No ACLs or runtime files were deleted or changed as a workaround.

Expected and actual behavior

Expected: sandbox setup succeeds and permitted read-only commands can execute.
Actual: all local shell work is blocked during setup, preventing file inspection, edits, builds and tests. The underlying sharing violation is visible only in the sandbox log, while the tool returns the generic setup refresh message.

Please investigate the runtime ACL refresh/locking interaction and expose the affected path and underlying Windows error more directly in the user-facing diagnostic.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    on Oct 8, 2026
  2. curiositypheels commented on Oct 9, 2026

    @curiositypheels

    Same failure here, with a few extra measurements that may help narrow it down.

    Environment: Windows 11 Pro for Workstations (build 26300), Codex desktop 26.1002.7124.0 (MSIX). Every shell command fails before execution with helper_unknown_error: setup refresh had errors, including echo hello. It persists after app restarts, a full reboot and updating everything.

    Log chain (paths masked):

    setup refresh: processed 2 write roots (read roots delegated); errors=["runtime read/execute validation failed: validate runtime read/execute access on %USERPROFILE%\AppData\Local\OpenAI\Codex\runtimes\cua_node<id>\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 error: setup refresh had errors
    setup refresh: exited with status ExitStatus(ExitStatus(1))
    The same refresh also logs failed to grant non-inheriting read-attributes ACE on user profile %USERPROFILE% … (os error 32); continuing. That one is non-fatal.

    What we measured:

    The ACL is already sufficient. icacls on node_repl.exe shows CodexSandboxUsers:(I)(RX), inherited from bin\ (OI)(CI)(RX). Both CodexSandboxOffline and CodexSandboxOnline exist. The refresh is trying to rewrite an ACL that already grants read/execute.
    The lock is Windows' executing-image rule, not a third-party handle. While node_repl.exe runs, an exclusive read open of it (FileShare.None) succeeds, but a write open with full sharing (ReadWrite, share ReadWrite|Delete) fails with 0x80070020, the same "being used by another process" text. No data written; the file hash is unchanged. So any write-type open of the running image fails, whatever else has it open.
    Codex starts node_repl.exe itself, before the first refresh. After a full close (0 Codex processes verified) and a fresh start, node_repl.exe (from the same cua_node<id>\bin\ path) starts in the same second as codex.exe, or seconds before the first command. Every later refresh then collides with it. They're not orphans: every node_repl parent (codex.exe or a per-task node.exe) is alive.
    Not antivirus. It fails the same with the third-party AV's real-time scanning off; Windows Defender is in passive mode.
    Timing: the cua_node runtime's node_repl.exe on disk is dated 2026-10-07 13:33 local, and the first failures here are the same day, consistent with a regression arriving with that runtime/update.
    Likely fix direction (outside view): the read/execute validation shouldn't need to open the runtime image for write/ACL update when the effective ACL already grants RX, or it should run before the runtime is launched (or skip files that are currently executing).

    Happy to run a specific diagnostic if it helps.

  3. xXDado88Xx commented on Oct 9, 2026

    @xXDado88Xx

    Additional confirmed recovery case — Windows 11 Home / Codex 26.1002.7124.0

    I experienced the same helper_unknown_error: setup refresh had errors failure, with the sandbox log identifying an os error 32 sharing violation on the bundled cua_node\...\bin\node_repl.exe during read/execute validation.

    Environment

    • Windows 11 Home, build 10.0.26200
    • Codex Desktop 26.1002.7124.0
    • Google Chrome with the Codex extension/native host

    A full Windows restart did not resolve the issue.

    Additional process observations

    I found separate process trees for the desktop application and Chrome extension integration:

    • Desktop ChatGPT.exe → codex.exe → Node/Node REPL runtime processes.
    • Chrome extension-host.exe → separate codex.exe backend → Node/Node REPL runtime processes.

    Closing the desktop app alone left extension-associated runtime processes running.

    Recovery sequence that worked

    1. Closed Codex Desktop normally.
    2. Disabled the Codex Chrome extension in chrome://extensions/.
    3. Closed Chrome completely.
    4. Verified that the related codex.exe, node_repl.exe and extension-host.exe processes had exited.
    5. Restarted Codex with the extension disabled and a single agent session.
    6. Tested PowerShell: Write-Output 'SHELL_OK' → PASS, exit code 0.
    7. Tested Node REPL: 1 + 1 → PASS, returned 2.
    8. Re-enabled the Chrome extension without connecting to the browser.
    9. Repeated PowerShell and Node tests → both PASS.
    10. Attempted Chrome browser discovery once → PASS, three tabs returned.
    11. Successfully inspected an authenticated website using Chrome automation.

    Previously, browser connection attempts had coincided with Node kernel resets and recurrence of the sandbox sharing violation. However, the controlled final browser-discovery test succeeded.

    Interpretation

    This suggests that the runtime/process lifecycle may influence when the sandbox refresh encounters the running executable.

    It does not establish that the Chrome extension is the root cause. I did not identify the locking handle, and the issue may recur.

    The controlled shutdown/restart procedure restored execution without modifying ACLs, deleting runtime files, disabling security features or terminating the Windows sandbox service.

    Hopefully, this provides an additional recovery path for affected users and useful lifecycle evidence for maintainers.

  4. MeinHerzBrennt12 commented on Oct 16, 2026

    @MeinHerzBrennt12

    Windows sandbox still fails with os error 32 on Codex CLI 0.163.0 despite PR #51822

    I can confirm that the Windows sandbox issue persists after upgrading from Codex CLI 0.162.1 to the stable 0.163.0 release, which includes PR #51822.

    Environment

    • OS: Windows
    • Codex CLI: 0.163.0
    • Installation: npm (npm install -g @openai/codex@latest)
    • Sandbox: Default Windows sandbox configuration
    • Test date: October 16, 2026

    Steps to reproduce

    1. Upgrade Codex CLI to 0.163.0.
    2. Open a fresh PowerShell session.
    3. Navigate to an isolated temporary test directory.
    4. Start Codex using codex.
    5. Ask Codex to execute a simple read-only command such as Get-Location, git --version, or node --version using the default sandbox.

    Actual result

    All three commands fail before execution:

    Failed to create unified exec process:
    helper_unknown_error: setup refresh had errors
    

    The Windows sandbox diagnostic log (~/.codex/.sandbox/sandbox.2026-10-16.log) provides the underlying error:

    runtime read/execute validation failed:
    validate runtime read/execute access on
    C:\Users\<USER>\AppData\Local\OpenAI\Codex\runtimes\cua_node\a9ba6825a525118c\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
    setup refresh: exited with status ExitStatus(ExitStatus(1))
    

    Expected result

    The Windows sandbox should initialize successfully and execute basic read-only commands without failing during runtime ACL validation.

    Additional observations

    • The issue was reproducible on CLI 0.162.1 and remains reproducible on 0.163.0.
    • All three read-only commands failed at process creation.
    • No ACLs, permissions, runtime files, or sandbox settings were manually modified during testing.
    • No elevated privileges or danger-full-access were requested.
    • The failure specifically occurs during runtime read/execute validation of cua_node/.../node_repl.exe.
    • The process holding the conflicting file handle has not yet been identified.

    Since PR #51822 was intended to address Windows runtime ACL sharing violations, this may indicate a remaining failure path in the runtime read/execute validation or root-only ACL update logic.

    Could the maintainers confirm whether PR #51822 is expected to cover this particular validation path, and whether additional changes are planned?

    I can provide further diagnostic logs or perform additional non-destructive tests if needed.

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

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions