Windows Desktop node_repl fails with os error 740 due to UAC installer detection on codex-windows-sandbox-setup.exe

Resolved 💬 7 comments Opened Jun 4, 2026 by daisaki51 Closed Jun 12, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

Codex Desktop for Windows fails to start node_repl because Windows sandbox setup refresh cannot spawn codex-windows-sandbox-setup.exe from the AppData runtime cache.

This appears to be the same root cause as #24050 and related to #25419 / #25362, but I am adding a current Store Desktop reproduction with additional diagnostics that strongly confirm Windows UAC installer-detection behavior based on the helper filename.

Environment

  • OS: Windows 11 Pro, 10.0.26200, x64
  • Codex Desktop Store package: OpenAI.Codex_26.602.3474.0_x64__2p2nqsd0c76g0
  • Codex bundled browser/chrome plugin version observed: 26.602.30954
  • Codex CLI/runtime in AppData: 0.137.0 era runtime, with codex.exe under %LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex.exe
  • Node runtime: node.exe under %LOCALAPPDATA%\OpenAI\Codex\bin\5b9024f90663758b\node.exe
  • Integrity/elevation context: user token is not elevated; medium integrity
  • UAC policy: EnableLUA=1, EnableInstallerDetection=1

Reproduction

  1. Launch Codex Desktop from the Microsoft Store app.
  2. Start a local thread on Windows.
  3. Execute the minimal node_repl smoke test:
nodeRepl.write(JSON.stringify({ ok: true, cwd: nodeRepl.cwd }))

Actual result

The kernel exits immediately:

node_repl kernel exited unexpectedly
node_repl diagnostics: {
  "kernel_stderr_tail": "windows sandbox failed: spawn setup refresh",
  "reason": "stdout_eof"
}

The sandbox log shows:

START: %LOCALAPPDATA%\OpenAI\Codex\bin\5b9024f90663758b\node.exe --experimental-vm-modules ...\kernel.js ...
setup refresh: spawning %LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex-windows-sandbox-setup.exe (...)
setup refresh: failed to spawn ...\codex-windows-sandbox-setup.exe: The requested operation requires elevation. (os error 740)

This also prevents the Browser / Chrome plugin path that depends on node_repl from starting.

Diagnostics performed

  • Repaired, reset, uninstalled, and reinstalled Codex Desktop.
  • Verified there is no separate Web/Desktop install registered through normal uninstall registry entries; winget list Codex only shows the Store package.
  • Verified the AppData helper and Store resources helper are byte-identical:
  • codex-windows-sandbox-setup.exe SHA256: C1FE23AAAC3439F73CEA122BA703ECE302ACA5BB356CAB8C7FAEB894DF69CC30
  • Authenticode signature for codex.exe and codex-windows-sandbox-setup.exe is valid and signed by OpenAI.
  • No embedded requestedExecutionLevel, requireAdministrator, highestAvailable, asInvoker, autoElevate, or trustInfo strings were found in the helper binary.
  • Defender/AppLocker/CodeIntegrity logs did not show a direct block for the helper.
  • Smart App Control had previously blocked a chrome extension host, but was disabled and the OS was restarted before this reproduction.

Filename-based UAC installer detection evidence

The same helper binary behaves differently depending only on filename.

Copied from the AppData runtime helper to %TEMP% / C:\tmp:

  • codex-windows-sandbox-setup-test.exe: fails to start with The requested operation requires elevation.
  • codex-sandbox-helper-test.exe: starts successfully and then exits with the expected helper argument decoding error because no real payload was supplied.

Using System.Diagnostics.ProcessStartInfo with UseShellExecute=false:

codex-sandbox-helper-test.exe
=> Started=true, ExitCode=1, stderr="helper_request_args_failed..."

codex-windows-sandbox-setup-test.exe
=> Started=false, error="The requested operation requires elevation"

This strongly suggests Windows UAC installer detection is triggered by the setup filename when no explicit asInvoker manifest is present.

Workaround confirmation

When launching the AppData codex.exe sandbox ... smoke test with __COMPAT_LAYER=RunAsInvoker inherited, sandbox setup refresh succeeds:

$env:__COMPAT_LAYER = 'RunAsInvoker'
& "%LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex.exe" sandbox `
  "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" `
  -NoProfile -Command "Write-Output ok"

Result:

ok
exit=0

The sandbox log then shows:

setup refresh: spawning ...\codex-windows-sandbox-setup.exe (...)
setup refresh: processed 0 write roots (read roots delegated); errors=[]
setup binary completed

I also added this to the local node_repl MCP env as a workaround:

__COMPAT_LAYER = "RunAsInvoker"

I have not yet confirmed the full Desktop node_repl path after app restart, but the direct inherited-env sandbox smoke test succeeds.

Expected result

node_repl should start without requiring UAC elevation, and sandbox setup refresh should not be classified by Windows as an installer/elevation request.

Suggested fix

Please embed an explicit application manifest in codex-windows-sandbox-setup.exe, for example:

<requestedExecutionLevel level="asInvoker" uiAccess="false" />

Alternatively, rename the helper so it does not match Windows installer-detection heuristics, but an explicit manifest seems safer.

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #25419
  • #25362
  • #25366
  • #26110
  • #26398

Powered by Codex Action

cruiseben-create · 1 month ago

I can reproduce what looks like the same issue on another Windows Codex Desktop machine.

Environment

  • Codex Desktop Store package observed in logs: OpenAI.Codex_26.602.3474.0_x64__2p2nqsd0c76g0
  • Runtime cache helper path: %LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex-windows-sandbox-setup.exe
  • node_repl.exe path: %LOCALAPPDATA%\OpenAI\Codex\bin\34ab3e1324cc55b5\node_repl.exe
  • Node used by node_repl path in sandbox log: %LOCALAPPDATA%\OpenAI\Codex\bin\5b9024f90663758b\node.exe
  • OS version from PowerShell: Microsoft Windows NT 10.0.26200.0
  • Get-ComputerInfo reported WindowsProductName: Windows 10 Pro, WindowsVersion: 2009 (build field was blank in this environment)

Symptom

Even a minimal node_repl smoke test fails before running any JavaScript:

nodeRepl.write(JSON.stringify({ ok: true, cwd: nodeRepl.cwd }))

Tool result:

node_repl kernel exited unexpectedly
node_repl diagnostics: {"kernel_status":"running","kernel_stderr_tail":"windows sandbox failed: spawn setup refresh","reason":"stdout_eof"}

This prevents the Browser runtime from bootstrapping because the Browser plugin depends on the trusted node_repl path.

Relevant sandbox log evidence

Sanitized log excerpt:

START: %LOCALAPPDATA%\OpenAI\Codex\bin\5b9024f90663758b\node.exe --experimental-vm-modules ...\kernel.js ...
setup refresh: spawning %LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex-windows-sandbox-setup.exe (...)
setup refresh: failed to spawn ...\codex-windows-sandbox-setup.exe: The requested operation requires elevation. (os error 740)

Ordinary shell sandbox setup in the same session succeeds via the packaged WindowsApps helper:

setup refresh: spawning C:\Program Files\WindowsApps\OpenAI.Codex_26.602.3474.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe
setup refresh: processed 3 write roots (read roots delegated); errors=[]
setup binary completed

Diagnostics tried

  • Cleared/rebuilt %LOCALAPPDATA%\OpenAI\Codex\bin by moving cache directories to a backup folder and restarting Codex.
  • Confirmed the cache was regenerated, including fb2111b91430cb17.
  • Confirmed the AppData helper and packaged WindowsApps helper were byte-identical in the earlier cache: same length and SHA256.
  • Confirmed system Node itself works (node --version and node -e succeed), so the failure is specific to the Codex-managed node_repl sandbox setup path.
  • Confirmed an elevated Windows Terminal has Mandatory Label\High Mandatory Level.
  • Launching Codex from elevated Terminal still resulted in Codex tool execution reporting medium integrity / non-admin token in this session, and node_repl continued to fail with the same os error 740 sandbox setup path.

This matches the suspected UAC installer-detection behavior for codex-windows-sandbox-setup.exe and the current Store Desktop runtime path.

tawanerguo-cn · 1 month ago

I am seeing the same issue again on another Windows machine, and the path churn makes the current RUNASINVOKER workaround quite fragile.

Additional reproduction

Environment observed in logs:

  • Windows 11, build 10.0.26200, zh-CN locale
  • Codex Desktop Store package observed: OpenAI.Codex_26.602.3474.0_x64__2p2nqsd0c76g0
  • VS Code extension helper paths observed:
  • %USERPROFILE%\.vscode\extensions\openai.chatgpt-26.602.30954-win32-x64\bin\windows-x86_64\codex-windows-sandbox-setup.exe
  • %USERPROFILE%\.vscode\extensions\openai.chatgpt-26.602.40724-win32-x64\bin\windows-x86_64\codex-windows-sandbox-setup.exe
  • AppData runtime helper path observed:
  • %LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex-windows-sandbox-setup.exe

