Skip to content

Windows sandbox unusable: setup refresh fails with os error 32 (app-tools MCP holds the cua_node runtime exe) #52488

Open

Description

@fgoslm

Summary

On Windows, the sandboxed command channel becomes unusable while the app-tools MCP server is running. Every sandboxed (non-escalated) command is rejected with:

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

.codex/.sandbox/setup_error.json contains:

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

Root cause (from the sandbox log)

setup refresh fails at the runtime read/execute validation step:

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 file is being used by another process (os error 32)

os error 32 = ERROR_SHARING_VIOLATION. The file is held open by the app-tools MCP server, which runs from that very runtime:

cmd.exe /d /s /c call ./scripts/launch_codex_app_tools_mcp.cmd ./server.mjs
node.exe ./server.mjs        <- executable: ...\runtimes\cua_node\<hash>\bin\node.exe

Because setup refresh returns a non-zero status, the whole sandbox channel is rejected.

Steps to reproduce

  1. Launch Codex desktop on Windows 11 (build 10.0.26200, Chinese locale).
  2. Wait until the app-tools MCP server starts (in my environment it comes up about 1 minute after the app launches; it also comes back later on its own).
  3. Run any command in the sandboxed channel.

Expected: the command runs in the sandbox.
Actual: helper_unknown_error: setup refresh had errors, and .codex/.sandbox/setup_error.json is written.

Workaround that works

Terminate the app-tools MCP node.exe (and its cmd.exe parent): the next sandboxed command succeeds immediately and setup_error.json is removed. The problem comes back as soon as that MCP server is started again. Restarting the app does NOT help, because the MCP server is respawned on launch.

Frequency

Recurring, not a one-off:

  • .codex/.sandbox/sandbox.2026-09-18.log: 132 occurrences of the same validation failure
  • .codex/.sandbox/sandbox.2026-10-09.log: dozens of occurrences

Expected fix

setup refresh should not require an exclusive ACL write on a runtime executable that the product itself keeps running. For example: skip/reuse ACLs when the target is already in use, set ACLs before the MCP server starts, or use a separate copy of the runtime for sandbox validation.

