Skip to content

Windows: Codex App local execution fails with “setup refresh had errors” on a long runtime path #50268

Open

Description

@edumelen

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

26.930.21537

What subscription do you have?

Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Possibly related to #49433: both cases fail during cua_node runtime read/execute validation with CreateFileW and exit status 1.
However, my failure targets a 283-character dependency directory, rather than an inaccessible node_repl.exe from an old runtime. The directory is accessible using an extended-length path and a shortened path, and its ACL includes RX for CodexSandboxUsers. Enabling LongPathsEnabled and restarting Windows did not resolve it.
The same top-level execution error is also reported in #49017, #49234, #49851, and #48979.

Problem

Codex desktop on Windows repeatedly fails to start local commands with:

  • EXECUTION_ENVIRONMENT_UNAVAILABLE
  • helper_unknown_error: setup refresh had errors

This blocks work across multiple projects. The failure occurs during sandbox setup, before the requested PowerShell command can execute.

Environment

  • OS: Windows; exact version/build not yet collected.
  • Initially verified Codex version: 26.928.21956, build 12404.
  • After fully terminating and reopening the application, verified version: 26.928.31416, build 12553.
  • The application was restarted again later, but its version was not rechecked.
  • Local command runner: bundled PowerShell (pwsh.exe).
  • Personal paths have been anonymized below.

Steps to reproduce

  1. Open Codex desktop on Windows.

  2. Open a local chat/project.

  3. Ask Codex to execute a simple PowerShell command, such as:

    Write-Output 'CODEX_ENVIRONMENT_OK'
  4. Local execution fails during sandbox setup.

The issue is recurrent and affects multiple projects.

Expected behavior

Sandbox setup should complete and the PowerShell command should execute.

Actual behavior

codex-windows-sandbox-setup.exe starts, completes the read-ACL step, and then fails while validating runtime read/execute access to a directory inside the cached cua_node runtime.

It exits with status 1, preventing local execution.

The failing original path contains 283 characters:

C:\Users\USUARIO\AppData\Local\OpenAI\Codex\runtimes\cua_node\57937f104cca4dc5\bin\node_modules\@oai\sky\dist\js-dependency-cache\shared-v1\applied-bk-agent-openai-js\pnpm-store\v11\links\@rollup\plugin-typescript\12.1.2\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142

USUARIO replaces the actual Windows username, so the anonymized path length differs from the original.

Troubleshooting performed

  1. Fully terminated Codex through Task Manager and reopened it.

    • The application version changed.
    • Local execution continued to fail.
  2. Checked Windows long-path configuration.

    • Initially, LongPathsEnabled was 0.
    • Changed it to 1 from an elevated PowerShell session and restarted Windows.
    • Local execution still failed on the same runtime path.
  3. Queried the path from PowerShell outside Codex.

    • Without the extended-length prefix, the initial Get-Item and icacls checks reported that the path could not be found.
    • With the \\?\ prefix, the directory was accessible.
    • Its attributes were Directory; no link type was reported.
  4. Checked the directory ACLs using the extended-length path.

    • The directory exists.
    • CodexSandboxUsers has inherited read/execute permissions.
    • The Windows user, SYSTEM, and Administrators have inherited full control.

    Anonymized ACL output:

    EQUIPO\CodexSandboxUsers:(I)(OI)(CI)(RX)
    NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
    BUILTIN\Administradores:(I)(OI)(CI)(F)
    EQUIPO\USUARIO:(I)(OI)(CI)(F)
    
  5. Mapped the runtime root to a temporary drive using subst and queried the same directory through a shorter path.

    • icacls reported: 1 file processed successfully, 0 failures.
    • This was a test under the regular Windows user, not under the sandbox process identity.

No runtime cache or sandbox state has been deleted, and no broad ACL changes have been applied.

Relevant log excerpt

The excerpt below is from the failed attempt after enabling long paths and restarting Windows. Only the username has been replaced.

[2026-10-02 10:54:30.588 codex.exe] START: C:\Users\USUARIO\.cache\codex-runtimes\codex-primary-runtime\dependencies\native\powershell\pwsh.exe -NoProfile -Command try { [Console]::OutputEncoding=[System.Text.Encoding]::UTF8 } catch {}
Write-Out
[2026-10-02 10:54:31.186 codex.exe] setup refresh: spawning C:\Users\USUARIO\AppData\Local\OpenAI\Codex\bin\be3fd7e5c1969ff6\codex-windows-sandbox-setup.exe (cwd=C:\Users\USUARIO\AppData\Local\OpenAI\Codex\bin\be3fd7e5c1969ff6, payload_len=4012)
[2026-10-02T08:54:35.211008900+00:00] read-acl-only mode: applying read ACLs
[2026-10-02T08:54:35.252635400+00:00] granting read ACE to C:\Users\USUARIO\Streaming de Google Drive\ for sandbox users
[2026-10-02T08:54:35.256304800+00:00] read ACL run completed
[2026-10-02T08:54:40.412264300+00:00] runtime read/execute validation failed: validate runtime read/execute access on C:\Users\USUARIO\AppData\Local\OpenAI\Codex\runtimes\cua_node\57937f104cca4dc5\bin\node_modules\@oai\sky\dist\js-dependency-cache\shared-v1\applied-bk-agent-openai-js\pnpm-store\v11\links\@rollup\plugin-typescript\12.1.2\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142: CreateFileW failed for C:\Users\USUARIO\AppData\Local\OpenAI\Codex\runtimes\cua_node\57937f104cca4dc5\bin\node_modules\@oai\sky\dist\js-dependency-cache\shared-v1\applied-bk-agent-openai-js\pnpm-store\v11\links\@rollup\plugin-typescript\12.1.2\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142
[2026-10-02T08:54:40.463720+00:00] setup refresh: processed 4 write roots (read roots delegated); errors=["runtime read/execute validation failed: validate runtime read/execute access on C:\\Users\\USUARIO\\AppData\\Local\\OpenAI\\Codex\\runtimes\\cua_node\\57937f104cca4dc5\\bin\\node_modules\\@oai\\sky\\dist\\js-dependency-cache\\shared-v1\\applied-bk-agent-openai-js\\pnpm-store\\v11\\links\\@rollup\\plugin-typescript\\12.1.2\\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142: CreateFileW failed for C:\\Users\\USUARIO\\AppData\\Local\\OpenAI\\Codex\\runtimes\\cua_node\\57937f104cca4dc5\\bin\\node_modules\\@oai\\sky\\dist\\js-dependency-cache\\shared-v1\\applied-bk-agent-openai-js\\pnpm-store\\v11\\links\\@rollup\\plugin-typescript\\12.1.2\\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142"]
[2026-10-02T08:54:40.463811800+00:00] setup refresh completed with errors: ["runtime read/execute validation failed: validate runtime read/execute access on C:\\Users\\USUARIO\\AppData\\Local\\OpenAI\\Codex\\runtimes\\cua_node\\57937f104cca4dc5\\bin\\node_modules\\@oai\\sky\\dist\\js-dependency-cache\\shared-v1\\applied-bk-agent-openai-js\\pnpm-store\\v11\\links\\@rollup\\plugin-typescript\\12.1.2\\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142: CreateFileW failed for C:\\Users\\USUARIO\\AppData\\Local\\OpenAI\\Codex\\runtimes\\cua_node\\57937f104cca4dc5\\bin\\node_modules\\@oai\\sky\\dist\\js-dependency-cache\\shared-v1\\applied-bk-agent-openai-js\\pnpm-store\\v11\\links\\@rollup\\plugin-typescript\\12.1.2\\a522fe9000e9cb07598cb89328c5f87afda445b7562f1579b3d4e1f77197a142"]
[2026-10-02T08:54:40.463888600+00:00] setup error: setup refresh had errors
[2026-10-02 10:54:40.463 codex-windows-sandbox-setup.exe] setup error: setup refresh had errors
[2026-10-02 10:54:40.490 codex.exe] setup refresh: exited with status ExitStatus(ExitStatus(1))

Investigation request

Please investigate whether the runtime validation helper handles paths longer than MAX_PATH correctly.

Long-path handling is a hypothesis, not a confirmed root cause. The directory exists and is accessible through an extended-length or shortened path, but these checks do not establish effective access under the sandbox identity.

