Skip to content

codex 的一些小问题,希望官方看到后能够进行修复优化 windows.sandbox = "elevated" provisioning always fails with helper_unknown_error: setup refresh had errors because the bundled app-tools node.exe is in use #52041

Open

Description

@15861503281
  • OS: Windows 11 (10.0.26300, x64), zh-CN
  • Codex CLI: 0.162.0-alpha.2
  • Codex desktop app: 26.1002.7124.0 (MSIX, package OpenAI.Codex_2p2nqsd0c76g0)
  • Config: [windows] sandbox = "elevated"
  • Antivirus: Microsoft Defender only (no third-party AV active)
  • With [windows] sandbox = "elevated", every command execution and file write in a sandboxed
    permission profile fails before the command starts:
Failed to create unified exec process: helper_unknown_error: setup refresh had errors

"Full access" mode works, because it skips sandbox provisioning. This makes the restricted
profiles (read-only / workspace-write) completely unusable.

codex doctor output (relevant part)

✗ sandbox   elevated Windows sandbox provisioning recorded a structured failure
    sandbox backend        elevated
    sandbox provisioning   failed
    error code             helper_unknown_error
    → repair or reinstall the Codex CLI from an approved distribution

%USERPROFILE%\.codex\.sandbox\setup_error.json:

{ "code": "helper_unknown_error", "message": "setup refresh had errors" }
%USERPROFILE%\.codex\.sandbox\sandbox.<date>.log` shows the failing step:

setup refresh: spawning ...\codex-windows-sandbox-setup.exe (payload_len=3852)
read-acl-only mode: applying read ACLs
read ACL run completed
runtime read/execute validation failed: validate runtime read/execute access on
C:\Users<user>\AppData\Local\OpenAI\Codex\runtimes\cua_node<hash>\bin\node.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


That `node.exe` is running the bundled `codex-app-tools` MCP server, started by the app server:

ChatGPT.exe
└─ codex.exe (app-server)
└─ cmd.exe /d /s /c call ./scripts/launch_codex_app_tools_mcp.cmd ./server.mjs
└─ ...\OpenAI\Codex\runtimes\cua_node<hash>\bin\node.exe ./server.mjs


A running executable cannot be opened for `WRITE_DAC`, so provisioning fails on every single
command. The app restarts that helper continuously, so it never recovers on its own.
Workaround (confirmed working)

Set the Windows sandbox backend to the user-mode one:

```toml
[windows]
sandbox = "unelevated"

After restarting the app, codex doctor reports ✓ sandbox, restricted profiles work, and the
sandbox still enforces its boundaries (writes outside the writable roots are denied).
Trade-off: the elevated-only capabilities (deny-read overrides, managed networking) are lost.

Suggested fix

  • Make the sandbox provisioning tolerate files that are in use: skip the ACL update when
    STATUS_SHARING_VIOLATION / os error 32 is returned, or validate read/execute access by
    another means (e.g. AccessCheck / opening for READ_CONTROL instead of WRITE_DAC).
  • Alternatively stop validating runtime helpers that are currently executing, or run the
    bundled MCP node from a location that is excluded from ACL management.

Activity

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

    @AlbertAlter

    Additional reproduction on Windows 10 Pro (build 19045), 2026-10-09. The user reports that the desktop app has no available update.

    • User config: [windows] sandbox = "elevated".
    • Even a read-only workspace file check fails before PowerShell starts with helper_unknown_error: setup refresh had errors. Switching between PowerShell and CMD and changing the working directory did not change the result. A separately approved command outside the sandbox works.
    • The dated sandbox log records runtime read/execute validation failed while opening the bundled cua_node/.../bin/node.exe for a root-only ACL update: Windows sharing violation, os error 32. Earlier attempts also named node_repl.exe.
    • The exact node.exe reported in the log was running when checked. Its process ancestry was codex.exe -> cmd.exe -> node.exe; it was not a project-installed Node binary.
    • Repeated retries still fail. No runtime files, ACLs, or sandbox settings were modified during diagnosis.

    This adds a Windows 10 Pro reproduction with a verified Codex-owned process tree to the existing report. Related Windows 10 report: #52103.

  3. MRXUG commented on Oct 9, 2026

    @MRXUG

    This also reproduces with [windows] sandbox = "unelevated".

    On Windows, exec_command fails before running even Write-Output ok with:
    helper_unknown_error: setup refresh had errors

    The sandbox log says:
    read-acl-only mode: applying read ACLs
    read ACL run completed
    runtime read/execute validation failed: validate runtime read/execute access on ...\Codex\runtimes\cua_node\3dd31cfff853001c\bin\node.exe: open ACL target for root-only update: ... (os error 32)

    The same node.exe is running ./server.mjs while Codex is open. It exits when Codex closes and starts with a new PID when Codex reopens. Rebooting Windows does not resolve it. No Codex update is currently offered.

  4. eminmhmt7 commented on Oct 10, 2026

    @eminmhmt7

    I can reproduce this issue on Windows 11 Pro x64 (build 26200) with Codex CLI 0.162.1.

    The elevated Windows sandbox fails with helper_unknown_error: setup refresh had errors. The sandbox log confirms os error 32 during ACL validation of node_repl.exe, and an earlier attempt failed on VCRUNTIME140_1.dll.

    Running codex.cmd sandbox -- cmd.exe /c echo SANDBOX_OK can succeed, but executing even git rev-parse HEAD from an interactive Codex session fails.

    Updating Codex CLI and the desktop app, restarting Windows, stopping the background daemon, and trying --no-daemon did not resolve interactive execution.

    I have not disabled sandbox protections or switched to the unelevated backend.

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