Environment

  • Codex desktop app on Windows 11 Pro (10.0.26200), Chinese locale
  • Sandbox command runner: codex-command-runner-0.162.0-alpha.2.exe
  • Relevant files: %LOCALAPPDATA%\Codex\Logs\..., %USERPROFILE%\.codex\.sandbox\sandbox.<date>.log, %USERPROFILE%\.codex\.sandbox\setup_error.json

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    mcp
    on Oct 9, 2026
  2. huoxixi842-ui commented on Oct 9, 2026

    @huoxixi842-ui

    I’m experiencing a similar failure on Windows with desktop app version 26.1002.52244.

    All local command attempts fail with:
    helper_unknown_error: setup refresh had errors

    Sandbox logs show os error 32 when updating ACLs for node_repl.exe and swift\x64\VCRUNTIME140_1.dll inside the Codex cua_node runtime. Process Explorer confirmed that a codex-computer-* process had loaded the affected DLL.

    I have tried exiting the app, terminating the identified processes, rebooting Windows, and setting windows.sandbox to both elevated and unelevated. The failure persists. Task Manager shows the Codex backend is elevated.

    Is there a verified workaround or a planned fix? I also cannot find the documented “Agent environment” setting to switch to WSL in this app’s UI.

  3. derevopalet-alt commented on Oct 9, 2026

    @derevopalet-alt

    Adding a locally verified recovery report, including a compatibility pitfall when trying a newer CLI override.

    Environment

    • Windows 10, build 19045, x64.
    • Desktop package: 26.1002.7124.0; bundled CLI: 0.162.0-alpha.2.
    • Override versions tried: 0.163.0-alpha.1, then 0.162.0-alpha.20.
    • Observation date: 2026-10-09.

    Observed sequence

    1. Windows sandbox refresh failed with sharing violation / OS error 32 while a cua_node runtime executable was in use. Browser automation could fail before reading a page with helper_unknown_error / Node process exited.
    2. To obtain the ACL file-lock fix, we manually selected the official CLI 0.163.0-alpha.1 through CODEX_CLI_PATH. This was a local override, not a normal desktop update. Sandbox operations recovered, but conversation requests failed with:
    Invalid response.create payload: Unknown parameter: 'input[1].internal_chat_message_metadata_passthrough.content_item_metadata'.
    
    1. Adding this config.toml setting restored the main conversation and local commands:
    [features]
    content_item_kinds = false

    However, web-tool requests still failed with the same unsupported field at input[0]. The setting alone was not a complete fix.
    4. We replaced the override with the official, signed CLI 0.162.0-alpha.20, retained content_item_kinds=false, and fully restarted the desktop app. We verified the active executable versions after restarting.

    Observed recovery

    • Main conversation and local shell commands: successful.
    • Web tool: actual search and page retrieval successful.
    • In-app browser: actual page read, screenshot and button clicks successful.
    • Fresh sandbox log segment: five setup completions with errors=[]; no recurrence of error 32 / helper_unknown_error / Node process exited in the inspected segment.

    Relevant upstream fix and tested release

    Interpretation and limits

    The metadata rejection is consistent with a compatibility mismatch between the manually selected newer alpha CLI and this desktop/service combination. We have not established which exact service boundary rejects the field. Binary strings alone are not proof of serialization behavior; the request rejection is the behavioral evidence.

    The tested workaround combines a CLI change, retained feature setting, and full restart. Their individual contributions were not isolated. We did not test alpha.20 with content_item_kinds enabled.

    This is a local observation, not a supported general upgrade recommendation. Long-term stability, native desktop automation, external Chrome control, and paid video generation were not verified.

    Suggested maintainer follow-up

    • Ship the Windows ACL fix in the desktop-compatible bundled runtime.
    • Check desktop/CLI compatibility before accepting an override, with a clear actionable error.
    • Investigate whether disabling content_item_kinds should prevent the rejected metadata field in all relevant request paths.
    • Document a supported recovery procedure that does not require users to reinstall repeatedly or weaken permissions.

    This report contains no project files, credentials, account identifiers, user-specific filesystem paths, full conversation transcript, or raw diagnostic logs.

  4. EP-PBednarczyk commented on Oct 9, 2026

    @EP-PBednarczyk

    Changing [windows] sandbox from "elevated" to "unelevated" and
    restarting Codex restored terminal execution. git status --short
    now completes successfully with exit code 0.

    However, this is a workaround, not a fix. After the update,
    Codex could not run any terminal commands, and restarting both
    Codex and Windows did not help.

    I am frustrated that an application update required manual editing
    of config.toml to restore basic functionality. Users should not
    have to diagnose runtime file locks or change sandbox mode after
    an update.

    Please keep the underlying bug tracked and provide an official fix
    for elevated sandbox mode. Please also confirm when it is safe to
    restore sandbox = "elevated".

  5. EP-PBednarczyk commented on Oct 9, 2026

    @EP-PBednarczyk

    I restored terminal execution only by manually editing:
    %USERPROFILE%.codex\config.toml

    I had to change:
    [windows]
    sandbox = "elevated"

    to:
    [windows]
    sandbox = "unelevated"

    After saving the file and restarting Codex, git status --short
    completed successfully with exit code 0.

    Restarting Codex and Windows alone had not resolved the problem.

    I am frustrated that a Codex update broke basic terminal functionality
    and required me to locate and manually edit an internal configuration
    file. This should not be necessary after an application update.

    This is a workaround, not a fix for elevated sandbox mode.
    Please track the underlying bug, provide an official fix, and confirm
    when users can safely restore sandbox = "elevated".

  6. EP-PBednarczyk commented on Oct 9, 2026

    @EP-PBednarczyk

    I restored terminal functionality myself using the following workaround:

    1. Completely close Codex.

    2. Open %USERPROFILE%.codex\config.toml in Notepad.

    3. Find the existing section:

      [windows]
      sandbox = "elevated"

    4. Change it to:

      [windows]
      sandbox = "unelevated"

    5. Save the file and restart Codex.

    6. Run git status --short to verify terminal execution.

    The command now completes successfully with exit code 0.
    Restarting Codex and Windows without this configuration change
    did not resolve the problem.

    However, users should not have to manually edit configuration files
    to restore basic functionality after a Codex update. The update left
    the terminal unusable until I applied this workaround.

    Please provide an official fix for elevated sandbox mode and confirm
    when it is safe to restore sandbox = "elevated".

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

    appbugmcpsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions