Skip to content

[Windows] Codex App sandbox setup fails with SHARING VIOLATION on node_repl.exe #51885

Open

Description

@icemanLv99

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

26.1002.7124.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

No response

What issue are you seeing?

I'm experiencing a similar Codex Desktop sandbox initialization failure on Windows 10 22H2.

Codex version: 26.1002.7124.0

Error:

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

Even cmd.exe /d /c ver fails before process creation.

Diagnostic evidence:

  • Sandbox logs identify node_repl.exe runtime read/execute validation failure with Windows os error 32.
  • ProcMon confirms CreateFile → SHARING VIOLATION on cua_node\...\bin\node_repl.exe.
  • A CreateFile → SUCCESS event requests Read Attributes, Synchronize, while the failing operation additionally requests Maximum Allowed.
  • Rebooting, Windows app Repair, and isolating the versioned cua_node runtime did not resolve the issue.

The process responsible for the conflicting file handle has not been identified.

Is this a known Windows sandbox issue, and is there a supported workaround or fixed build?

What steps can reproduce the bug?

Steps to Reproduce

  1. Launch Codex Desktop App on Windows 10 Pro 22H2.

  2. Create a new Codex task.

  3. Ask Codex to execute only the following command:

    cmd.exe /d /c ver

  4. Wait for the command execution attempt (approximately 25–33 seconds).

  5. Observe that execution fails before the command starts.

Actual Result

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

No Windows version output is produced.

Diagnostic Evidence

  • The sandbox log reports runtime read/execute validation failed for cua_node\...\bin\node_repl.exe.
  • Windows error: os error 32.
  • ProcMon confirms CreateFile → SHARING VIOLATION on node_repl.exe.
  • The failing operation requests Read Attributes, Synchronize, Maximum Allowed.

Troubleshooting Already Attempted

  • Restarted Codex Desktop App.
  • Rebooted Windows.
  • Ran Windows App Repair.
  • Renamed the versioned cua_node runtime directory to preserve a backup.

The issue persists after all attempts.

Expected Result

Codex should execute cmd.exe /d /c ver and display the Windows version.

Additional Information

What is the expected behavior?

No response

Additional information

No response