The log reports only CreateFileW failed, without the Windows error code. Including the GetLastError value and message would help distinguish path-length handling, access denial, and other causes.

Please also advise on a supported recovery procedure for the affected runtime that preserves existing projects, chat history, and configuration.

What steps can reproduce the bug?

  1. Open the Codex desktop app on the affected Windows machine.
  2. Open a local project or chat.
  3. Ask Codex to run a minimal PowerShell command:
    Write-Output 'CODEX_ENVIRONMENT_OK'
  4. The command fails before execution with:
    helper_unknown_error: setup refresh had errors
  5. Check %USERPROFILE%.codex.sandbox\sandbox*.log. The log shows “runtime read/execute validation failed” and “CreateFileW failed” on a 283-character directory path inside the cua_node runtime.
  6. Fully terminate and reopen Codex, then retry. The failure persists.
  7. Enable LongPathsEnabled=1, restart Windows, and retry. The same failure persists.

These steps reproduce the failure on my existing installation. I have not established how to reproduce the underlying runtime state on a clean installation.1. Open the Codex desktop app on the affected Windows machine.
2. Open a local project or chat.
3. Ask Codex to run a minimal PowerShell command:
Write-Output 'CODEX_ENVIRONMENT_OK'
4. The command fails before execution with:
helper_unknown_error: setup refresh had errors
5. Check %USERPROFILE%.codex.sandbox\sandbox*.log. The log shows “runtime read/execute validation failed” and “CreateFileW failed” on a 283-character directory path inside the cua_node runtime.
6. Fully terminate and reopen Codex, then retry. The failure persists.
7. Enable LongPathsEnabled=1, restart Windows, and retry. The same failure persists.

These steps reproduce the failure on my existing installation. I have not established how to reproduce the underlying runtime state on a clean installation.

What is the expected behavior?

Codex should initialize the Windows sandbox successfully and execute local PowerShell commands.

Runtime validation should handle paths longer than 260 characters correctly when long-path support is enabled.

If validation fails, Codex should report the underlying Windows error code and provide recovery instructions that preserve existing projects, conversations, and configuration.

Additional information

No response

Activity

  1. added
    app
    on Oct 2, 2026
  2. added
    bug
    windows-os
    sandbox
    on Oct 2, 2026
  3. runformw-a11y commented on Oct 3, 2026

    @runformw-a11y

    I am also affected on Windows 10 Pro 22H2, build 19045.6466, desktop version 26.930.21537, with elevated sandbox enabled.

    Even Get-Location fails before execution:
    helper_unknown_error: setup refresh had errors

    My failing cua_node dependency path is 282 characters long and also ends under:
    @rollup\plugin-typescript\12.1.2<hash>

    LongPathsEnabled is already 1. The directory exists and CodexSandboxUsers has ReadAndExecute permission.

    A read-only CreateFileW probe fails with error 3 using the ordinary path, but succeeds with the \?\ prefix.

    App restart, PC restart, Windows app Repair, and browser runtime reset did not resolve it. Terminal, browser/computer-use, and apply_patch remain affected.

    Please advise on a supported fix that preserves local data and security isolation.

  4. runformw-a11y commented on Oct 3, 2026

    @runformw-a11y

    Additional diagnostic details:

    Full failing runtime path (282 characters):
    C:\Users\user\AppData\Local\OpenAI\Codex\runtimes\cua_node\e7fe122ad3cbcd58\bin\node_modules@oai\sky\dist\js-dependency-cache\shared-v1\applied-bk-agent-openai-js\pnpm-store\v11\links@rollup\plugin-typescript\12.1.2\bf978194e78e4126a616bfdc5a9fea913609f48ddc1a68ce028d4322c58982dd

    Sandbox log:
    C:\Users\user.codex.sandbox\sandbox.2026-10-03.log

    Repeated log messages:
    runtime read/execute validation failed
    CreateFileW failed
    setup refresh completed with errors

    The app update checker reports restart_required even after an observed application restart. Update activation remains unconfirmed.

    Windows app Repair completed successfully, but normal tools still fail.

    We have not switched to unelevated or mxc, relocated CODEX_HOME, changed ACLs, or deleted runtime files.

    Please provide a supported recovery that preserves local conversations, projects, login state, and security isolation.

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