Skip to content

Windows sandbox fails with error 32 while Codex desktop is open; works when closed. #52328

Open

Description

@adamcstone

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

26.1002.7124.0

What subscription do you have?

Enterprise

What platform is your computer?

Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex displays “Windows setup didn’t finish,” and sandbox commands fail with helper_unknown_error: setup refresh had errors.

The setup logs show Windows error 32 (“The process cannot access the file because it is being used by another process”) when validating runtime permissions on node_repl.exe or VCRUNTIME140_1.dll.

Sandbox commands work with Codex desktop closed and fail with it open. The administrator sandbox provisioning command completes successfully, but subsequent runtime permission refresh fails.

What steps can reproduce the bug?

  1. Completely close Codex desktop and its helper processes.
  2. Open PowerShell and run:
    & "$env:LOCALAPPDATA\OpenAI\Codex\bin\9691020b546a15b2\codex.exe" sandbox powershell.exe -NoProfile -Command "Write-Output 'Sandbox works'"
  3. Confirm that the command succeeds.
  4. Open Codex desktop.
  5. Run the same PowerShell command again.
  6. Observe that it fails with helper_unknown_error: setup refresh had errors. The sandbox log reports error 32 on a Codex runtime file.

Process inspection shows that Codex desktop launches codex-computer-use-swift.exe, which loads the failing DLL. Its codex.exe child also launches node_repl.exe.

What is the expected behavior?

Windows sandbox setup should finish successfully, and sandbox commands should work while Codex desktop is open. Running Codex helpers should not prevent runtime permission validation or refresh.

Additional information

No response

Activity

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

    @niuniuniu0311

    Additional reproduction and verified workaround on 2026-10-09.

    Environment verified locally:

    • Windows version reported by System.Environment.OSVersion: 10.0.22631.0.
    • Installed AppX package: OpenAI.Codex 26.1002.7124.0.
    • Bundled CLI: codex-cli 0.162.0-alpha.2.
    • Runtime: cua_node/3dd31cfff853001c.
    • Initial configuration: [windows] sandbox = "elevated".

    Ordinary local file-reading commands failed before PowerShell could start, with:

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

    The dated sandbox log repeatedly reported:

    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:
    The process cannot access the file because it is being used by another process. (os error 32)
    

    The same read command succeeded outside the sandbox using approved host execution.

    New helper processes appeared after application restarts, and the failure recurred. Stopping only the two processes running this exact node_repl.exe let validation progress further, but it then failed with the same sharing violation on:

    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node_modules\@oai\sky\bin\windows\swift\x64\VCRUNTIME140_1.dll
    

    After stopping the remaining executables under this exact runtime directory, codex-computer-use-swift.exe appeared again and the DLL validation failure recurred. These observations do not establish the exact conflicting handle or the underlying implementation defect.

    Verified workaround: once config.toml contained [windows] sandbox = "unelevated", two successive ordinary local shell calls successfully read existing files without host-execution escalation. The sandbox log recorded SUCCESS at 2026-10-09 09:20 local time (Asia/Shanghai). This verifies shell/file reading only; browser/computer-use recovery was not tested, and elevated mode has not been shown to recover.

    Please identify a supported fix or release that restores elevated sandbox initialization while its own runtime helpers are running. No manual ACL changes or runtime-binary replacements were used. Personal paths, credentials, and full session logs have been omitted.

  4. tmc642584851-cyber commented on Oct 9, 2026

    @tmc642584851-cyber

    Additional matching report (2026-10-09): Windows packaged app OpenAI.Codex version 26.1002.7124.0 (Get-AppxPackage status Ok). Previously working client suddenly displayed “Windows setup didn’t finish / Setup stopped”; clicking Retry did not show a UAC prompt.

    Repeated entries in ~/.codex/.sandbox/sandbox.2026-10-09.log:

    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: 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
    

    Observed workaround for this case: completely quit Codex, inspect/terminate residual node_repl.exe process(es) with no active jobs, and reopen the app. The Windows setup warning no longer appeared; a subsequent local desktop .txt file-creation task succeeded. This is evidence of recovery of basic file operations, not a full validation of elevated sandbox isolation. No ACL changes, runtime deletion, or reinstall performed. Paths and identifying details redacted.

    Please investigate a possible race between sandbox ACL refresh and live computer-use/node_repl runtime processes, and whether setup could retry gracefully on sharing violations.

  5. tmc642584851-cyber commented on Oct 9, 2026

    @tmc642584851-cyber

    Additional confirmed case on 2026-10-09 (China time), Codex Windows package OpenAI.Codex 26.1002.7124.0 (package status: Ok).

    Symptoms:

    • Previously worked normally; unexpectedly prompted to finish/install Windows sandbox setup.
    • UI: "Windows setup didn't finish" / "Setup stopped".
    • Clicking retry showed no UAC prompt.
    • Sandbox log repeatedly reported:
    runtime read/execute validation failed: validate runtime read/execute access on ...\OpenAI\Codex\runtimes\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)
    setup refresh completed with errors
    setup error: setup refresh had errors
    
    • Repeated refresh failures occurred within seconds.

    Recovery observed:

    1. Quit the Codex desktop app and inspect residual codex / node_repl processes.
    2. Stop leftover node_repl.exe processes (after checking no important tasks were running), then reopen Codex.
    3. The Windows setup error/prompt no longer appeared.
    4. A simple Work desktop TXT-file creation task subsequently succeeded.

    This appears to be a transient file-sharing/ACL refresh collision with an active computer-use runtime. The exact lock holder and underlying lifecycle race are not yet proven. This workaround resolved the user's immediate symptoms without reinstalling or changing ACLs. Paths/user identifiers omitted for privacy.

  6. jmaher-fas commented on Oct 11, 2026

    @jmaher-fas

    Additional data point: the standalone npm CLI is affected too, not just the app's bundled executor.

    • Windows 11 build 26200, desktop OpenAI.Codex 26.1007.2314.0 (bundled CLI 0.162.0-alpha.17.2), npm @openai/codex 0.162.1 (stable, published 2026-10-09), [windows] sandbox = "elevated".
    • With the desktop app running, codex sandbox -- cmd /c echo hi from the npm CLI fails with helper_unknown_error: setup refresh had errors. The sandbox log shows os error 32 on cua_node\…\swift\x64\VCRUNTIME140_1.dll (loaded by codex-computer-use-swift.exe) and on node_repl.exe. With the desktop app fully quit, the same command works.
    • Disabling plugins, computer_use, browser_use and the node_repl MCP server in the CLI's profile does not help: the files are held by the desktop app's own processes, and the CLI's setup still validates that runtime.
    • On which release contains the fix (asked in Windows App 26.1002.7124.0: sandbox runtime read/execute validation fails with sharing violation #51932): PR Avoid sharing violations when repairing Windows runtime ACLs #51822 is not an ancestor of rust-v0.162.1 (GitHub compare reports diverged), but is included in rust-v0.163.0-alpha.5.
    • Workaround confirmed for the CLI with the desktop app open: [windows] sandbox = "unelevated" (or -c windows.sandbox=unelevated). Commands run, writes inside the workspace succeed, and writes outside it are still denied (Access is denied.). A full codex exec with -s workspace-write also completes normally.
  7. christina-fake commented on Oct 14, 2026

    @christina-fake

    Additional confirmed case: Windows sandbox fails in npm CLI and OpenResearch while Codex Desktop Shell succeeds

    Environment

    • Windows 11 x64
    • Codex Desktop: 26.1007.71326
    • Bundled CLI: codex-cli 0.162.0-alpha.17.2
    • npm CLI: codex-cli 0.162.1
    • OpenResearch: 0.2.18
    • Windows sandbox: elevated

    Symptoms

    • Codex Desktop can run Shell commands successfully.
    • The standalone npm CLI and OpenResearch fail with:
    • helper_unknown_error: setup refresh had errors
      -The standalone CLI also reports: helper_sandbox_lock_failed:SetNamedSecurityInfoW sandbox dir failed: 5

    Reproduction

    1. Start Codex Desktop.
    2. Start OpenResearch.
    3. Run:
      codex sandbox -- cmd /d /c echo hello

    The command fails in the standalone CLI, while an equivalent Shell command in Codex Desktop succeeds.

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