Activity

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

    @rhove-zz

    Potentially related: #51885 reports the same pre-execution setup failure and Windows error 32 on node_repl.exe in Codex Desktop. That reporter also provides ProcMon evidence of CreateFile returning SHARING VIOLATION.

    Our case occurs in the VS Code extension. The symptoms appear closely related, but a shared root cause and the process holding the conflicting handle remain unconfirmed.

  4. autisticeman commented on Oct 8, 2026

    @autisticeman

    Root cause: the conflicting handle belongs to Codex's own node_repl MCP helper (not an unrelated tool)

    We reproduced this on Windows 11 (10.0.26200) with the desktop app 26.1002.7124.0 and identified the process behind the sharing violation, which is the part left open in the report above:

    • The desktop codex.exe spawns %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe (parent process = the app itself) when a session initializes.
    • setup refresh spawns codex-windows-sandbox-setup.exe; its runtime read/execute validation step opens each runtime binary for a "root-only" ACL update (WRITE_DAC). That cannot succeed on a running image, because Windows keeps the image open with FILE_SHARE_READ | FILE_SHARE_DELETE, so the write-open is rejected with os error 32 (ERROR_SHARING_VIOLATION).
    • Which binary is reported only depends on which one is running first. After terminating node_repl.exe, the identical error moved to node.exe in the same bin directory (same MCP server tree), i.e. the conflict is with the app's own helpers:
    runtime read/execute validation failed: validate runtime read/execute access on
    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe:
    open ACL target for root-only update: [file is being used by another process] (os error 32)
    

    Deterministic mechanism (reproducible without any third-party software):

    1. Open the runtime binary from any process with sharing mode Read,Delete (exactly how a running image is shared).
    2. Trigger any sandboxed exec -> setup refresh fails with the same os error 32.
    3. Release the handle -> the same call immediately succeeds: setup refresh: processed 5 write roots ... errors=[].

    So the conflict is self-inflicted: for as long as the app's own MCP helpers are alive, the refresh cannot succeed. Terminating them only helps until the next session init, after which the app re-spawns them - consistent with the "repeatedly stopping the helper is not a durable recovery method" observation in #51932.

    Regression window: the runtime read/execute validation step does not appear anywhere in the sandbox logs of this machine before 2026-10-08; the app was updated that day (previous runtime hash 71e3f41... -> 3dd31cf..., previous app version 26.930.61225). Related: #51822 (merged Oct 7), #51932, #51925.

    Workaround that keeps both the sandbox and the helpers (verified on this machine)

    In %USERPROFILE%\.codex\config.toml:

    [windows]
    sandbox = "unelevated"   # valid values: elevated | unelevated | mxc
    • With unelevated the provisioning step is not invoked at all: no setup refresh spawn, no read-acl handling, no runtime read/execute validation in the log, and the previously failing command runs normally.
    • Sandboxing is still enforced: writing outside the permitted roots is denied (Access is denied.), so this is not equivalent to disabling the sandbox.
    • The value is read when the app session starts, so a full app restart is required after the edit.
    • Caveat: because unelevated skips provisioning, write ACEs are never (re)granted. Existing trusted workspaces keep working here because they already carry Cat\CodexSandboxUsers:(OI)(CI)(M), granted by earlier elevated runs; a newly added workspace folder may be added without write access (see Windows Codex regression: elevated sandbox fails setup refresh; unelevated denies trusted workspace writes #50772). Keeping elevated and instead disabling the node_repl MCP server entry is the alternative if the newer isolation behaviour is required.
  5. globalalex82-lab commented on Oct 8, 2026

    @globalalex82-lab

    I can confirm the same issue on my Windows 10 system.

    Codex Desktop version: 26.1002.7124.0
    Error: helper_unknown_error: setup refresh had errors

    My sandbox log repeatedly reports:

    runtime read/execute validation failed
    validate runtime read/execute access on
    C:\Users\ASUS\AppData\Local\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)
    

    Additional diagnostic findings:

    • Multiple node_repl.exe processes were running simultaneously from the same Codex runtime directory.
    • I identified four instances with PIDs 6276, 20268, 14884, and 11884.
    • I closed Codex and terminated the remaining Codex runtime processes.
    • I verified that no Codex or Node processes remained in the Codex installation directory.
    • After restarting Codex Desktop, the exact same error occurred again at 10:47:24 local time on October 8, 2026.
    • The issue is reproducible and prevents successful Windows Sandbox initialization.

    This suggests a possible conflict between active Codex runtime processes and the sandbox setup process attempting to modify file ACLs.

    Could the Codex team confirm whether this is a known regression in version 26.1002.7124.0 and whether a fix or official workaround is being prepared?

    I would prefer to avoid downgrading or disabling sandbox protections.

    Thank you.

  6. alertgre2-szef commented on Oct 8, 2026

    @alertgre2-szef

    Title: [Windows] Codex sandbox setup fails with SHARING VIOLATION on node_repl.exe — browser tools unusable

    Description

    The Codex functionality in the Windows ChatGPT desktop application is failing across all my projects.

    The main error is:

    windows sandbox failed: helper_unknown_error: setup refresh had errors

    The integrated browser opens websites normally, but Codex cannot read or interact with the opened pages. The browser tool has also reported:

    trusted Node process exited unexpectedly

    Environment

    • OS: Windows
    • Application: ChatGPT desktop application with Codex functionality
    • Codex runtime location: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node
    • Affected runtime: 3dd31cfff853001c
    • Sandbox service: CodexSandboxService.OpenAI.Codex
    • Configuration: sandbox_mode = "workspace-write"

    Diagnostics

    The sandbox log repeatedly reports:

    runtime read/execute validation failed

    The underlying Windows error is:

    The process cannot access the file because it is being used by another process. (os error 32)

    The affected files include:

    • node_repl.exe
    • VCRUNTIME140_1.dll

    Process Monitor confirmed two SHARING VIOLATION events involving codex-windows-sandbox-setup.exe accessing node_repl.exe.

    Microsoft Sysinternals Handle did not detect persistent open handles to node_repl.exe. The lock may be transient or related to concurrent sandbox initialization.

    Troubleshooting already performed

    • Tested multiple projects — all affected.
    • Restarted Windows.
    • Ran the application as administrator.
    • Restarted CodexSandboxService.OpenAI.Codex.
    • Inspected the process tree and background Codex processes.
    • Captured Process Monitor diagnostics.
    • Checked the runtime directory.
    • Renamed the affected cua_node runtime directory to force a fresh initialization attempt.

    None of these steps resolved the issue.

    Basic terminal commands such as git --version work, but the browser tools remain unusable.

    Expected behavior

    Codex should initialize its Windows sandbox successfully and be able to inspect and interact with the integrated browser.

    Actual behavior

    Browser tooling fails during sandbox setup because runtime read/execute access validation encounters a Windows file-sharing violation.

    Request

    Please investigate whether this is a regression in the Windows sandbox initialization or the runtime permission-refresh mechanism.

    It would also be helpful if the desktop application clearly displayed version updates and release information, especially when updates affect sandbox functionality.

    I can provide the sandbox log and Process Monitor captures if needed.

  7. alertgre2-szef commented on Oct 8, 2026

    @alertgre2-szef

    I can confirm the same issue on Windows 10 Pro 22H2 (build 19045.6466), using the ChatGPT desktop application with Codex.

    The integrated browser opens web pages, but Codex cannot inspect them and reports windows sandbox failed: helper_unknown_error: setup refresh had errors. At other times it reports trusted Node process exited unexpectedly. This affects multiple projects.

    The sandbox logs repeatedly show runtime read/execute validation failures on cua_node\...\bin\node_repl.exe, with Windows os error 32 (file in use). ProcMon captured two SHARING VIOLATION events when codex-windows-sandbox-setup.exe accessed this file. Sysinternals Handle did not find a persistent open handle.

    Windows reboot, running as administrator, restarting CodexSandboxService.OpenAI.Codex, and renaming the versioned cua_node runtime directory for regeneration did not resolve the issue. Basic commands such as git --version succeed, while browser automation still fails.

    The config uses sandbox_mode = "workspace-write"; Windows-specific elevated/unelevated mode has not been confirmed. I submitted diagnostics via in-app feedback (Feedback ID available privately). I can provide sanitized logs if requested.

    Is there a supported fix or workaround for this Windows sandbox setup / file-sharing conflict?

  8. LimeError32 commented on Oct 8, 2026

    @LimeError32

    I can reproduce this issue on Windows 10 with Codex Desktop 26.1002.7124.0 (Microsoft Store version).

    I performed the following checks:

    1. Completely exited Codex and confirmed that no node_repl.exe processes remained.
    2. Relaunched Codex without executing any commands. node_repl.exe was not running.
    3. Started a new task requesting only echo CODEX_EXEC_TEST. Execution failed with helper_unknown_error: setup refresh had errors.
    4. Checked the processes again and found that Codex had spawned node_repl.exe, which remained running after the failure.
    5. Sandbox logs confirmed runtime read/execute validation failed on node_repl.exe, with open ACL target for root-only update returning OS error 32 (sharing violation).

    The issue persists after fully restarting Codex. Both PowerShell execution and Node REPL are affected.

    This suggests a possible conflict between runtime process startup and sandbox ACL initialization, although I haven't confirmed the exact locking mechanism.

  9. globalalex82-lab commented on Oct 8, 2026

    @globalalex82-lab

    Update: Rolling back Codex Desktop restored Windows sandbox execution

    I can confirm that rolling back Codex Desktop from 26.1002.7124.0 to 26.930.7945.0 resolved the sandbox execution failure in my initial tests.

    Environment:

    OS: Windows 10

    Affected version: 26.1002.7124.0

    Working version: 26.930.7945.0

    Windows sandbox mode: elevated

    Before rollback:

    Repeated helper_unknown_error: setup refresh had errors.

    Sandbox logs reported os error 32 while attempting to update ACLs on node_repl.exe.

    Terminating Codex and Node REPL processes did not permanently resolve the issue.

    The problem returned after restarting the application.

    Switching to unelevated allowed execution, but I experienced unexpected behavior and did not consider it a suitable permanent workaround.

    After rollback:

    Installed the older, signed MSIX package using Add-AppxPackage -ForceUpdateFromAnyVersion.

    Verified that the installed version is 26.930.7945.0.

    Tested command execution with the Windows sandbox enabled.

    The command returned sandbox-ok and completed successfully.

    The setup refresh had errors message did not occur during this test.

    Result: Rolling back restored basic sandbox command execution while retaining elevated mode.

    This is an initial successful test, not yet confirmation that every Computer Use and browser feature works.

    These results suggest a regression introduced after version 26.930.7945.0.

    Could the OpenAI team investigate the changes to Windows sandbox runtime initialization and ACL refresh between these releases, and confirm when a fix will be available?

  10. Mike440-bit commented on Oct 9, 2026

    @Mike440-bit

    Additional controlled reproduction on Windows 11 (Codex Desktop 26.1002.7124.0)

    Adding independent, sanitized observations to this existing report rather than opening a duplicate. All diagnostic inspection was read-only; I did not change ACLs, security software, proxy settings, or sandbox mode.

    Environment / impact

    • Windows 11 x64, Codex Desktop 26.1002.7124.0; [windows] sandbox = "elevated".
    • Ordinary sandboxed commands (Get-Date, Get-Location) fail before PowerShell starts with Failed to create unified exec process: helper_unknown_error: setup refresh had errors.
    • Sandbox log: runtime read/execute validation failed ... cua_node\\<runtime-hash>\\bin\\node_repl.exe: open ACL target for root-only update ... (os error 32).
    • A local Procmon event captured CreateFile → SHARING VIOLATION for node_repl.exe, with desired access Read Attributes, Synchronize, Maximum Allowed and share mode Read, Write, Delete. The event's initiating process was not directly confirmed from a saved PML; the sandbox setup helper is inferred from matching timestamps.
    • File ACL already includes inherited CodexSandboxUsers: ReadAndExecute.

    Controlled clean-exit test (Oct 9, China local time, UTC+8)

    1. Fully exited the desktop application and verified zero codex.exe, ChatGPT.exe, node_repl.exe, and cua_node\\node.exe processes from that app; only the separately running codex-windows-sandbox-service.exe remained.
    2. A no-write file-open probe that had previously failed with sharing violation now succeeded for both runtime executable files.
    3. Relaunched desktop app at 09:29:25. App-server initialized node_repl / cua_repl around 09:29:35, and several runtime processes started 09:29:42–09:29:47, before any user command.
    4. At 09:29:58, the first Get-Date request spawned codex-windows-sandbox-setup.exe. The sandbox log recorded os error 32 around 09:29:58.949, followed by setup refresh had errors. No further command was attempted.

    This shows that old/orphaned helper processes are not required for reproduction: the new app session launches runtime processes before the first setup refresh. It supports a runtime-startup vs. ACL-validation ordering/shared-file-access conflict; the precise Windows handle owner and source-code defect have not been proven by this test.

    MCP disable-state persistence issue (possible related contributor)

    • Using the supported MCP settings toggle for node_repl emitted config/value/write and mcp_server_enabled_state_updated enabled=false at 09:59:05 and again at 10:12:18. On the latter attempt, config.toml explicitly contained [mcp_servers.node_repl] enabled = false.
    • Between those toggles, at 10:11:57, the app-server initialized node_repl and MCP catalog grew from 4 to 5 servers. After the second toggle, it returned to 4.
    • Static inspection of bundled app code identifies a config/batchWrite path using mergeStrategy: "replace" for the mcp_servers.node_repl section. There was also a config/batchWrite event at 09:59:37, followed by a newly written config without an enabled key in a snapshot at 09:59:42. Hypothesis, not yet proven by logged write parameters: application-managed config refresh may overwrite the user's enabled=false choice. Thus disabling this built-in MCP server has not been a reliable workaround here.

    Request to maintainers

    1. Please ensure runtime ACL refresh can succeed safely while Codex-managed node_repl.exe / node.exe are already running (without reducing sandbox isolation).
    2. Please check whether the app-managed MCP config/batchWrite path unintentionally drops the UI-set enabled=false state.
    3. Is a fixed build or officially supported elevated-sandbox-preserving workaround available?

    Sanitized excerpts/timeline can be provided on request. I am deliberately not posting full process command lines, raw SQLite databases, user paths, private sessions, or credentials.

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