Skip to content

Windows elevated sandbox setup fails when node_repl.exe is running (OS error 32) #52389

Open

Description

@john77leblanc

Environment

  • Windows 11 Home, build 10.0.26300
  • windows.sandbox = "elevated"
  • Affected setup helpers:
    • npm CLI 0.160.1 (@openai/codex-win32-x64, codex-windows-sandbox-setup.exe)
    • App-server daemon 0.161.0 and 0.162.0
  • Codex runtime present at %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe, used by the node_repl MCP server

Observed behavior

Sandboxed Codex commands intermittently fail with:

helper_unknown_error: setup refresh had errors

The sandbox log (~/.codex/.sandbox/sandbox.<date>.log) reports:

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

The same refresh also reports a non-fatal OS error 32 while attempting to update an ACE on the user-profile directory.

Evidence

  • Examined 28 failed sandbox refreshes over approximately 24 hours. All 28 reported the same node_repl.exe file-sharing error.
  • The failures began when node_repl was first used on this machine (~/.codex/node_repl/ created at the time of the first failure), although the cua_node runtime had been installed about two weeks earlier. Approximately 1,060 earlier refreshes in the examined logs had no recorded errors.
  • Failures also occurred with codex exec --ignore-user-config, suggesting the behavior is not controlled solely by the user's [mcp_servers.node_repl] configuration.
  • The executable already had an inherited Modify permission for CodexSandboxUsers. The helper nevertheless failed while opening the target for its ACL operation.
  • In observed sessions, sandbox refreshes resumed succeeding after the sessions hosting node_repl.exe exited and that process terminated.

The relationship between process lifetime and failures is supported by observations and timestamps, but was not captured through simultaneous process and file-handle tracing.

Possible cause (unconfirmed)

The sandbox setup helper may be opening runtime executables with access or sharing flags incompatible with a running executable.

This could cause a Windows sharing violation (ERROR_SHARING_VIOLATION, OS error 32) during ACL validation or modification.

The exact file-opening flags and internal helper behavior have not been verified.

Expected behavior

Codex sandbox initialization should succeed while other Codex sessions are using Codex-provided runtime executables.

Potential fixes to investigate include:

  • Opening ACL targets with compatible sharing flags.
  • Avoiding unnecessary ACL operations when effective permissions are already sufficient.
  • Handling executable-in-use sharing violations without aborting setup, provided sandbox security requirements remain satisfied.

Suggested reproduction (inferred; not deliberately reproduced)

  1. Install or initialize the Codex runtime containing cua_node.
  2. Configure Windows elevated sandbox mode.
  3. Start an interactive Codex session that launches the node_repl MCP server, and confirm node_repl.exe is running.
  4. In another terminal, execute:
codex exec --ignore-user-config -c windows.sandbox="elevated" --sandbox workspace-write "Run git status."
  1. Sandbox initialization may fail with setup refresh had errors. Inspect ~/.codex/.sandbox/sandbox.<date>.log for the sharing violation on node_repl.exe.

Workaround

Exit interactive Codex sessions hosting node_repl.exe and wait for that process to terminate before dispatching another sandboxed Codex worker.

This has restored successful sandbox initialization in the observed cases.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    mcpIssues related to the use of model context protocol (MCP) servers
    on Oct 9, 2026
  2. Hendra827 commented on Oct 9, 2026

    @Hendra827

    This appears to be the same Windows sandbox regression tracked in #51932 and addressed by PR #51822. In my case, 100% of local tasks fail before execution with helper_unknown_error: setup refresh had errors and OS error 32 on an in-use runtime file. Could the team confirm which Desktop release will include the fix, and whether a supported workaround or hotfix is available?

  3. PANART-Dev commented on Oct 9, 2026

    @PANART-Dev

    Additional confirmed reproduction on Windows 10 Pro, 10.0.19045 (build 19045), observed on 9 October 2026. Adding this environment to the existing report instead of opening a duplicate.

    • Configured Windows implementation: windows.sandbox = "elevated".
    • Current task uses a managed workspace-write permission profile.
    • In-app browser automation (cua.getTab and cua.getState) exits before returning browser/page state: trusted Node process exited unexpectedly or node_repl kernel exited unexpectedly.
    • Ordinary sandboxed PowerShell commands also fail before execution. Explicitly approved commands outside the sandbox can run.
    • Sanitized current log excerpt:
    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:
    Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird. (os error 32)
    setup error: setup refresh had errors
    

    A CUA-session reset and a full desktop application restart did not resolve it. Process timestamps confirmed that the app server and helper processes had actually restarted before the new failures. Six node_repl.exe processes were observed afterwards, but the process holding the conflicting file handle was not identified. No processes were forcibly terminated and no ACL/security configuration was modified.

    Browser interaction worked earlier on this machine. The failure now occurs before automation connects to the existing browser tab.

    The merged fix #51822 appears relevant. Please confirm which Windows desktop release includes it, or whether there is a supported recovery procedure for this runtime configuration. The exact desktop app version was not available from the inspected process file metadata; no version is inferred from the runtime hash. Project data, session transcripts, credentials and full logs have been omitted.

  4. asknask commented on Oct 9, 2026

    @asknask

    I don't have as many details as the posters above but I've never been able to get computer-use to work for me (always fails, not just with the latest version).

  5. yuanjie-design commented on Oct 9, 2026

    @yuanjie-design

    Additional confirmed reproduction on Windows 11 Pro, build 26200, observed on 9 October 2026.

    Environment

    • Windows package: OpenAI.Codex 26.1002.7124.0.
    • App updater reports installedVersion 26.1002.52244, build 13536, prod channel. The user reports the in-app Help update check says "is up to date".
    • Bundled CLI: 0.162.0-alpha.2.
    • Configured Windows sandbox: elevated.
    • CUA runtime: cua_node/3dd31cfff853001c.

    Impact and sanitized error

    Both ordinary sandboxed shell commands (including Get-Location) and in-app browser/Node REPL initialization fail before execution. Explicitly approved commands outside the sandbox can run. The failure reproduces with both workspace-write and read-only task permissions.

    helper_unknown_error: setup refresh had errors
    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 log also identified the same sharing violation on the CUA Swift runtime's VCRUNTIME140_1.dll. Process-module inspection confirmed that DLL was loaded by codex-computer-use-swift.exe, whose parent was the desktop application's ChatGPT.exe process. Stopping that helper caused the application to restart it.

    Verified recovery attempts

    1. REPL reset and desktop application restarts did not provide a persistent fix.
    2. An independent helper waited for the desktop application to fully exit, stopped only verified remaining Codex runtime helpers, then ran codex sandbox cmd.exe /d /c echo SANDBOX_OK. This succeeded with exit code 0 at 14:08:53 Asia/Shanghai. After the desktop application reopened, the next sandboxed command failed at 14:11:42 with the same node_repl.exe sharing violation.
    3. A full computer restart was verified using Windows LastBootUpTime (14:32:02 Asia/Shanghai). Shell and browser failures recurred afterwards; the 14:34:14 setup log again identified node_repl.exe and os error 32.
    4. The user then reinstalled the desktop application. Package/CLI versions remained as above, and the 14:41:57 setup log again reported the same error.
    5. Read-only ACL inspection showed that both affected runtime files already grant CodexSandboxUsers ReadAndExecute, Synchronize. This does not establish all effective permissions, but the recorded failure is a sharing violation, not an access-denied error.
    6. The documented MXC compatibility probe with managed configuration and the workspace permission profile returned failed to prepare MXC sandbox: native MXC is unavailable on this executor. No saved configuration was changed by the probe.

    No runtime binaries, ACLs, sandbox mode, or approval policy were manually modified. The desktop reinstall preserved the existing user configuration; this was not a clean-user-profile test. Root cause is not proven, but the observations are consistent with ACL refresh failing when bundled runtime files are in use.

    Please confirm which supported Windows desktop release includes a fix for this failure, and whether a supported recovery or hotfix is available. Personal paths, project content, account credentials, session transcripts, and full logs have been omitted.

  6. dawsongrattidge1 commented on Oct 9, 2026

    @dawsongrattidge1

    Additional reproduction and diagnostics from Codex desktop on Windows, 2026-10-09.

    Environment

    • Windows version reported by the process: Microsoft Windows NT 10.0.26200.0.
    • Installed app package observed in the running process path: OpenAI.Codex_26.1002.7124.0_x64.
    • Bundled core: codex-cli 0.162.0-alpha.2.
    • PowerShell 7, local workspace, workspace-write sandbox with automatic approval review.

    Impact and reproduction observed
    Even a sandboxed Get-Location or Get-Content fails before the command starts:

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

    The same read-only diagnostic commands run successfully outside the sandbox through approved escalation. The Node REPL also reported trusted Node process exited unexpectedly; kernel reset, rerun your request.

    Sanitized sandbox log evidence

    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
    

    After terminating the Codex JavaScript kernels, the next failing target became:
    bin\node_modules\@oai\sky\bin\windows\swift\x64\VCRUNTIME140_1.dll.

    A Windows Restart Manager resource query for that DLL identified codex-computer-use-swift.exe as its user. Stopping that helper did not resolve the issue: the app immediately respawned it. Its observed parent was the app's ChatGPT.exe process.

    Diagnostic workaround and outcome (not a supported or durable fix)
    We preserved the loaded originals outside the runtime validation directory and replaced the affected runtime binaries with copies whose SHA-256 hashes matched the originals. Targets included the Swift helper executable, its three Microsoft runtime DLLs, and subsequently bin\node.exe. No executable contents or sandbox policy settings were changed.

    After these changes, normal sandbox commands succeeded. We verified reading an existing workspace file, creating a temporary file, reading it, editing it, and deleting it. All passed without escalation.

    However, at 18:13 UTC on the same day, a later sandboxed read failed again, with the log once more naming bin\node_repl.exe and OS error 32. The recovery was temporary and appears dependent on helper process lifetime.

    Expected behavior / investigation request
    Sandbox setup should work while Codex-provided JavaScript and computer-use helpers are running. Please investigate runtime ACL validation/update handles and compatibility with loaded executables/DLLs, and provide a supported durable fix. Exact internal file-opening flags have not been inspected; the sharing-mode explanation remains a hypothesis supported by the above observations.

    Only sanitized diagnostic excerpts are included; no workspace contents, credentials, or full session transcripts are attached.

  7. BEN2GOYVR commented on Oct 9, 2026

    @BEN2GOYVR

    Additional reproduction details from an affected Windows 11 Home environment:

    • Codex CLI: 0.162.0 (npm, @openai/codex)
    • Windows: 11 Home, build 26200, x64
    • PowerShell: 7.6.6
    • Orca: 1.4.221 (also reproducible outside Orca)
    • Sandbox backend: elevated

    Minimal independent reproduction (in PowerShell 7, outside Orca):

    codex sandbox -- pwsh -NoProfile -Command "Get-Date"

    Result:

    windows sandbox failed: helper_unknown_error: setup refresh had errors
    

    The same failure occurs before execution of harmless commands such as Get-Date or Get-Location from Orca/Codex.

    Diagnostics:

    • codex doctor --summary: 20 ok, 1 idle, 5 notes, 3 warn, 1 fail. The failure is elevated Windows sandbox provisioning recorded a structured failure.
    • Sandbox logs identify runtime read/execute validation failed on %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe, with open ACL target for root-only update returning OS error 32 (file in use by another process).
    • An earlier log also mentioned an access-denied warning concerning C:\Users\Default (OS error 5); its relationship to the primary failure is unconfirmed.
    • Resource Monitor's Associated Handles search for node_repl.exe returned no result when checked.
    • codex --version and codex --help work; Doctor reports installation, authentication, local DBs and connectivity healthy.

    Recovery attempted without success:

    • Restarting Orca and Windows.
    • Reinstalling the same Codex CLI 0.162.0 via the official npm registry. npm reported an EPERM cleanup warning for codex-code-mode-host.exe while replacing files, but the CLI remains operational.
    • Checking Windows Defender protection history: no relevant block was found.

    I have not disabled the sandbox, changed ACLs, granted Defender exclusions, or deleted runtime files.

    Could you confirm whether this is a known runtime lifecycle / elevated sandbox ACL coordination issue and recommend a supported fix that preserves existing authentication, sessions and repositories?

  8. enrico-f commented on Oct 10, 2026

    @enrico-f

    Additional reproduction — Codex CLI 0.162.1 on Windows

    I can confirm that the same issue is reproducible on my Windows development workstation.

    Environment

    • Codex CLI: 0.162.1, installed globally via npm
    • Windows machine: Lenovo T480
    • Windows sandbox configuration: elevated
    • Project: local Git repository
    • Execution mode: workspace-write, approval policy on-request

    Observed behavior

    Any command executed from an interactive Codex session fails during sandbox initialization, including harmless read-only commands such as Get-Location.

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

    The sandbox log consistently identifies the underlying error:

    runtime read/execute validation failed:
    validate runtime read/execute access on
    ...\OpenAI\Codex\runtimes\cua_node\...\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)
    

    Troubleshooting performed

    1. Updated Codex CLI from 0.162.0 to 0.162.1.
    2. Successfully executed a standalone sandbox test using codex sandbox cmd /d /c echo CODEX_SANDBOX_OK.
    3. Confirmed the sandbox executes commands under the dedicated codexsandboxoffline Windows account.
    4. Terminated the Codex Desktop application and remaining Codex app-server daemon processes.
    5. Repeated tests with the elevated sandbox: same initialization failure.
    6. Tested unelevated: command execution also failed, with a CreateProcessAsUserW error.
    7. Temporarily disabled the node_repl MCP server: no improvement.
    8. Tested execution of Get-Location: failed before PowerShell could run.
    9. Used Microsoft Sysinternals Handle to search for open handles associated with node_repl.exe: no matching handles found.

    Additional observation

    The standalone codex sandbox diagnostic works, whereas normal interactive Codex sessions fail. The diagnostic and interactive execution paths appear to use different sandbox setup configurations.

    Disabling the node_repl MCP server does not prevent the interactive sandbox initialization from validating access to node_repl.exe.

    Expected behavior

    The Windows sandbox should initialize successfully and execute commands permitted by workspace-write, without requiring users to disable sandbox protections.

    Request

    Could the maintainers confirm whether a fix for this runtime ACL sharing violation is included in an upcoming stable Codex CLI release?

    Thank you for investigating this issue.

  9. acquirenti-cell commented on Oct 11, 2026

    @acquirenti-cell

    Ulteriore caso verificato su Windows l'11 ottobre 2026 (interfaccia italiana).

    Ambiente: pacchetto desktop OpenAI.Codex 26.1002.7124.0 x64; configurazione windows.sandbox = "elevated". Il servizio CodexSandboxService.OpenAI.Codex risulta in esecuzione.

    Fatti verificati:

    • La chat interessata risulta active con activeFlags=["waitingOnApproval"].
    • Comandi elementari Get-Location e Get-ChildItem falliscono prima dell'avvio con "Failed to create unified exec process: helper_unknown_error: setup refresh had errors".
    • setup_error.json conferma code=helper_unknown_error e message="setup refresh had errors".
    • Il registro sandbox dell'11 ottobre riporta ripetutamente: "runtime read/execute validation failed ... cua_node\3dd31cfff853001c\bin\node_repl.exe: open ACL target for root-only update: Impossibile accedere al file. Il file è utilizzato da un altro processo. (os error 32)". Seguono "setup refresh completed with errors" e uscita con codice 1. Ultimo episodio controllato alle 18:00:07 UTC.
    • Durante la diagnosi erano presenti otto processi node_repl.exe sullo stesso percorso. Non è stato identificato il singolo handle responsabile.
    • Alcuni successivi comandi di salvataggio risultano riusciti, ma la chat è nuovamente in attesa di approvazione. L'invio di un messaggio di ripresa non ha rimosso l'attesa.

    Problema aggiuntivo riportato dall'utente: dopo aver selezionato l'approvazione per la sessione, ricompare una richiesta apparentemente identica. La schermata mostra "Command approval", "Approve", "Approve for session", "Decline", mentre il testo della richiesta è in italiano. Non è stato verificato se le richieste sottostanti siano identiche o se cambi il comando; non affermiamo che la persistenza delle approvazioni sia la causa primaria.

    Richiesta: correggere il conflitto nell'inizializzazione della sandbox senza disabilitare le protezioni, chiarire il motivo delle nuove approvazioni e tradurre il dialogo in italiano. Nessun file di lavoro, dato dei contatti, identificativo della chat o percorso personale è allegato.

  10. Michaelnb86 commented on Oct 12, 2026

    @Michaelnb86

    Additional direct file-use evidence from an affected Codex Desktop session on 2026-10-12 (Asia/Shanghai):

    • Desktop package observed in the running app path: OpenAI.Codex_26.1002.7124.0_x64; bundled CLI reports 0.162.0-alpha.2.
    • Both Computer Use/Node REPL initialization and ordinary sandboxed PowerShell fail before execution with helper_unknown_error: setup refresh had errors. An explicitly approved command outside the sandbox runs.
    • The sandbox log repeatedly records runtime read/execute validation failed while opening %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe for a root-only ACL update, returning Windows os error 32 (file in use).
    • I queried that exact executable via the Windows Restart Manager APIs (RmRegisterResources + RmGetList) while the failure was active. The query returned four associated processes, all node_repl.exe running from the same executable path. Two were direct children of the Codex app-server process; the other two were children of its CUA REPL node.exe processes. This is direct, simultaneous file-use evidence, not only a process-name inference.
    • Restarting the desktop app and the computer did not resolve the recurring failure. No processes were terminated, and no ACLs, runtime binaries, or sandbox settings were changed.

    This does not reveal the setup helper's exact file-open/share flags, but it narrows the failure to ACL validation of an executable that other Codex runtime processes are actively using. Please confirm whether a supported desktop build includes a fix for this concurrency case. Personal paths, account details, project data, and full logs are omitted.

  11. lmsworking commented on Oct 13, 2026

    @lmsworking

    Additional reproduction: managed daemon 0.162.1, runtime process lifetime, and sandbox setup source comparison

    I reproduced the Windows sandbox ACL sharing violation on October 13, 2026 (Asia/Taipei).

    Environment

    • Windows 11
    • Codex managed app-server daemon: 0.162.1
    • Another Codex app-server executable under %LOCALAPPDATA%\OpenAI\Codex\bin\
    • Affected runtime: %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\cfb32733c877621e\bin\node_repl.exe

    Observed failure

    Even a basic PowerShell command such as Get-Location fails before execution:

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

    The sandbox log identifies:

    runtime read/execute validation failed:
    validate runtime read/execute access on
    ...\cua_node\cfb32733c877621e\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)
    

    Process hierarchy

    The managed app-server daemon had the following active descendants:

    codex.exe (PID 53280)
      app-server --listen unix:// --managed-daemon
      |
      +-- node_repl.exe (PID 62700)
      |
      +-- node.exe (PID 61320)
            @oai/cua-repl/bin/cua-repl.mjs
            |
            +-- node_repl.exe (PID 42660)
    

    Both node_repl.exe processes were executing the same runtime executable.

    Verified timeline (local time, UTC+8)

    Time Event
    15:59:46 Managed codex.exe started
    19:15:06 node_repl.exe PID 62700 and node.exe PID 61320 started
    19:15:08 node_repl.exe PID 42660 started
    19:15:27.608 Sandbox setup refresh spawned
    19:15:28.516 Runtime ACL validation failed with OS error 32
    19:15:28.624 Sandbox setup exited with status 1

    This establishes that both runtime processes existed before the failing sandbox refresh. The exact file handle responsible for the sharing violation has not been independently identified.

    Successful versus failing setup sources

    The same day's sandbox log contained repeated successful refreshes using:

    %LOCALAPPDATA%\OpenAI\Codex\bin\<build>\
    codex-windows-sandbox-setup.exe
    

    Those refreshes completed with errors=[], using a command runner identified as 0.162.0-alpha.17.2.

    Failing refreshes were launched from:

    %USERPROFILE%\.codex\packages\app-server-daemon\
    releases\0.162.1-x86_64-pc-windows-msvc\
    codex-resources\codex-windows-sandbox-setup.exe
    

    This is a correlation, not proof of a version-specific regression, because runtime and process states also differed.

    Recovery attempts

    • Restarted the sandbox service — failure persisted.
    • Reinstalled the desktop application — temporarily restored functionality, but the failure returned.
    • Terminated two existing node_repl.exe processes — new runtime processes appeared and the same failure recurred.
    • Reproduction remained possible using a basic read-only shell command.

    Related upstream fix

    PR #51822, Avoid sharing violations when repairing Windows runtime ACLs, was merged on October 7, 2026.

    #51822

    The documented change from MAXIMUM_ALLOWED to READ_CONTROL | WRITE_DAC for file ACL operations appears directly relevant to this failure.

    Questions for maintainers

    1. Does the managed app-server daemon 0.162.1 include PR Avoid sharing violations when repairing Windows runtime ACLs #51822?
    2. Which production Windows Desktop and managed-daemon releases include the fix?
    3. Is there a supported update or recovery path that preserves the normal sandbox security model?
    4. Should the sandbox runtime ACL validation be guaranteed to complete before the CUA runtime starts, or should the validation itself tolerate active executable images?

    I can provide additional sanitized log excerpts if needed.

  12. Louis-1991 commented on Oct 13, 2026

    @Louis-1991

    Confirmed workaround on Windows – Codex CLI 0.162.1

    I encountered the same Windows sandbox issue with Codex CLI 0.162.1.

    Every command failed with:

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

    Even a simple Get-Location command could not execute.

    Root cause observed

    The sandbox log showed:

    runtime read/execute validation failed
    node_repl.exe: The process cannot access the file
    because it is being used by another process.
    (os error 32)
    

    Restarting Windows did not resolve the problem.

    Switching temporarily to windows.sandbox="unelevated" allowed commands to execute, but I wanted to restore the normal Windows sandbox.

    What worked for me

    Step 1 – Completely close Codex

    Exit Codex CLI.

    Step 2 – Identify remaining Codex processes

    Open a separate PowerShell window:

    Get-Process node_repl,node,codex -ErrorAction SilentlyContinue |
    Select-Object ProcessName,Id,Path

    In my case, two codex.exe processes and two node_repl.exe processes were still running after closing Codex.

    Step 3 – Terminate only the remaining Codex processes

    Use the process IDs identified in Step 2.

    Example:

    Stop-Process -Id <PID1>,<PID2> -Force

    Replace the placeholders with your actual process IDs.

    Do not terminate unrelated Node.js processes.

    Run the process check again to confirm that no Codex runtime processes remain.

    Step 4 – Locate the affected runtime directory

    Get-ChildItem "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node"

    My affected runtime directory was:

    b58ca2eaa616c2da
    

    Your runtime directory name may be different.

    Step 5 – Rename the runtime directory

    Instead of deleting the runtime, I renamed it to keep a backup:

    Rename-Item `
    "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\b58ca2eaa616c2da" `
    "b58ca2eaa616c2da_BACKUP"

    Important: Replace the runtime directory name with the one found on your system.

    Step 6 – Start Codex normally

    codex

    No unelevated override was used.

    Step 7 – Verify sandbox execution

    Inside Codex, I requested:

    Get-Location

    Result:

    Ran Get-Location
    C:\Users\<USER>\Documents\<PROJECT>
    

    SUCCESS!

    The normal Windows sandbox was working again.

    Conclusion

    Renaming the existing cua_node runtime directory allowed Codex to recreate it.

    This resolved the sandbox initialization failure on my installation.

    No Codex reinstall was necessary.

    No Windows ACL or security permission changes were required.

    No project files were modified.

    The original runtime directory was preserved as a backup.

    This is a locally confirmed workaround, not necessarily a universal or permanent fix.

    Hopefully this helps others experiencing the same issue!

    GOOD LUCK!

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

    CLIIssues related to the Codex CLIbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) serverssandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions