[Windows][Desktop 26.901.6511.0] Startup fails with spawn EPERM when spawning relocated LocalAppData codex.exe; in-package resources\codex.exe works
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Codex / ChatGPT Desktop: 26.901.6511.0 (Microsoft Store / MSIX, x64)
Also reproduced on this machine with no workaround on:
26.901.4073.026.901.5280.0
Relocated / bundled CLI: codex-cli 0.153.4
What subscription do you have?
ChatGPT Pro
What platform is your computer?
Windows x64, Microsoft Store / MSIX
What issue are you seeing?
Cold start shows this dialog:
ChatGPT failed to start.
spawn EPERMButtons: Check for Updates | Quit
Desktop logs show the Electron shell starts, then child_process.spawn of the local app-server fails before stdio_transport_spawned:
[AppServerConnection] Starting app-server connection hostId=local transport=stdio
[AppServerConnection] app_server_connection.transport_connect_failed errorCode=EPERM errorMessage="spawn EPERM"
[AppServerConnection] fatal_error_broadcasted errorMessage="spawn EPERM" transportKind=stdio
Desktop bootstrap failed to start the main app phase=bootstrap-import-main
Stack (packaged asar):
Error: spawn EPERM
at ChildProcess.spawn (node:internal/child_process:458:11)
at spawn (node:child_process:827:9)
at lU.spawnProcess (...\app.asar\.vite\build\src-VqXTPopo.js:704:17410)
at new lU (...)
at uU.connect (...)
at async EJ.connectAndWaitForOpen (...)
at async EJ.startAppServerProcess (...)
This is not “CLI missing”. Desktop successfully relocates codex.exe into:
%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe
That relocated file exists, is Archive only (not Encrypted), Authenticode-valid, and runs from an unpackaged PowerShell/Node process as codex-cli 0.153.4. The packaged Desktop process still cannot spawn it.
runCodexInWindowsSubsystemForLinux was not set. The failing spawn never reaches stdio_transport_spawned, so this is not the WSL wsl.exe spawn path.
Control tests
- Unpackaged spawn of the relocated CLI works
& "$env:LOCALAPPDATA\OpenAI\Codex\bin\<hash>\codex.exe" --version
# codex-cli 0.153.4
-
Restoring
ALL APPLICATION PACKAGES(S-1-15-2-1/S-1-15-2-2) on%USERPROFILE%\AppDataand%LOCALAPPDATA%\OpenAI, and switching[windows] sandboxfromelevatedtounelevated, did not change the failure. Desktop still loggedspawn EPERMagainst the relocated CLI. -
Setting user
CODEX_CLI_PATHto the in-package sibling binary makes Desktop start immediately:
CODEX_CLI_PATH=%ProgramFiles%\WindowsApps\OpenAI.Codex_26.901.6511.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
Successful log:
[StdioConnection] stdio_transport_spawned
executablePath="...\WindowsApps\OpenAI.Codex_26.901.6511.0_x64__2p2nqsd0c76g0\app\resources\codex.exe"
spawnCommand="...\WindowsApps\OpenAI.Codex_26.901.6511.0_x64__2p2nqsd0c76g0\app\resources\codex.exe"
[AppServerConnection] Transport start success transport=stdio
[AppServerConnection] initialize_handshake_result outcome=success
window ready-to-show
Direct PowerShell execution of that same WindowsApps path still returns Access denied, as expected for an unpackaged caller. The packaged ChatGPT.exe can spawn it because it is in the same MSIX package.
-
AppLocker EXE/DLL log has no Event 8004 around these launches. This is not the
spawn UNKNOWN/ AppLocker case in #41958. -
Store updates do not fix it. The package version in the log path changes (
4073.0→5280.0→6511.0); the failure string does not.
What steps can reproduce the bug?
- Install/update Microsoft Store package
OpenAI.Codexto26.901.6511.0(also seen on26.901.4073.0and26.901.5280.0). - Ensure
CODEX_CLI_PATHis unset. - Launch ChatGPT from the Start menu / AppX activation.
- Observe the dialog
ChatGPT failed to start./spawn EPERM, and logsDesktop bootstrap failed ... phase=bootstrap-import-main. - Confirm
%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exeexists and runs from PowerShell. - Set
CODEX_CLI_PATHtoapp\resources\codex.exeinside the currentWindowsApps\OpenAI.Codex_*package and relaunch. - Desktop starts; logs show
stdio_transport_spawnedwith the in-package path.
What is the expected behavior?
Desktop should spawn the relocated per-user CLI, or fall back to the in-package app\resources\codex.exe, and start.
If CreateProcess of the relocated copy is denied, the app should fall back to the packaged sibling executable instead of failing bootstrap with spawn EPERM. It should also log the resolved executablePath / spawnCommand on the failed spawn, not only after a successful spawn.
CODEX_CLI_PATH pointing at a versioned WindowsApps\OpenAI.Codex_<version>_... path is not durable; the next Store update changes the folder name.
Additional information
- MSIX is FullTrust (
runFullTrust,Windows.FullTrustApplication). - Manifest excludes
$(KnownFolder:LocalAppData)\OpenAIfrom FS virtualization, so the relocated CLI is the real%LOCALAPPDATA%\OpenAI\...path. spawnProcessresolvesspawnCommand ?? executablePathand calls Nodechild_process.spawn. Full paths containing\are not rewritten via PATH. The relocated hash directory is created during failed launches, so relocation succeeds; only the subsequent spawn fails.- Related but not the same:
- #40700 / #40843 / #42645 — relocation / “Unable to locate the Codex CLI binary” / Access denied on the WindowsApps file from PowerShell
- #41958 —
spawn UNKNOWN+ AppLocker Event 8004 - #35872 —
spawn EPERMon a packagedWindowsApps\...\codex.exefrom an unpackaged Node worker - #15777 — elevated sandbox ACL rewrite on AppData (family, but restoring
S-1-15-2-1did not unblock this Desktop spawn) - #42711 — same
26.901.4073.0train, but0xC0000005, notspawn EPERM
Please avoid requesting a destructive reinstall/reset unless necessary; the A/B above already isolates the failing CreateProcess target.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the app-server stdio connection and the spawnProcess entry point shown in the packaged asar stack, then trace how the relocated and in-package codex.exe paths are selected. Reproduce with the listed MSIX versions and CODEX_CLI_PATH control, and consider the issue complete when the relocated CLI starts or the packaged sibling is used as a fallback, with the failed executable path logged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, node.js
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100