[Windows] Desktop app can remain headless for a prolonged period during startup before recovering
What version of the Codex App are you using?
Microsoft Store / Windows package observed in logs:
OpenAI.Codex_26.810.7004.0_x64__2p2nqsd0c76g0
Bundled app-server version later reported:
0.148.0-alpha.9
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Windows 11 x64
What issue are you seeing?
On launch, the desktop app created multiple ChatGPT.exe processes and consumed high CPU for several seconds, then settled to a lower sustained level, but no visible window appeared.
PowerShell showed every ChatGPT process with MainWindowHandle = 0 while the app remained alive and responsive at the process level.
The desktop log shows that startup began, immediately hit bundled executable relocation failures for both rg.exe and codex.exe, and then remained stuck for a prolonged period before finally spawning the bundled Codex process.
When startup resumed, the log recorded a shell-environment loading timeout whose measured duration was far longer than the configured timeout:
warning Failed to load shell env caller=startup
detail="Timed out"
status=timed_out
Immediately after that delayed point, startup proceeded normally:
stdio_transport_spawned ... codex.exe
Codex CLI initialized
window main frame finished load
window ready-to-show
React root render requested ... rendererWindowVisible=true
The app eventually recovered without reinstalling or resetting it.
Relevant startup sequence
Launching app
bundled_executable_relocation_failed ... rg.exe
bundled_executable_relocation_failed ... codex.exe
[prolonged stall lasting several minutes]
stdio_transport_spawned ... codex.exe
Failed to load shell env
Codex CLI initialized
window ready-to-show
Control case: immediate relaunch
A subsequent launch shortly afterward behaved normally even though the same executable relocation warnings still occurred:
Launching app
bundled_executable_relocation_failed ... rg.exe
bundled_executable_relocation_failed ... codex.exe
stdio_transport_spawned ... codex.exe
Codex CLI initialized
window ready-to-show
This suggests bundled_executable_relocation_failed alone is recoverable and is not sufficient to cause the prolonged headless startup. The unusual behavior appears to be the startup recovery / shell-environment path blocking for far longer than expected.
Steps to reproduce
I do not yet have deterministic reproduction steps. The observed sequence was:
- Launch the Windows desktop app from its shortcut.
ChatGPT.exeprocesses appear immediately.- CPU usage rises sharply for several seconds, then settles to a lower sustained level.
- No window appears.
Get-Process ChatGPT | Select Id, CPU, Responding, MainWindowHandle, MainWindowTitle, PathreportsMainWindowHandle = 0for all processes.- After a prolonged period, the startup chain resumes and the UI becomes available.
- A later relaunch completes normally within a short time.
Expected behavior
The desktop window should appear promptly. If shell-environment discovery or bundled executable relocation fails, that recovery path should respect its timeout and should not block first-window creation for several minutes.
Ideally the app should also surface a visible recovery/error state instead of remaining as background processes with no window.
Additional information
The same launch also contained file-copy warnings while relocating bundled executables from the WindowsApps package into the per-user Codex directory. Since those warnings also appear during the later healthy launch, they may be related context rather than the direct cause.
I am intentionally not attaching the complete raw desktop logs because they contain local paths and other metadata. I can provide sanitized excerpts or additional diagnostics if requested.
Possibly related reports include Windows startup/no-window and startup-hang issues such as #28046 and #23207, but this case differs in that the process remains alive, later recovers, and records a shell-environment timeout whose observed duration is far beyond the configured timeout.
6 Comments
I maintain WinBridge Recovery, an independent Windows recovery tool for Codex/Desktop local plugin/runtime state: https://github.com/zemeng5208/winbridge-recovery
This report looks relevant specifically to the local bundled-executable relocation/staging layer. WinBridge can help diagnose whether the installed package and the per-user recovery/staging state have drifted after an update, including the package version/hash inputs, CUA/runtime paths derived from the installed package, and stale or incomplete user-side copies that can make helper relocation repeatedly fail. It can also rebuild the recoverable user-side state from the official package already installed on the machine, with backup/rollback checks.
That said, I would not treat it as a guaranteed fix for this issue. Your own control case is important: the same
bundled_executable_relocation_failedwarnings also appear on a later healthy launch, while the several-minute stall lines up with shell-environment/startup recovery taking far longer than its configured timeout. If the relocation warnings are only incidental and the real blocker is the upstream shell-env/startup state machine, WinBridge will not fix that logic. It also does not take ownership of or patchC:\Program Files\WindowsApps, bypass package protection, or modify the signed MSIX.So the useful boundary here is: WinBridge may help determine whether there is a repairable local relocation/staging inconsistency behind the
rg.exe/codex.execopy warnings; if those layers are already internally consistent, this should remain an upstream Desktop startup/timeout investigation rather than a local-repair case.I may be seeing a related startup failure on a newer Windows build.
After an unexpected computer shutdown, the Codex/ChatGPT Windows desktop app became permanently stuck in a startup/loading loop.
Installed package:
OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0ChatGPT.exeversion:151.0.7922.137Windows Event Viewer records:
Application Hang, Event ID1002HangType: Top level window is idleThe app creates its visible window but never finishes loading.
The ChatGPT web app works normally on the same machine/account.
Troubleshooting attempted with no change:
wsreset.exe--disable-gpuLocalCacheUnlike the behavior described in this issue, mine has not recovered after waiting/relaunching.
This started immediately after an unexpected Windows shutdown.
I can reproduce this on a newer Microsoft Store build, with a deterministic delay after every Windows reboot.
Environment
OpenAI.Codex_26.820.7780.0_x640.150.0-alpha.826200.9168Observed behavior
Sanitized startup timeline
The same session later reports:
The failing runtime destination is:
The parent directory is owned by the current user and grants Full Control, so this does not appear to be a simple directory ACL problem. The final runtime directory is never created. Repeated launches have accumulated 143
.staging-*directories alongside only three completed runtime directories.This evidence points to a transient Windows file lock or security-scanning interaction during the atomic staging rename. Regardless of the lock source, the app retries on the startup critical path for several minutes, delays window creation, and then continues into a degraded/unresponsive state.
It would help if the relocation/cache code could:
I am not attaching the full raw log because it contains local paths and account/workspace metadata, but I can provide additional sanitized diagnostics if needed.
I can reproduce the same headless startup behavior on a newer Microsoft Store build.
Environment
OpenAI.Codex_26.820.9563.0_x64Okcodex-cli 0.149.1)CODEX_CLI_PATHpoints to a valid executableObserved behavior
ChatGPT.exeprocesses appear in Task Manager, but no visible window is created.MainWindowHandle = 0.Sanitized startup timing from logs
Failing launch:
Immediate subsequent healthy launch:
So the failing startup spends roughly 159 seconds before the shell-environment timeout surfaces, even though the log says
Timed out after 5000ms. Once that returns, CLI initialization and window creation complete within about 2 seconds.PowerShell control measurement
To rule out a slow shell/profile as the cause:
This suggests the shell itself is healthy; the prolonged delay appears to be inside the desktop app's shell-environment discovery / timeout / recovery path.
One additional detail: in the filtered failing startup excerpt I did not observe
bundled_executable_relocation_failed, so executable relocation may not be required to reproduce the prolonged headless startup.This appears to confirm that the issue is still reproducible on
26.820.9563.0, and that the nominal 5-second shell-env timeout can block first-window creation for far longer than expected.Additional reproduction/evidence from another Windows machine on the same current Store build. This looks like the same prolonged headless startup pattern, but with Windows event-log evidence that the previous launch was also reported as a
MoAppHangand with an AppX update/register sequence immediately before recovery.Environment
OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0ChatGPT.exeversion in WER:151.0.7922.170Ok10.0.26100.9168/OS 10.0.26200familyUser-visible behavior
After clicking the ChatGPT/Codex desktop icon, nothing visible appeared. Repeated clicks and a reboot did not immediately help. After waiting for a while, the app window suddenly appeared and became usable.
Windows/AppX timeline
Local time:
Desktop logs
Several launches after the update only reached the first two startup lines and then stopped:
The launch that eventually recovered started at
13:24:03UTC and only completed the visible-window path around13:28:45UTC:So the app was effectively headless for about 4m40s. Once the shell-env step returned, the remaining window/app-server initialization completed quickly.
Process state after recovery
After the app recovered, the process tree was healthy and responsive. The main process was:
A bundled CLI child process was also running from the per-user materialized path:
Additional observations
bundled_executable_relocation_failedin the relevant filtered startup excerpt for this recovered launch.%USERPROFILE%\.codex\.tmp\bundled-marketplaces\openai-bundled.staging-*, but those appear to be post-window/plugin-sync noise rather than the blocker for first-window creation.timeoutMs=5000shell-env operation reportsdurationMs=280663and blocks first-window creation.This seems to add two useful details to the existing pattern:
26.820.9563.0after a Microsoft Store update/register event.MoAppHang/ Application Hang even though a later launch eventually recovers after the long shell-env delay.Follow-up: the same prolonged headless startup is still reproducible after updating to a newer Microsoft Store build.
Environment
OpenAI.Codex_26.825.3734.0_x64Ok26.820.9563.0reproductionNew failing startup timeline
The app was launched and remained headless for about four minutes before the window appeared on its own.
Sanitized log timeline:
The log also reports:
So total startup was about 238.3 s (3m58s), while the shell-env operation still reports a nominal timeout of 5000 ms.
Once the shell-env step returned, the rest of startup completed in roughly 3 seconds.
Healthy control launch on the same machine
A separate normal launch on the same build completed in about 6 seconds:
This gives a same-machine comparison of roughly 6.1 s normal vs 238.3 s failing.
The behavior is therefore still reproducible on
26.825.3734.0, and the failure pattern again points to the shell-environment discovery / timeout / recovery path blocking first-window creation far beyond the nominal 5-second timeout.