[Windows 26.820.9563.0] Desktop remains headless after external Codex CLI workaround
What version of the Codex App are you using (From “About Codex” dialog)?
26.820.9563.0
What subscription do you have?
chatGPT plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
<img width="559" height="170" alt="Image" src="https://github.com/user-attachments/assets/5c98588b-63c7-42fe-908d-70f7a5ab6584" />
Codex/ChatGPT Desktop 26.820.9563.0 no longer starts correctly on my Windows machine.
Initially, launching the app showed:
"ChatGPT failed to start.
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex."
<img width="1090" height="319" alt="Image" src="https://github.com/user-attachments/assets/c44ff9ff-12d5-4d3f-bc3b-78203979f961" />
I investigated the bundled CLI and confirmed that the file exists:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
However, its attributes are:
Archive, Encrypted
PowerShell:
$pkg = Get-AppxPackage OpenAI.Codex
Get-Item "$($pkg.InstallLocation)\app\resources\codex.exe" |
Select-Object FullName,Attributes
Output:
Attributes: Archive, Encrypted
Trying to copy the bundled executable also fails:
Copy-Item $src "$env:TEMP\codex-test.exe" -Force
Error:
"The specified file could not be encrypted."
I then installed the standalone official Codex CLI successfully:
codex-cli 0.150.1
Path:
C:\Users\<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
I set CODEX_CLI_PATH to this native codex.exe and rebooted Windows.
The original missing-CLI dialog no longer appears, but the desktop application still does not create a GUI.
Multiple ChatGPT.exe processes are created in the background, but every process has:
MainWindowHandle = 0
MainWindowTitle = empty
No codex.exe process is spawned.
The desktop log also stops after only:
2026-08-27T04:58:00.221Z info Launching app ...
2026-08-27T04:58:00.342Z info Appshot hotkey inactive ...
I also tested launching ChatGPT.exe directly and launching it with --disable-gpu. Both produce the same result: background processes exist, but no GUI window is created.
I completely uninstalled the application and verified that:
- Get-AppxPackage OpenAI.Codex returned nothing
- the old WindowsApps package directory was removed
- the LocalAppData package directory was removed
I then rebooted and reinstalled the app from Microsoft Store.
The newly installed version is again 26.820.9563.0, and the newly installed bundled codex.exe is again marked:
Archive, Encrypted
The issue is therefore reproducible after a clean reinstall.
The standalone Codex CLI works correctly; only the Windows desktop application fails to create its GUI.
What steps can reproduce the bug?
- Install Codex/ChatGPT Desktop on Windows from the Microsoft Store.
- Launch the app.
- The app initially reports: "Unable to locate the Codex CLI binary."
- Check the bundled CLI at:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
- The bundled codex.exe has the attributes: Archive, Encrypted.
- Attempting to copy the bundled codex.exe fails with: "The specified file could not be encrypted."
- Install the standalone Codex CLI 0.150.1 and set CODEX_CLI_PATH to the working codex.exe.
- Reboot Windows and launch the desktop app again.
- Multiple ChatGPT.exe processes start, but no GUI window appears and MainWindowHandle remains 0.
- Completely uninstall the app, reboot, and reinstall from Microsoft Store.
- The same issue reproduces on version 26.820.9563.0.
What is the expected behavior?
The Codex/ChatGPT desktop application should launch normally and display its GUI window.
The app should successfully use either the bundled Codex CLI or the valid external CLI specified by CODEX_CLI_PATH, without creating only background processes or leaving MainWindowHandle at 0.
Additional information
This appears related to #40867, but the behavior on my machine continues after applying the external CLI workaround.
The bundled CLI problem is reproducible on 26.820.9563.0:
- app\resources\codex.exe exists
- file attributes are: Archive, Encrypted
- copying it fails with: "The specified file could not be encrypted."
I then installed the official standalone Codex CLI 0.150.1 and set CODEX_CLI_PATH to the native codex.exe.
After rebooting, the original missing-CLI error disappeared, but the desktop app still remains headless:
- multiple ChatGPT.exe processes are running
- MainWindowHandle = 0 for all processes
- no GUI window appears
- no codex.exe child process is spawned
- desktop log stops after:
- Launching app
- Appshot hotkey inactive
A complete uninstall, reboot, and reinstall from Microsoft Store reproduces the same behavior on 26.820.9563.0.
14 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Important update: the app eventually opened after waiting for about 14 minutes.
I checked the desktop logs and found that the process was not permanently crashed. It was stuck during startup for an extremely long time.
Timeline:
05:57:23.546 - Launching app
06:10:58.061 - Failed to load shell env
detail="Timed out after 5000ms."
durationMs=814512
The shell environment loading step therefore took about 13 minutes 34 seconds.
After that, startup immediately continued:
06:11:07.061 - stdio_transport_spawned
executablePath=C:\Users\<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
06:11:08.057 - window main frame finished load
06:11:08.169 - Host startup critical-path phases completed
startupElapsedMs=825272
06:11:08.633 - window ready-to-show
So the total desktop startup took about 13 minutes 45 seconds.
This suggests that the "multiple ChatGPT.exe processes with MainWindowHandle=0" state was actually an extremely long startup hang, apparently around shell environment loading, rather than a permanent renderer crash.
Also, the external Codex CLI workaround is working: after the hang completes, the app successfully spawns:
C:\Users\<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
One more useful detail: WSL detection happens later, after the GUI is already ready, so WSL does not appear to be the cause of this startup delay.
I encountered the same problem on the corresponding version as well.
I maintain WinBridge Recovery: https://github.com/zemeng5208/winbridge-recovery
There are two separate failure layers in this report, and only the first one is in WinBridge Recovery's current scope.
The original
Unable to locate the Codex CLI binarysymptom, together withapp\resources\codex.exebeing markedEncryptedandCopy-Itemfailing withThe specified file could not be encrypted, matches the Windows Application Protected / EFS -> user-side runtime relocation/materialization failure class. WinBridge can help diagnose that local layer by checking the packaged source attributes, the expected%LOCALAPPDATA%\OpenAI\Codex\binmaterialization, partial/stale.staging-*state, version/hash consistency, and target-path/Junction problems. It does not modifyWindowsAppsor bypass package protection.However, your follow-up narrows the remaining ~14 minute startup delay to a different layer: once
CODEX_CLI_PATHpoints to the standalone CLI, Codex eventually spawns that externalcodex.exesuccessfully, and the long delay is concentrated in shell-environment loading (durationMs=814512). That shell-env startup stall is not something WinBridge currently repairs, and local runtime recovery should not be expected to fix it.So WinBridge may be useful for recovering/confirming the initial protected-binary relocation failure, but it would not explain or guarantee a fix for the later shell-env hang. If the packaged executable in this build is consistently Application Protected in a way the desktop relocation code cannot copy, the durable fix still needs to be made upstream in Codex's Windows materialization/startup path.
Update: after keeping CODEX_CLI_PATH pointed to the standalone native codex.exe, the desktop app is now launching successfully again.
I tested a full exit and relaunch, and the GUI appeared in about 6 seconds.
So the current status on my machine is:
I can reproduce this on a second Windows machine with Codex Desktop
26.820.9563.0.Additional reproduction details from my machine:
OpenAI.Codex 26.820.9563.0C:\Program Files\WindowsApps\OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0app\resources\codex.exeEncrypted26.820.9563.0, multipleChatGPT.exeprocesses start but no GUI window is createdChatGPT.exeprocesses haveMainWindowHandle = 0codex.exechild process is presentCODEX_CLI_PATHbefore reinstalling; same behavior--disable-direct-compositiondoes not help--disable-gpu --disable-gpu-compositing --disable-software-rasterizerdoes not helpThe desktop log stops after exactly these two lines:
This started immediately after the update. The previous build was able to run after using the external CLI workaround, while
26.820.9563.0remains headless even after a clean reinstall.Additional evidence from the same affected machine after waiting for the window to eventually appear:
The app does recover, but only after a very long startup stall. The most suspicious log entry is the shell-environment load timeout:
Key point: the configured timeout is 5 seconds, but the measured operation duration is
267794 ms(~4m28s).Immediately after that delayed shell-env step returns, the rest of startup completes quickly:
So on this machine the CLI/app-server handshake and window load are healthy once the shell-environment step finally returns. The main delay appears to be before that, in startup shell-environment discovery/cancellation.
Observed behavior now:
MainWindowHandle = 0This looks very similar to the startup-recovery pattern described in #38766, where
Failed to load shell envreports a duration far beyond its configured timeout and the window appears shortly afterward.One additional PATH oddity visible in the log is a malformed entry:
C:\Pro;ram Files\NVIDIA Corporation\NVIDIA App\NvDLISR(plus several duplicated Windows PATH entries). That may be local environmental noise, but regardless, atimeoutMs=5000operation should not block the main startup path for ~268 seconds.Independent reproduction on another Windows machine with Codex Desktop
26.820.9563.0. I’m adding the diagnostics because they provide additional evidence around thecua_noderuntime staging path.Observed behavior
ChatGPT.exeprocesses but no window appears.Responding=True,MainWindowHandle=0, ~55 threads, ~490.8 MB working set, substantial CPU time.``
text
``info Launching app ... packaged=true platform=win32
info Appshot hotkey inactive configured=true enabled=false platform=win32
No app-server / BrowserWindow / renderer startup messages follow.
.dmpwas produced and Windows Application log showed no standardApplication Error/ WER entry.--disable-gpu --disable-gpu-compositing --disable-software-rasterizerdoes not fix it. The GPU child process shows--use-gl=disabled, but no--type=rendererprocess is created.Additional
cua_nodeevidenceThe packaged runtime is marked encrypted/protected:
Observed:
And:
returns:
More importantly, every failed desktop launch created a new staging directory under:
There were 21 directories named like:
Most were ~152–153 MB; later attempts reached ~165 MB, ~220 MB, and ~232 MB, but none finalized into a normal
57937f104cca4dc5runtime directory. The only completed runtime present was an older one:The staging timestamps closely matched repeated failed launch attempts. Removing only the
.staging-*directories reclaimed roughly 3 GB; a subsequent launch would be expected to recreate staging again.CLI status
The separately installed CLI works normally:
A cached per-user desktop CLI also existed and could execute, so this reproduction is not simply “no Codex CLI on disk”.
Interpretation
This independently reproduces the same
26.820.9563.0headless-startup signature and adds strong evidence that the desktop startup is repeatedly attempting, but failing to finalize, the newcua_noderuntime from Application Protected / Encrypted MSIX resources.I would not claim this proves
cua_noderelocation is the only blocker: #41073 reports the same-version two-line/headless startup can be bypassed by disabling updater initialization (CODEX_SPARKLE_ENABLED=false), and #41059 also contains evidence of a very long shell-environment startup stall. It may be multiple interacting startup-path regressions. However, the repeated large.staging-*directories andApplication Protectedsource files are deterministic on this affected machine and seem worth instrumenting/logging explicitly.Additional confirmation from another affected Windows x64 machine on
26.820.9563.0.I performed a clean-state reinstall test and the headless startup still reproduces.
Clean-state test
Before reinstalling, I backed up the useful Codex data and then removed the old Codex runtime/state so the new install would start without the previous custom environment:
CODEX_HOMEandCODEX_CLI_PATHvariablesCodexHome/CodexRuntime%APPDATA%\Codex%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0The Store reinstall again installed:
The same failure remains: no window appears.
Process evidence
The app creates multiple responsive
ChatGPT.exeprocesses. On a representative failed launch, all processes had:The main process was actively consuming CPU and had dozens of threads, so this was not the one-thread
Wait/Suspendedfailure mode reported in some other Windows startup issues.The observed process tree contained:
Notably, there was no
--type=rendererprocess in the failed launches.Additional checks
Windows
NUL/ Null kernel driver is healthy:I also launched the packaged executable with:
The flag propagated to the main/GPU process, but the app still created no window and all
MainWindowHandlevalues remained0.The desktop log again stopped immediately after the initial startup lines:
No useful standard
Application Errorentry forChatGPT.exewas produced in Event Viewer during these attempts.This makes the failure look independent of the previous Codex profile, custom
CODEX_HOME, custom CLI path, DirectComposition, and the Windows Null device. The strongest additional signal here is that the Chromium GPU/network/storage services start, but a renderer process is never created, while the main process remains alive and responsive.I have not measured the maximum possible wait time for an unmodified launch, so I cannot rule out the very-long startup recovery behavior reported elsewhere, but during the troubleshooting runs the UI did not appear.
Additional reproduction from another affected Windows machine after a clean reinstall and restoration of only an external native runtime:
E:\CodexRuntime\codex.exerestored successfully and runs ascodex-cli 0.150.0-alpha.8.CODEX_CLI_PATH=E:\CodexRuntime\codex.exeis set and verified.CODEX_SPARKLE_ENABLED=falseis also set.Invoke-CommandInDesktopPackagestill produces onlyChatGPT.exemain/crashpad/GPU/network/storage processes.codex.exechild process is spawned at all.Responding=True, but everyMainWindowHandleremains0.This narrows this machine's failure to a point before app-server/CLI spawn and before renderer creation. It also means the
CODEX_SPARKLE_ENABLED=falseworkaround reported in #41073 does not resolve the issue on this machine.The restored runtime files are ordinary
Archivefiles (notEncrypted), while the Store package'sChatGPT.exeand bundledapp\resources\codex.exeare bothArchive, Encrypted.Additional confirmed reproduction from my Windows machine:
26.820.9563.0CODEX_CLI_PATH=E:\CodexRuntime\codex.exe(codex-cli 0.150.0-alpha.8)CODEX_SPARKLE_ENABLED=falseChatGPT.exeprocesses reportedResponding=TrueandMainWindowHandle=0; nocodex.exechild process was present yet.The UI eventually appeared. In the monitoring window, the app was definitely still headless at
17:10:11withWindow=0, then at17:10:21the main process suddenly had a non-zero window handle (264270) and the login UI appeared.During the observed headless period, the main process CPU time kept increasing steadily (roughly from
313.7sat 17:06:01 to566.9sat 17:10:21), so this was not a suspended/idle process. It was actively consuming CPU while no renderer/main window was visible.This further supports the interpretation that the app is stuck for several minutes on a pre-window startup path, then eventually continues and creates the UI. The behavior is consistent with the long startup delays reported in #41056 / #38766, but on this machine the process remains responsive and CPU-active throughout the observed stall.
Additional confirmed reproduction and a successful workaround from another Windows x64 machine.
Environment / signature
OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0C:\Users\<ascii-user>Ok; Microsoft Store reported the latest version installed.Unable to locate the Codex CLI binary.Launching app ... packaged=true platform=win32Appshot hotkey inactive ....dmpwas generated.Every launch created a new incomplete runtime directory under:
No completed
57937f104cca4dc5runtime directory existed. Three separate launch attempts left three staging directories.Directly copying the installed resources reproduced an encryption/materialization failure:
Copy-Item ...\app\resources\codex.exefailed withThe specified file could not be encrypted.robocopy ...\app\resources\cua_node <user-writable-target> /Efailed immediately with Windows error 6000 (0x00001770), also reportingThe specified file could not be encrypted.Workaround that restored the GUI
The original official
ChatGPT-x64.msixused for installation was still available in Downloads (788,381,543 bytes). Instead of copying from the Application Protected / Encrypted files underWindowsApps, I opened that original MSIX as a ZIP archive usingSystem.IO.Compression.ZipFileand extracted only entries below:The extraction produced 4,680 files. I placed those unencrypted files at:
The hash was taken from the observed staging-directory prefix; it should not be hardcoded across app/runtime versions.
After this directory was populated, launching the packaged app immediately created the GUI and the app became usable. No external
CODEX_CLI_PATHworkaround was required for this final recovery.This result strongly points to the
cua_nodematerialization/finalization path from installed Application Protected resources as the blocker on this machine. It also shows the failure is not limited to non-ASCII Windows profile paths. The updater should either materialize these resources through a package-aware API, avoid preserving an unusable encryption attribute, or surface a clear recoverable error instead of stopping after the two initial log lines.Related staging/runtime reports: #28017, #28245.
I encountered a similar problem in version 26.820.9563.0. After clicking on the ChatGPT software, it failed to start. In the Task Manager, there were processes running, but no error messages were displayed and no window appeared. But I found a solution.
My setup had the standalone Codex CLI installed, and I had previously set the user-level CODEX_CLI_PATH to:
C:\Users\<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
With CODEX_CLI_PATH set, ChatGPT Desktop launched only background processes. The main process, crashpad, GPU process and utility processes were present, but no --type=renderer process was created and all MainWindowHandle values remained 0.
I removed the user-level environment variable:
[Environment]::SetEnvironmentVariable("CODEX_CLI_PATH", $null, "User")
After relaunching ChatGPT, the application started normally and the GUI appeared.
So on my machine, the standalone Codex CLI itself does not appear to be the problem. The issue is specifically caused by CODEX_CLI_PATH pointing to the standalone native codex.exe.
This may be a regression in 26.820.9563.0, because that environment-variable workaround had previously been used to bypass the bundled CLI / Access Denied issue.
Working workaround: unset CODEX_CLI_PATH and allow the desktop app to use its bundled/default CLI resolution.
my codex's version is 26.820.71523,.Today my codex GUI cannot open with its processes hanging in the background. I removed the user-level environment variable CODEX_CLI_PATH. Then the GUI reappeared immediately as usual.What happened?