On 2026-06-06, multiple parallel Codex threads failed before running their requested commands. The sandbox log showed repeated setup-refresh failures such as:

setup refresh: spawning %USERPROFILE%\.vscode\extensions\openai.chatgpt-26.602.30954-win32-x64\bin\windows-x86_64\codex-windows-sandbox-setup.exe (...)
setup refresh: failed to spawn ...\codex-windows-sandbox-setup.exe: 请求的操作需要提升。 (os error 740)

setup refresh: spawning %LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex-windows-sandbox-setup.exe (...)
setup refresh: failed to spawn ...\codex-windows-sandbox-setup.exe: 请求的操作需要提升。 (os error 740)

After adding ~ RUNASINVOKER under HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers for the current helper paths, direct sandbox smoke tests succeeded for both AppData and VS Code extension runtimes:

%LOCALAPPDATA%\OpenAI\Codex\bin\fb2111b91430cb17\codex.exe sandbox powershell -NoProfile -Command "Write-Output ok"
=> ok

%USERPROFILE%\.vscode\extensions\openai.chatgpt-26.602.30954-win32-x64\bin\windows-x86_64\codex.exe sandbox powershell -NoProfile -Command "Write-Output ok"
=> ok

%USERPROFILE%\.vscode\extensions\openai.chatgpt-26.602.40724-win32-x64\bin\windows-x86_64\codex.exe sandbox powershell -NoProfile -Command "Write-Output ok"
=> ok

The important practical problem is that this workaround is path-specific. When Codex updates and the helper path changes, for example from a previous AppData hash to fb2111b91430cb17 or from VS Code extension 26.602.30954 to 26.602.40724, the failure returns until every new codex-windows-sandbox-setup.exe path is patched again.

This makes the local workaround unreliable for normal users. I agree with the suggested fix in the issue body: the helper should either ship with an explicit asInvoker manifest, or be renamed so it does not trigger Windows installer detection heuristics. Maintaining AppCompatFlags entries for versioned/hash-based helper paths is not a sustainable fix.

silverleafsolutions · 1 month ago

I just updated to Codex for Windows version 26.609.30741, and it's still spamming me with UAC prompts for every single command. I've tried adding RUNASINVOKER, but as previously mentioned, it seems to only work temporarily. Starting a new thread still prompts at least two more UAC prompts. This simply will not go away. This is SO frustrating!

iceweasel-oai contributor · 1 month ago

this is now fixed

silverleafsolutions · 1 month ago
this is now fixed

Codex for Windows Version 26.609.41114 • Released Jun 12, 2026 is still generating one UAC prompt per command it tries to run, per thread. This is better than it was where it would spam UAC for every single command in every thread always. So it's better, but as I click to my various threads and keep doing work, it is still generating one UAC prompt per command it tries to run, but then it doesn't generate another for the same command again in that thread. If I switch to a different thread, I have to do the same thing. Is this expected now?

(I'm using Approve for me mode with [windows] sandbox = "elevated" - Approval policy On request - Sandbox settings Workspace write)

[Update: it's only older threads. If I go back to an existing thread that was created and had the UAC spam problem, it continues doing that with Approve for me selected. If I start a new thread and use Approve for me, it works and doesn't trigger UAC prompts.]

SaveEditors · 28 days ago

This is still reproducible for me on Windows with Codex Desktop Store package OpenAI.Codex_26.616.6631.0

The failure mode matches this issue: shell/tool execution failed with Windows error 740 until applying RUNASINVOKER to codex-windows-sandbox-setup.exe. After adding the AppCompatFlags Layers entry for the helper and restarting Codex Desktop, local shell execution worked again.

The workaround codex created:

$key = "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
New-Item -Path $key -Force | Out-Null

$helpers = Get-ChildItem "$env:LOCALAPPDATA\OpenAI\Codex\bin" `
  -Recurse `
  -Filter "codex-windows-sandbox-setup.exe" `
  -ErrorAction SilentlyContinue

foreach ($helper in $helpers) {
  New-ItemProperty `
    -Path $key `
    -Name $helper.FullName `
    -Value "~ RUNASINVOKER" `
    -PropertyType String `
    -Force | Out-Null

  Write-Host "Applied RUNASINVOKER to $($helper.FullName)"
}

So this does not appear fully fixed in the current Store build. The workaround is effective, but the packaged helper still appears vulnerable to Windows installer/UAC detection unless the binary gets an explicit asInvoker manifest or is renamed to avoid setup-style installer heuristics.