[Windows 26.820] Codex Desktop cannot start: bundled codex.exe relocation from WindowsApps fails
What version of the Codex App are you using (From “About Codex” dialog)?
26.820.7780.0 (from Get-AppxPackage; the app cannot start to open the About Codex dialog)
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?
After updating Codex Desktop to version 26.820.7780.0, the app can no longer start.
The startup dialog reports:
Unable to locate the Codex CLI binary.
Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
However, the bundled Windows CLI is present at:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
The startup logs show that the actual failure occurs earlier, while Codex attempts to relocate the bundled Windows executable from the WindowsApps package into the per-user runtime directory.
Relevant log fields:
bundled_executable_relocation_failed
operation=copy_file
executableName=codex.exe
failedExecutableName=codex.exe
sourceKind=windowsapps
sourcePath:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
destinationPath:
C:\Users\<user>\AppData\Local\OpenAI\Codex\bin\.staging-...\codex.exe
originalError:
errno=-4094
code=UNKNOWN
syscall=copyfile
Immediately afterwards, AppServerConnection fails with:
Unable to locate the Codex CLI binary.
The bundled files:
app\resources\codex.exe
app\resources\codex
both report the Windows file attributes:
Archive, Encrypted
A manual copy test of the bundled codex file from WindowsApps to a normal temporary directory also fails with:
The specified file could not be encrypted.
During the same startup sequence, Codex also fails to relocate the bundled cua_node runtime using copy_directory.
The app worked before the update and stopped starting immediately after updating to 26.820.7780.0.
What steps can reproduce the bug?
- Update/install Codex Desktop from the Microsoft Store to version 26.820.7780.0 on this Windows x64 machine.
- Launch Codex Desktop.
- The app attempts to relocate the bundled codex.exe from the WindowsApps package into:
%LOCALAPPDATA%\OpenAI\Codex\bin\
- The relocation fails during copy_file.
- Codex then displays:
"Unable to locate the Codex CLI binary."
Potentially relevant AppX environment details:
Get-AppxDefaultVolume reports:
D:\WindowsApps
Get-AppxPackage OpenAI.Codex reports:
Version:
26.820.7780.0
InstallLocation:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0
A directory for the same Codex package/version is visible under both:
C:\Program Files\WindowsApps\
D:\WindowsApps\
I have not modified WindowsApps permissions, ownership, ACLs, package files, encryption settings, Codex configuration, or CODEX_CLI_PATH.
What is the expected behavior?
Codex Desktop should successfully locate or relocate the bundled Windows Codex CLI and start normally.
If WindowsApps / Application Protected / encrypted package resources cannot be copied to the per-user runtime directory using the current copy mechanism, Codex should use a Windows-compatible relocation method and surface the underlying Windows error instead of reporting that the CLI is missing.
Additional information
This appears related to existing Windows bundled-runtime relocation issues, but the impact in this case is more severe: the Windows-native codex.exe relocation failure prevents the entire Codex Desktop app from starting.
Potentially related issues:
#25571 - WindowsApps package on a non-system AppX volume / protected bundled executable relocation failures
#38696 - encrypted bundled Codex relocation failure in the WSL path
#34764 - Application Protected cua_node relocation failure
The same startup sequence on this machine shows both codex.exe copy_file relocation failures and cua_node copy_directory relocation failures.
The "Check for Updates" button in the startup error dialog still works and currently reports:
ChatGPT is up to date.
No workaround or local modification has been applied after reproducing the issue, so the failing installation state is currently preserved.
36 Comments
I can independently reproduce this on the exact same Windows package:
Important: my Desktop configuration is Windows-native:
The bundled binaries are present:
Both report:
A direct copy reproduction of the packaged Linux
codexbinary to%TEMP%fails with:The Desktop startup log shows the same Windows-native relocation failure:
Immediately afterwards:
The same startup sequence also contains relocation failures for the bundled
cua_node/ Node runtime usingcopy_directory.Windows Settings > Apps > ChatGPT > Repair did not resolve the issue.
I did not modify WindowsApps ownership, ACLs, package files, encryption,
CODEX_CLI_PATH, the bundled binaries, or Codex runtime state before reproducing this.Additional AppX-volume evidence from a final read-only audit:
An exact package directory for the same package full name also exists at:
The C: and F: copies of both bundled binaries are byte-identical by size and SHA-256:
The hashes are identical on C: and F:.
So this machine has a multi-AppX-volume mismatch/state in which the default AppX volume is F:, the registered Codex package install location is C:, and an identical copy of the same package/version is also present under F:\WindowsApps.
I cannot prove that this multi-volume state is the root cause rather than only a trigger/amplifier, but it closely matches the potentially relevant environment shape already described in #40700.
This appears to confirm that #40700 affects the Windows-native path itself, not only the WSL agent path, and that the underlying failure is consistent with
ERROR_ENCRYPTION_FAILED (0x80071770)/ protected MSIX resource relocation.I can reproduce this exact regression on Windows x64.
Working:
26.818.8289.0Broken:
26.820.7780.0Additional evidence from my machine:
app\resources\codex.exeandapp\resources\codexboth exist in the26.820.7780.0package.Archive, Encrypted/ Application Protected behavior.bundled_executable_relocation_failedexecutableName=codex.exeplatform=win32operation=copy_file...\WindowsApps\OpenAI.Codex_26.820.7780.0...\app\resources\codex.exe%LOCALAPPDATA%\OpenAI\Codex\bin\.staging-...\codex.exeerrno=-4094,code=UNKNOWNUnable to locate the Codex CLI binary.Copy-Itemof the bundledcodexfile from WindowsApps to%TEMP%fails with:The specified file could not be encrypted.This is the Windows-native CLI path in my failing log, not the WSL bootstrap path.
CODEX_CLI_PATHis unset, and therunCodexInWindowsSubsystemForLinuxsetting is not present in my config.My
%USERPROFILE%\.codexis a Junction toD:\ChatGPT\CodexHome, but that same Junction/D-drive layout was present while26.818.8289.0worked normally, so it does not explain the version-specific regression.I also compared the two desktop builds:
26.818.8289.0can directly resolve/run the bundledresources\codex.exe, while26.820.7780.0routes startup through the relocation helper first. The old build also logged some bundled-runtime/plugin copy warnings, but they were non-fatal; the new build appears to make successful nativecodex.exerelocation a prerequisite for startup.I downloaded the official previous release MSIX from OpenAI's CDN and downgraded with:
After returning to
26.818.8289.0, the desktop app started immediately and my existing projects, sessions, and configuration were still intact.This looks like a regression in the new mandatory Windows-native CLI relocation path when the source resource is Store/MSIX Application Protected.
Independent reproduction of this release regression on Windows 11:
ChatGPT failed to start.Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.Check for Updates, but the current release is already the latest.This appears consistent with #40700 and adds another update-triggered reproduction. A screenshot of the exact dialog is available if maintainers need it.
I maintain WinBridge Recovery: https://github.com/zemeng5208/winbridge-recovery
This report is a high-confidence match for one of the local Windows layers WinBridge is designed to diagnose: bundled executable/runtime relocation from the installed MSIX/WindowsApps package into the per-user Codex runtime, including Application Protected/EFS copy failures and incomplete staging.
For this specific failure, the useful local checks are:
app\resources\codex.exe/codexandcua_nodesources exist and are readable;%LOCALAPPDATA%\OpenAI\Codex\binandruntimes\cua_nodefor abandoned.staging-*directories or an incomplete active runtime;ERROR_ENCRYPTION_FAILEDcopy path shown here.WinBridge can help collect that evidence and recover user-side staging/runtime state where a valid current-package copy can be materialized safely. It does not modify
WindowsApps, bypass package protection, or guarantee a fix. In particular, if Desktop26.820.7780.0now requirescodex.exeto be copied with a mechanism that does not allow an Application Protected source to an unencrypted destination, then the durable fix is upstream in Codex's Windows relocation implementation (for example, using a decrypted-destination-compatible copy path and reusing a verified existing runtime when appropriate).Same issue!!!
Run the following command in Windows Powershell and i get the correct respond:
But run
where.exe codexi can't find anything.I can reproduce this exactly on Windows x64 with
OpenAI.Codex 26.820.7780.0.The app worked normally before the update. Immediately after updating to
26.820.7780.0, startup failed with:Unable to locate the Codex CLI binary.My AppX configuration is:
while the affected package was registered at:
I rolled back to the official
26.818.8289.0MSIX using:and ChatGPT immediately launches normally again.
Please also make the updater preserve the user's configured/existing AppX installation volume. My Windows default app volume is explicitly
B:\WindowsApps; the ChatGPT package should not silently fall back to or migrate onto C: during installation or updates.If relocation of bundled runtime files is necessary, it should work correctly with a non-system AppX volume rather than requiring the application itself to live on C:.
I reproduced the same
26.820.7780.0startup regression on another Windows x64 machine and recovered the app without rolling back, changing WindowsApps permissions or ownership, or settingCODEX_CLI_PATH.✅ Start here: verified no-rollback recovery
Comment permalink (copy this URL):
Fastest option when the desktop app cannot start: give the permalink above to a Codex agent that still runs and can access the Windows host filesystem, for example:
You can send the agent this prompt:
The agent can adapt the paths to the actual installation and let the user review the commands before execution. Do not put account credentials, tokens, or other secrets in the GitHub comment or prompt.
If you prefer to perform the recovery manually, go directly to Manual recovery (PowerShell) below. The script dynamically computes the five version-directory IDs from the currently installed package. It has been validated on
26.820.7780.0x64 and stops before writing if the known bundle layout is not present.Root cause confirmation
The first failure is not the WSL environment failing to find a user-installed Codex CLI. The desktop app cannot copy resources carrying the
Encrypted/ Application Protected attribute from the MSIX package into its per-user cache:Only afterward does it emit the misleading secondary errors:
The same launch also fails while copying the
cua_nodedirectory andrg.exe. Therefore, restoring only the WSLcodexfile, settingCODEX_CLI_PATH, or reinstalling the same MSIX package is insufficient for this Windows-native bootstrap regression.Version-directory rule used by the app
The app does not use a fixed
bin/codexpath. It derives a 16-character directory name from a resource descriptor. In the app-defined file order, each entry contributes:The app hashes the complete descriptor with SHA-256 and uses its first 16 characters.
For the official
26.820.7780.0x64 package, the resulting IDs are:The Windows CLI descriptor contains, in order:
The
cua_nodedescriptor contains:The WSL CLI descriptor contains:
Manual recovery (PowerShell)
The PowerShell script below selects the currently installed official OpenAI.Codex x64 package and dynamically computes all five version-directory IDs from its resource bytes. The same script can therefore be rerun after a future update when the bundle file lists, ordering, hashing algorithm, and cache layout remain unchanged. If a known bundle file is absent, it stops before writing. It reads package resources with
FileStreamand creates ordinary destination files so the destination does not inherit the source's Application Protected/EFS state. It writes into a random staging directory, verifies file size and SHA-256, and then renames the staging directory atomically.Safety boundaries:
CODEX_CLI_PATH.cua_nodefiles may take several minutes.<details>
<summary>PowerShell recovery script (dynamic bundle IDs; known x64 package layout)</summary>
</details>
Validation from the recovered machine
Before recovery, the launch probe consistently reported:
After materializing the five version directories from the currently installed official package:
The key bundle files matched the package sources by size and SHA-256. After relaunch:
The new launch logs no longer contained:
The desktop UI was also confirmed to launch normally.
Suggested upstream fix
Please make WindowsApps resource relocation support an Application Protected/EFS source and an ordinary decrypted per-user destination, for example by:
COPY_FILE_ALLOW_DECRYPTED_DESTINATION; orcopyFilereceivesERROR_ENCRYPTION_FAILED;This remains a bundle-layout-specific temporary recovery. The script now recomputes the directory IDs from the installed package, so it can be rerun unchanged when an update changes only the version and resource bytes. It deliberately stops if the known file lists are no longer present. The durable fix belongs in the app's relocation implementation.
Related: #38696, #34764, #25571.
I can independently reproduce this exact startup regression on another Windows x64 machine.
Environment
26.820.7780.010.0.26200.0x64OkC:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0F:\WindowsAppsThe packaged CLI exists at
app\resources\codex.exe, but launching the desktop app fails with:On this machine:
codex.exehas attributesArchive, Encrypted;%LOCALAPPDATA%\OpenAI\Codex\bin\codex.exehas attributesArchive;09D6723925E724EDF0BBBBC7B9E204526E0FB1462C86BD2A4997311FD5071EBA;codex-cli 0.150.0-alpha.8.Reproduction / workaround confirmation
CODEX_CLI_PATHunset, relaunching immediately reproduces the fatal startup dialog.codex.exe,codex-code-mode-host.exe,codex-windows-sandbox-setup.exe, andcodex-command-runner.exe) into%LOCALAPPDATA%\OpenAI\Codex\bin\succeeds when materialized as ordinary files.%LOCALAPPDATA%\OpenAI\Codex\bin\codex.exeallows Codex Desktop to start, and the runningcodex.exeprocess is the user-directory copy.This strongly supports the existing diagnosis: the bundled executable is present and valid, but the automatic WindowsApps-to-per-user relocation/materialization path fails. The generic “CLI binary missing” dialog is a downstream symptom.
The environment-variable workaround restores the current release, but it bypasses automatic CLI discovery/relocation and can pin the desktop app to this copied CLI after a future update. Please fix the Windows relocation path (including encrypted/Application Protected package resources and cross-AppX-volume states), and surface the underlying copy error in the startup dialog.
I can independently reproduce this on Codex App 26.820.7780.0 / Windows 10.0.26200.0 x64.
The bundled codex.exe exists, is marked Encrypted, and executing it directly returns Access is denied.
The issue appeared immediately after updating. My duplicate report was #40762.
Adding a few data points from my machine (26.820.7780.0, Windows 11 10.0.26200 x64) that may help triage:
1. This relocation step has been flaky since at least Aug 18 — the update just made it fatal.
My desktop logs show
bundled_executable_relocation_failed(sameerrno=-4094/UNKNOWN/copyfile) intermittently on Aug 18, 22, 23, 24 and 25, while the app still started fine — the previously relocated binary in%LOCALAPPDATA%\OpenAI\Codex\binwas still present, so the failed relocation only logged a warning. After updating to 26.820.7780.0 the app no longer accepted the old binary and attempted a fresh relocation, which failed, leaving no binary at all. There seems to be no fallback whenbin\codex.exeis missing.2. CopyFileW hangs on the packaged binaries; a plain read/write stream copy works.
app\resources\codex.exeshows theArchive, Encryptedattributes here too (confirming @xiaodeng2025's observation). One caveat: the successfully-relocated April-era binary also carriesArchive, Encrypted, so the attribute alone doesn't explain why relocation used to succeed. But the CopyFileW behavior is clearly broken: the app'sfs.copyFilefails with-4094, and PowerShellCopy-Itemon an 8 MB packaged exe hangs indefinitely (>90 s, never completes). A stream copy that doesn't go through CopyFileW ([IO.File]::OpenRead+CopyTo, orcpin Git Bash) completes in under a second and produces a hash-identical, working binary with theEncryptedattribute cleared.So a possible app-side fix: when the copyfile relocation fails, fall back to a read/write stream copy — that would make relocation robust regardless of the underlying cause.
3. Verified recovery (no rollback, no permission changes):
After this the app starts normally: zero fatal errors in the desktop log, app_server_connection reaches connected/initialized=true, and the running codex.exe is confirmed to be the manually placed copy.
Another exact reproduction on
OpenAI.Codex 26.820.7780.0x64.Environment/audit:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0...Get-AppxPackage *ChatGPT*.CODEX_CLI_PATHis unset at both User and Machine scopes.~/.codex/config.tomlcontains norunCodexInWindowsSubsystemForLinux,integratedTerminalShell,CODEX_CLI_PATH, orsandbox-binoverride.There had previously been a process-local workaround value pointing at
%USERPROFILE%\.codex\.sandbox-bin\codex.exe; removing it clears the environment variable. That workaround could allow the desktop app to get further/start, but then Codex was unable to reliably modify project files/code. The desktop global state still contains the expected project roots underthread-writable-roots, including the affected project directories, so this does not look like a simple missing writable-root grant.This strongly matches #40700 rather than a WSL-only configuration problem. It also suggests that setting
CODEX_CLI_PATHto a manually staged.sandbox-bin\codex.exeis not a safe workaround because it may create a desktop/runtime/sandbox mismatch even if startup succeeds.I can independently reproduce this exact regression on Windows 10:
26.820.7780.0(Microsoft Store/MSIX)codex-cli 0.150.0-alpha.819045.646626.818.8289.0D:\WindowsApps, exposed through the standardC:\Program Files\WindowsAppspackage junctionThe four bundled Windows CLI executables exist, but they are
Application Protected. Codex attempts to relocate them with Node.jsfs.copyFileSync()into%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>. The copy fails with:This is consistent with
ERROR_ENCRYPTION_FAILED/ Win32 error 6000. The destination cache containsrg.exe, but the expectedcodex.exegroup is absent. Codex then reports the misleading downstream error “Unable to locate the Codex CLI binary.”A byte-identical external copy of the bundled
codex.exeruns correctly, and pointingCODEX_CLI_PATHto it restores Desktop startup. The MSIX manifest declaresWindows.Desktop MinVersion="10.0.19041.0", so build 19045 is within the package's declared minimum version.My separate report was #40791; I am closing it as a duplicate so tracking remains centralized here.
Additional reproduction on Windows Native with Codex Desktop
26.820.7780.0: the app fails with “Unable to locate the Codex CLI binary.” The bundledcodex.exeexists but is markedArchive, Encrypted; copying it to a temporary directory fails with “The specified file could not be encrypted,” and running it directly returns “Access is denied.” No usable per-user staging copy exists.CODEX_CLI_PATHis unset and no WindowsApps permissions or package files were modified. This further confirms a WindowsApps/MSIX bundled executable relocation failure on the Windows-native startup path.I'm upgrading my ChatGPT App to
26.820.7780.0from App's internal button, and I'm sure the settings or configs aboutWindowsAppsdirectory, and env variables are never modified manually. The OS env is Windows 11 Enterprise 25H2 26220.9223 (but as far as I can see, maybe this is not main factor). When launched App, a loading window can be seen briefly, then a error was thrown back like this:<img width="838" height="251" alt="Image" src="https://github.com/user-attachments/assets/13132b5e-9e8e-4108-8e21-52dd1a9667a9" />
uhhh... According to this clue, I tried to run
app\resources\codex.exe, but Access is denied. Adding a new variableCODEX_CLI_PATHpointing toapp\resources\codex.execan make it success. So it may be the relocation failure which happened during the updating time?Confirmed on another Windows x64 installation.
Environment:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0D:\WindowsAppsCODEX_CLI_PATH: not setRead-only checks showed the bundled resources have the
Encryptedattribute:app\resources\codex.exeapp\resources\codexapp\resources\cua_nodeapp\resources\rg.exeBefore recovery, the per-user runtime cache under
%LOCALAPPDATA%\OpenAI\Codexdid not contain usable materialized executables forcodex.exe/node.exe/rg.exe.I applied the recovery script from:
https://github.com/openai/codex/issues/40700#issuecomment-5419391502
without changing WindowsApps ACLs, ownership, package files, encryption attributes,
CODEX_CLI_PATH, or Codex sessions/config.Recovered cache paths:
%LOCALAPPDATA%\OpenAI\Codex\bin\d0097be4feba73d0cua_node:%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\950613ca46815e82rg:%LOCALAPPDATA%\OpenAI\Codex\bin\b91d382ea836415f%USERPROFILE%\.codex\bin\wsl\bf0dd1e87d338bcerg:%USERPROFILE%\.codex\bin\wsl\1a4f6f66dd2f3710Verification after recovery:
codex-cli 0.150.0-alpha.8node v24.19.0ripgrep 15.2.0 (rev e89fff89ac)ChatGPT Desktop restarted successfully, and
codex.exeis now running from the per-user cache path.This supports the diagnosis that the desktop app's WindowsApps resource relocation path needs to handle
ERROR_ENCRYPTION_FAILED/ Application Protected or EFS-backed package resources, instead of surfacing the secondary “Unable to locate the Codex CLI binary” error.Same regression here, plus a verified workaround for the Windows-native path that does not require downgrading.
Environment:
OpenAI.Codex 26.820.7780.0(Microsoft Store / MSIX), single AppX volume onC:, no junctions10.0.26200.0x64codex-cli 0.150.0-alpha.8CODEX_CLI_PATHunset, Windows-native agent (no WSL)This confirms the diagnosis above. All four packaged executables report
Archive, Encrypted, andcipher /creportsCompatibility Level: Application Protected.copyFileSyncout of the package fails:One detail worth adding: a stream copy of the same file succeeds, because it writes plaintext bytes instead of asking the destination to inherit EFS.
So the source is readable by the user; only the
CopyFileencryption-preserving path fails. That supportsCOPY_FILE_ALLOW_DECRYPTED_DESTINATION(proposed in #38696) as the right upstream fix.The missing piece: how the destination directory name is derived
#38696 describes pre-staging into
<descriptor-hash>but not how to compute it. Fromapp.asarin26.820.7780.0, the relocation helper derives it as:Two groups are relocated independently, and file order matters:
| group | files, in order | destination |
| --- | --- | --- |
| CLI |
codex.exe,codex-code-mode-host.exe,codex-windows-sandbox-setup.exe,codex-command-runner.exe|%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\|| ripgrep |
rg.exe|%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\|On the next launch the app validates each staged file by size and SHA-256 (
mtimeis not checked) and returns early, so a correctly pre-staged directory makes it skip the failing copy entirely.Verified workaround
Result on my machine: the app starts normally and the sidecar runs from the staged path.
codex.exe --versionfrom that directory reportscodex-cli 0.150.0-alpha.8, and the staged directories survive relaunch (the app validates them and skips the copy).Caveats: the hashes change with every app update, so this has to be re-run after each Store update until the copy path is fixed upstream. Nothing under
WindowsAppsis modified, and no ACLs, ownership, or encryption settings are changed.I can reproduce this on Windows x64 with the Microsoft Store package
OpenAI.Codexversion26.820.7780.0.Startup fails immediately with:
Additional checks from PowerShell:
So the bundled CLI is present at
app\resources\codex.exe, but not atapp\resources\bin\codex.exe.I also tried setting
CODEX_CLI_PATHdirectly to the bundled executable:The variable resolves correctly, but attempting to execute the packaged binary directly fails with:
I have not manually modified
WindowsAppspermissions, ownership, or ACLs. This looks consistent with the same WindowsApps bundled-executable relocation/access regression described in this issue.Independent reproduction and successful recovery on another Windows x64 machine.
Environment:
10.0.26200.0x64OpenAI.Codex 26.820.7780.0D:\WindowsAppsC:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0D:\WindowsAppsOkThe desktop app had worked before this release. On cold start with
26.820.7780.0, the first relevant failures were:The source was the packaged
app\resources\codex.exe, and the destination was a.staging-d0097be4feba73d0-*directory under%LOCALAPPDATA%\OpenAI\Codex\bin. The same launch also failed to relocatecua_nodewithcopy_directory. Only after those failures did the app reportUnable to locate the Codex CLI binaryandDesktop bootstrap failed.The packaged resources existed and had the
Encrypted/ Application Protected behavior. Executing the packagedcodex.exedirectly returned Access Denied. SettingCODEX_CLI_PATHto that protected package path did not help and was removed.I applied the dynamic materialization approach from this comment, using buffered
FileStreamreads/writes, staging directories, SHA-256 verification, and atomic directory publication. No WindowsApps ACL, ownership, package file, encryption setting, session, or Codex configuration was changed.Computed cache IDs for this official package:
Verification before relaunch:
Cold-launch verification succeeded. The running sidecar was loaded from the versioned user cache:
The new desktop log contained:
and contained zero occurrences of:
This confirms that the package binaries are valid and that the fatal failure is in the WindowsApps-to-user-cache copy path. Installing Store apps on a secondary AppX volume exposes the regression, but changing the user's default Store volume should not be required. The durable fix should make the relocation helper support an Application Protected source and an ordinary decrypted destination, with the current hash verification and atomic publication retained.
Additional diagnostics + a verified no-rollback workaround (CODEX_CLI_PATH with a Windows-native CLI)
Environment: Windows 11 Pro 25H2 (build 26200), OpenAI.Codex 26.820.7780.0 (MSIX/Store), ChatGPT Plus. Same failure chain as this issue:
bundled_executable_relocation_failed(copy_file/copy_directory, errno -4094 UNKNOWN) → app-server fatal → startup dialog.1. Verified workaround — CODEX_CLI_PATH to a real Windows exe works.
Setting a user env var to a standalone Windows-native binary restored normal startup immediately:
Two details that matter: (a) it must be the real exe under
vendor\...\bin, not an npm.cmdshim (likely the EINVAL-on-.cmd reported in #40752); (b) version skew between app 26.820 and CLI 0.149.1 is tolerated so far (chat/code review all work). Note the bundledcua_noderuntime still fails to relocate (copy_directory), so computer-use features remain unavailable under this workaround.2. The app's own user-data profile is also Application-Protected EFS — backup before Reset is impossible with normal tools.
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Roaming\Codex\web\Codex\Default(Cookies, Local Storage, GCM Store…) showsArchive, Encrypted.Copy-Item/ CopyFileW fails there exactly like the package relocation does; only byte-level read (ReadAllBytes→ plain write) succeeds. Practical consequences: (a) any support flow advising Reset/uninstall should warn users that login/session data cannot be backed up with normal copy tools and will be destroyed by Reset; (b) Repair re-deploys from the same encrypted source and does not resolve the issue (confirmed).3. Hint for the durable fix.
On the same files where
CopyFileW-based copy fails (-4094 / ERROR_ENCRYPTION_FAILED family), a plain sequential read (CreateFile+ReadFile) succeeds for the same user process. Switching the relocation step from CopyFileW to a stream read/write (or reusing a size/hash-verified existing per-user runtime instead of purging it) would likely fix startup without changing how the MSIX is shipped.Corroborating the multi-volume reports above: this machine originally had the package on
E:\WindowsApps; the self-triggered Store update landed the new registration onC:\Program Files\WindowsApps.Additional confirmation and workaround from another affected Windows user:
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.C:) resolved the problem and the app started normally.This adds evidence that the failure is related to MSIX/AppX package placement on a secondary drive or the relocation of bundled executables from a non-system app volume. Testing install/move behavior between
C:and a secondary AppX volume may help reproduce the issue. The app should ideally handle this location transparently rather than requiring users to move it back toC:.I solved this problem using the following method. This method comes from a previous comment, but it has some problem with
\$in.Close();@HowToSaveMyLife thanks, your script works! I ended up going a slightly lazier route though — no copying at all, just pointed
CODEX_CLI_PATHat an existing standalone CLI and the app started right away.one thing that got me at first: it has to be the real exe under
vendor\...\bin— the.cmdshim npm puts on PATH won't work (probably the same EINVAL as #40752).been running app 26.820 with CLI 0.149.1 for a few hours now, chat and code review all fine, so the version mismatch doesn't seem to matter much. and when a newer CLI lands it's just
npm i -g @openai/codex@latest— nothing to redo whenever the desktop app updates itself.only downside is the same as your method: cua_node still can't relocate, so computer-use stuff stays broken either way. hopefully the next app build just fixes the relocation properly.
I’m seeing the same regression after the Microsoft Store auto-update to
26.820.7780.0.The app was working normally before the update. After the update and a reboot, it immediately started failing with:
A few checks from my machine:
OpenAI.Codex 26.820.7780.0 x64C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0app\resources\codexandapp\resources\codex.exeare present.Archive, Encryptedattributes.codexfile to%TEMP%fails with the Windows error:The specified file could not be encrypted.codex.exe --versiondirectly fails withAccess denied/ApplicationFailedException.codex-cli 0.135.0), so this does not look like a general CLI/PATH problem.CODEX_CLI_PATHas a workaround.The timing is very clear on my side: working before the Store update → auto-update to 26.820.7780.0 → reboot → app no longer starts.
I’m keeping the installation unchanged for now and waiting for an official fix, so I can provide more diagnostics if needed.
You can just download ChatGPT beta. It can successfully launch.
Update: moving ChatGPT back to C: fixed the issue for me.
Windows Settings showed ChatGPT installed on D:, and my default AppX volume was also
D:\WindowsApps. I used:Settings → Apps → Installed apps → ChatGPT → Move → C:
After that,
26.820.7780.0launched normally again. I did not setCODEX_CLI_PATHor change any WindowsApps permissions.Thanks for the bug report. We understand the problem and are working on expediting a fix.
I hit what appears to be the same Windows Codex Desktop issue.
Environment:
26.820.7780.0Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.What I found:
where.exe codexreturned only the npm shims:C:\Users\lenovo\AppData\Roaming\npm\codexC:\Users\lenovo\AppData\Roaming\npm\codex.cmdcodex.exedid exist under:C:\Users\lenovo\AppData\Local\OpenAI\Codex\bin\<hash>\codex.exeCODEX_CLI_PATHto that executable allowed the desktop app to launch, but that binary turned out to be:codex-cli 0.140.0-alpha.2failed to read threadrollout-...jsonl does not start with session metadataI inspected the corresponding
.jsonlfile. The file itself was valid UTF-8 JSON, started directly with{, and the first record was:"type":"session_meta"The same session metadata showed it had originally been written by:
cli_version: 0.149.0-alpha.4.1So the desktop app was effectively trying to read a session written by
0.149.0-alpha.4.1using the much older0.140.0-alpha.2CLI.I then updated the npm Codex CLI:
npm install -g @openai/codex@latestThis installed:
codex-cli 0.150.0I changed
CODEX_CLI_PATHto point directly to the native0.150.0codex.exeunder the npm package:...\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\bin\codex.exeAfter fully restarting Codex Desktop:
.jsonlsession file was necessary.So in my case, the issue appears to be a combination of:
Current workaround: manually point
CODEX_CLI_PATHto an up-to-date nativecodex.exe.I thought AppX had thinged a thing and borked the install by thinging things. This remains the best explanation I have managed to form about package managers.
Get-AppxPackage -Volume (Get-AppxVolume -Path "D:\") -Name OpenAI.Codexcorrectly findsOpenAI.Codex 26.820.7780.0, while querying the C: AppX volume does not.Inspecting the reported install path with
Get-Item -Forceshows that:C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0is actually a junction pointing to the physical package under
D:\WindowsApps.So Windows Package Manager has successfully thinged the thing, and I retract the accusation that it randomly moved Codex to C:. :))
Unfortunately, Codex still does not start.
Get-AppxPackage OpenAI.Codex | Format-List *reports:Version : 26.820.7780.0Status : OkIsPartiallyStaged : FalseThe bundled CLI also physically exists at:
app\resources\codex.exeunder the package.
However, launching Codex still fails with:
Unable to locate the Codex CLI binary.Trying to execute the packaged CLI directly with
& "<package-path>\app\resources\codex.exe" --versionreturns:Access is deniedI also tried moving the package explicitly to the configured D: AppX volume with
Move-AppxPackage -Package $pkg.PackageFullName -Volume $vol -Verbose. AppX reportedOperation completed, and the package remains correctly associated with the D: AppX volume, but the Codex startup failure is unchanged.So this does not appear to be caused by the non-system AppX volume itself. The package is registered, status is
Ok, the CLI payload exists, and the package is on the expected volume.Also an important note: Restarting Windows did not fix the issue! :))
P.S. I missed the reply from @etraut-openai above.
I shall shut up now and wait for the patch. :))
I hit the same issue on
OpenAI.Codex 26.820.7780.0and did some read-only forensics after recovering the app. I found fairly strong evidence that this is a regression involving a secondary Appx Volume, rather than a missingcodex.exe.Previous version was already on D: and worked
This was not a case where the 26.820 update unexpectedly moved the app from C: to D:.
Windows AppX event history shows:
26.818.8289.0was staged and registered to Appx Volume D: on Aug 24.D:\WindowsApps\OpenAI.Codex_26.818.8289.0_...\app\resources\app.asar26.818.8289.0 -> 26.820.7780.0on the same D: Appx Volume.D:\WindowsApps\OpenAI.Codex_26.818.8289.0_...into
D:\WindowsApps\Deleted\...So the previous build definitely worked while physically deployed on D:.
What changed with 26.820
On the first failing 26.820 launches, the JS stack was still executing from:
D:\WindowsApps\OpenAI.Codex_26.820.7780.0_...\app\resources\app.asarbut
bundled_executable_relocation_failedreported thissourcePath:C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_...\app\resources\codex.exeThe relocation destination was:
%LOCALAPPDATA%\OpenAI\Codex\bin\.staging-...\codex.exeThe copy failed with
errno=-4094,code=UNKNOWN,syscall=copyfile, and immediately afterwards bootstrap failed with:Unable to locate the Codex CLI binaryThe package itself did contain:
app\resources\codex.exeso this was not simply a missing CLI payload.
Moving D: -> C: immediately fixed it
I used Windows Settings to move the same installed package from D: to C:.
No:
CODEX_CLI_PATHchangewas performed.
Immediately afterwards, the bundled CLI was successfully relocated to:
%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exeand Codex launched normally.
The relocated
codex.exeis byte-for-byte identical to the bundledapp\resources\codex.exe.One additional static-analysis clue
In the installed
app.asar, the WindowsApps detection logic appears to check specifically for the normalized substring:\program files\windowsapps\which does not generalize to secondary Appx Volume paths such as:
D:\WindowsApps\...I cannot prove which layer first produces the canonical C: path (Codex, Electron
process.resourcesPath, or AppX projection), but the evidence strongly suggests a 26.818 -> 26.820 regression in bundled CLI relocation/fallback handling on secondary Appx Volumes.I can provide redacted failure/success log excerpts and relevant AppX event IDs if useful.
I can reproduce what appears to be the same bundled-runtime relocation/bootstrap issue on a newer build, but with one important difference: the bundled files are NOT encrypted on my machine.
Environment
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0
Findings
For app\resources\codex, Get-Item reports only:
Attributes = Archive
There is no Encrypted attribute.
Manual Copy-Item from WindowsApps to a normal user-writable directory succeeds.
& "$pkg\app\resources\codex.exe" --version
Result:
Access is denied
The exact same executable copied to %TEMP% runs successfully:
codex-cli 0.150.0-alpha.8
exit code 0
.staging-b91d382ea836415f-...
.staging-d4ec92c58943bf91-...
.staging-c6c4820dcd243daa-...
...
Every recent .staging-* directory is empty.
There is one older complete runtime directory:
%LOCALAPPDATA%\OpenAI\Codex\bin\d0097be4feba73d0
It contains all four executables and they execute normally.
As a workaround I set:
CODEX_CLI_PATH =
%LOCALAPPDATA%\OpenAI\Codex\bin\d0097be4feba73d0\codex.exe
After restarting Codex Desktop, the app and the local execution host fully recovered.
Independent checks after the workaround:
The resolved codex/rg paths are now under:
%LOCALAPPDATA%\OpenAI\Codex\bin\...
rather than WindowsApps.
Additional observations
Conclusion
This suggests the failure may be broader than the encrypted/EFS case originally reported in #40700.
On this machine:
So the underlying problem appears to be in the WindowsApps bundled-runtime relocation/bootstrap path rather than a missing Codex CLI or a project/shell issue.
I can reproduce this issue on Windows 11 with ChatGPT/Codex Desktop version 26.820.9563.0.
Symptoms:
"Unable to locate the Codex CLI binary.
Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex."
Troubleshooting already attempted:
The issue still reproduces after all of the above.
Additional information:
This suggests the account/model/standalone CLI are working, while the Windows desktop app startup path is still failing.
Windows 26.820 bundled Codex CLI failure: from “binary not found” to the actual relocation bug
This report is intended as a detailed follow-up to openai/codex#40700. It documents not only the final diagnosis, but how the diagnosis was reached from an initially unknown failure.
Executive summary
The application displayed:
The same Desktop installation had worked on August 4, 2026. When it was opened again on August 26, 2026, build
26.820.7780.0showed the error above. That timeline later explained why an August 4 cache existed but did not match the newer package.Read-only inspection of the packaged Desktop program recovered the two executable-resolution branches directly relevant to this incident:
This immediately explains why the standalone workaround worked: when a usable
CODEX_CLI_PATHwas present, Desktop selected that executable and did not need to calculate the bundled hash, validate the bundled cache, or copy the packaged files.The original failure occurred only on the second branch. The bundled files were present, discovery and hashing worked, and the first failing operation was
copy_filewhile Desktop tried to create the current bundle cache.Two recovery paths were verified:
CODEX_CLI_PATHto it. This bypasses the bundled path completely.The second method restores the machine, but does not fix the Desktop regression. It proves that Desktop can validate and reuse an already-correct cache; it does not prove that Desktop
26.820.7780.0can automatically create that cache from an empty state.1. Tested package and executable-resolution flow
The affected application was registered as:
<img width="664" height="114" alt="Image" src="https://github.com/user-attachments/assets/e0002d23-b2ee-40c8-9fe8-c3f83ba0d989" />
Get-Process ChatGPT | Select-Object Pathconfirmed that the runningChatGPT.execame from this package. The packaged Desktop logic then resolves the Codex executable using the two-branch flow shown above: an explicit override first, otherwise the bundled resolver.2. What the bundled branch is supposed to do
The installed package contains these four Windows executables under
app\resources:Desktop does not simply search the whole disk for
codex.exe. The packaged program code supplies its ownresourcesPath, chooses the expected filename for Windows, and prepares a versioned runtime cache under:The locally inspected minified functions were labelled
JP,BP, andrF. Those names are implementation identifiers from this build, not a public API. Once no usable explicit override has been selected, the bundled branch is:Hashing and relocation are consecutive stages, not two competing ways to find the executable.
Hashing only requires reading the package files. It does not require copying them first. That distinction becomes central to this bug.
3. The investigation, in the order it actually happened
Step 1 — Confirm the running Desktop package and whether its bundled files exist
The first useful question was not whether a global
codexcommand existed, but whether the affected Desktop package actually contained the executables its bundled branch expected.Observed:
The running process path was also checked directly:
The active
ChatGPT.execame from the registered C: package. Its resources directory was then listed:The result included
codex.exeand all three Windows sibling executables. The bundled executable was not literally absent. The remaining possibilities were path generation, validation, relocation, or process creation.Step 2 — Use an explicit CLI as a controlled substitute
The standalone installer had placed a native Windows CLI at a user-directory path, even though that directory was not in
PATH.The resolver flow extracted later showed why this was a clean experiment: a usable
CODEX_CLI_PATHis selected before the bundled hashing/cache branch. The test therefore changed one input:A user-level
CODEX_CLI_PATHwas used because a process-local PowerShell variable is not a reliable assumption when launching a packaged app through Windows activation.Desktop opened, and a real local-file task succeeded.
<img width="664" height="114" alt="Image" src="https://github.com/user-attachments/assets/d159161a-3278-409a-83f4-a9a3bb89eb34" />
This established:
It restored use and isolated the faulty branch, but it did not yet reveal which bundled operation failed.
Step 3 — Determine whether Windows failed to start the app or the app failed internally
Windows AppModel events from the original failure window were queried:
Windows recorded successful package-container creation and successful
ChatGPT.exeprocess creation. Therefore the problem was not Start-menu registration, AppID activation, or failure to create the Desktop process.The Codex SQLite log database was then opened read-only and queried for the same time window. It contained zero CLI log entries.
The combined evidence was:
This placed the failure after Desktop started but before a Codex CLI process successfully began running.
Step 4 — Recover the executable-resolution flow from the packaged Desktop program
At this point external checks could not distinguish path construction from relocation. The packaged Electron archive was read in binary mode, without modifying or unpacking it, and the exact error string was located:
This established that the error is thrown by Desktop when its resolver returns no valid launch configuration. It is not an error emitted by
codex.exe.Further read-only searches progressively recovered the relevant definitions and call sites:
CODEX_CLI_PATH;JP(resourcesPath)for the bundled executable candidate;uF(...)for a%LOCALAPPDATA%destination path;BP(...)for WindowsApps-specific preparation;rF(...)for source hashing, cache validation, staging, copying, rename, and destination verification.This changed the leading hypothesis from “the resolver probably constructs the wrong path” to a testable relocation pipeline:
Step 5 — Inspect the runtime cache and compare old versus current bundles
The resolver's destination root was inspected:
Only two older hash directories existed:
The old
codex.exesize was358,182,192bytes. The current package'scodex.exewas307,568,432bytes. The old directory was therefore not the cache for the current package.An old cache is not a fallback alias. Desktop derives a new directory from the current files and validates its contents. When the bundled artifacts change, their hashes and bundle directory change.
Step 6 — Reproduce the current bundle hash
The extracted algorithm was applied to the four current package files:
filename + NUL + lowercase-file-hash + NUL.Result:
That directory did not exist at the time of failure.
This resolved an important apparent contradiction: the application could know
d0097be4feba73d0even though it could not copy the files. Hash calculation reads source bytes; relocation happens afterward.Step 7 — Find the exact failing relocation operation
Desktop diagnostics were searched for the event name found in the packaged program logic. Repeated records identified:
The failure was no longer merely “somewhere in JP/BP/rF.” It was the first
copy_fileinsiderF.Step 8 — Separate source problems from destination problems
The cache destination was tested in isolation for:
All passed. No matching Microsoft Defender detection was found, and Controlled Folder Access was disabled in the tested environment.
The package source files were then inspected:
codex.exeexisted, had an OpenAI signature with statusValid, and showedEncrypted.cipher /cdescribed it as Application Protected.A CopyFile-style copy reproduced the native Windows failure:
A byte-stream copy—open source for reading, create a fresh normal destination file, copy bytes—succeeded. The destination had:
This is the decisive root-cause experiment.
The evidence supports this precise wording:
It would be an overstatement to claim that OpenAI intentionally designed the cache copy to preserve this security attribute. The observable fact is that the chosen file-copy operation encounters that protection metadata and fails, whereas a fresh byte-stream destination does not.
Step 9 — Repair and independently verify the default bundled path
The final operation was not performed by the Desktop process that would later be closed. A separate PowerShell watchdog recorded time, stages, errors, processes, cache changes, hashes, and signatures to disk.
The repair sequence was:
The final CLI path was:
The standalone
0.149.1installation remained on disk but was not used in this clean verification.4. Root cause
Direct cause
rFfailed duringcopy_filewhile relocatingcodex.exefrom the MSIX package resources to the per-user runtime cache. The ordinary copy path reproduced Windows error0x80071770; the source was Application Protected.Why the UI said “Unable to locate”
The high-level resolver treats failed preparation as “no usable executable path.” When that resolver returns
null, Desktop throws the generic locating error. Therefore “locate” includes more than searching for a filename; it includes preparing and validating a runnable cached copy.Why August 4 had worked
The August 4 cache contained a different older four-file bundle. It demonstrates that an earlier application/bundle combination successfully populated a cache. It does not prove that build
26.820.7780.0can copy the new package files.The evidence does not identify the exact upstream code change that introduced the regression. It establishes that the current package content/protection state plus the current relocation copy primitive fail together.
5. Bundle identity for this exact package
| File | Bytes | SHA-256 |
|---|---:|---|
|
codex.exe| 307,568,432 |09d6723925e724edf0bbbbc7b9e204526e0fb1462c86bd2a4997311fd5071eba||
codex-code-mode-host.exe| 65,880,368 |3b93fc5df0b38358d7fffb290a3f11a56cecbebbf70eb62bf8c58d6d994b28e3||
codex-windows-sandbox-setup.exe| 15,403,312 |e5852603d0b0cf5f232efc5d6cd28b61c7f7d67e8ad4dc57314ae33190bef171||
codex-command-runner.exe| 8,162,096 |955dfc76159805fffa3811a3873945a63759e92010dd30dc8b74a3a2cbfda1cc|These values belong only to
OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0. They must not be reused after an application update.6. Recovery option A: standalone CLI override
This is the lower-risk workaround for most affected users.
Install a trusted native Windows Codex CLI, record any existing value, and point the user-level override to the real
codex.exe:Completely exit and reopen Desktop.
What it changes:
What it does not change:
To restore the previous value later, set the saved value again. If there was no previous value:
Do not clear an organization-managed value without checking its source.
7. Recovery option B: rebuild the current bundle cache by byte stream
This is an advanced, version-specific recovery for users who understand the integrity checks and want Desktop to use its bundled CLI.
The accompanying
inspect-or-repair-bundled-cli.ps1script defaults to inspection only:It reports:
CODEX_CLI_PATHvalues.If
Get-AppxPackageis unavailable in a restricted shell, supply the exact previously verified path:After reviewing the script and output, fully exit Desktop and explicitly request repair:
Repair mode:
It does not modify WindowsApps,
app.asar, environment variables, or old cache directories.8. What “reuse an already-valid bundle-hash cache” means
This phrase is easy to misread.
It does mean:
It does not mean:
The restored launch follows the default no-override resolver, but takes its “valid cache already exists” branch. The broken “cache missing → copy from WindowsApps” branch is skipped.
9. What was ruled out
d7e8094cfb76a267bundle0.149.1in the final clean test10. Suggested upstream changes
The relocation implementation should use a copy strategy compatible with Application Protected package payloads. Based on the successful experiment, a robust sequence would be:
UNKNOWN -4094.Trust in the runtime cache should come from verified content identity. This recommendation is an inference from the local evidence, not a statement of OpenAI's unpublished security design.
11. Safety boundaries
C:\Program Files\WindowsApps.app.asar.12. Final status
The tested machine is currently functional through the bundled default resolver with
CODEX_CLI_PATHabsent. The actual CLI process came from:The user-visible failure is recovered. The upstream regression is not proven fixed.
References
Additional reproduction / diagnostics on 26.820.9563.0 (Windows x64).
I hit the same startup failure pattern, with a few extra observations that may help narrow the failure path.
Before recovery
OpenAI.Codex 26.820.9563.0.ChatGPT.exeprocesses stayed alive and responsive, but all hadMainWindowHandle = 0.--type=crashpad-handler--type=gpu-process--type=utility --utility-sub-type=network.mojom.NetworkService--type=utility --utility-sub-type=storage.mojom.StorageServiceLaunching app.Application Error,Windows Error Reporting, orApplication Hangevents were recorded..dmpfiles were generated in the usual Codex Crashpad report locations.The bundled CLI was present at:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0\app\resources\codex.exeIts properties were:
A direct copy test to
%TEMP%failed reproducibly with:System.IO.IOException: The specified file could not be encrypted.Recovery / workaround evidence
I also have a globally installed npm Codex CLI. The native binary is located under:
%APPDATA%\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\bin\codex.exeIts properties are:
Correction to my earlier wording: I initially believed no explicit CLI override was present, but a later scope check showed that
CODEX_CLI_PATHis in fact set at both Process and User scope and points to the npm native binary; Machine scope is empty.After recovery, the desktop process tree shows its app-server child being launched from that npm-installed native Codex binary, e.g.:
%APPDATA%\npm\...\codex.exe -c features.code_mode_host=true app-server ...At the same time, a per-user cached CLI appeared at:
%LOCALAPPDATA%\OpenAI\Codex\bin\d5f4c71927a04589\codex.exeThat cached file has:
So the cached per-user file is byte-for-byte identical to the bundled
resources\codex.exe(same size and SHA-256), but it is not marked Encrypted.This is potentially useful because:
Copy-Itemof the Application Protected / Encrypted WindowsApps binary fails withThe specified file could not be encrypted;%LOCALAPPDATA%\OpenAI\Codex\bin\...;CODEX_CLI_PATHforapp-server, and the renderer/main window is then created successfully.I therefore cannot attribute recovery to running
codex.exe --version; that happened around the same time, but the explicitCODEX_CLI_PATHoverride is the stronger explanation for why app-server successfully started. The useful findings are:codex.exeis still Application Protected /Encrypted;ERROR_ENCRYPTION_FAILEDbehavior;It may be worth investigating both paths:
ERROR_ENCRYPTION_FAILED, explicitly fall back to an already available nativecodex.exe(for example viaCODEX_CLI_PATH/ PATH discovery) instead of stalling before renderer creation;I can independently reproduce this on Codex Desktop
26.820.9563.0x64.In my case, Codex launches multiple
ChatGPT.exeprocesses, but no GUI is ever created (MainWindowHandle = 0for all processes). The main process remains alive/responsive and is not suspended.The desktop log stops immediately after:
Launching app ... platform=win32Appshot hotkey inactive configured=true enabled=false platform=win32There is no Crashpad dump.
I also confirmed that disabling GPU does not help, and Windows app Repair/Reset plus a fresh Codex roaming profile do not resolve the issue.
The strongest evidence appears to be the bundled
cua_noderuntime:...\OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0\app\resources\cua_nodePowerShell reports its attributes as:
Directory, Archive, EncryptedA direct
Copy-Itemtest from that WindowsApps directory to a normal user-writable temp directory fails with:The specified file could not be encrypted.Each attempted Codex launch leaves another:
%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\.staging-*directory behind.
I currently have many abandoned
.staging-*directories from repeated startup attempts.Interestingly,
codex.exeitself was successfully relocated to:%LOCALAPPDATA%\OpenAI\Codex\bin\d5f4c71927a04589\codex.exeso on this machine the startup blocker appears to be specifically the
cua_noderuntime relocation from the Application Protected / Encrypted WindowsApps package.This appears closely related to #34764, but in
26.820.9563.0the failure prevents the entire Codex Desktop GUI from starting rather than only disabling Computer Use.Happy to provide additional PowerShell diagnostics or logs if useful.
Confirmed workaround on Windows 11 for the
Unable to locate the Codex CLI binaryregression.Environment:
26.820.10647.026200%LOCALAPPDATA%\OpenAI\Codex\bin\...\codex.execodex-cli 0.150.0-alpha.8Observed behavior:
Unable to locate the Codex CLI binary.%LOCALAPPDATA%\OpenAI\Codex\bincontained many.staging-*directories.codex.exeappeared, but during subsequent startup attempts that directory could be rotated/removed, so pointingCODEX_CLI_PATHdirectly at that managed hash directory was not stable.Workaround that successfully started Codex Desktop:
Then fully close ChatGPT/Codex processes and reopen Codex normally from Start.
This worked for me. Copying the executable outside
%LOCALAPPDATA%\OpenAI\Codex\binwas important because the hash directory inside that tree was modified/removed by subsequent startup/update attempts. This is only a temporary workaround until the relocation/updater issue is fixed; the copied CLI can become stale after future updates.Also reproduces on the two builds after the one reported here, with new root-cause detail and a reliable workaround.
Versions: 26.820.9563.0 and 26.825.3734.0 (Store auto-update), Windows 11 10.0.26200 x64
Symptom variant (headless window): processes spawn but no window is ever created; the main process busy-spins (58+ CPU-seconds) for ~8 minutes; the desktop log stops right after
Appshot hotkey inactive. During this state the app repeatedly creates.staging-<hash>-*directories under%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\that stall at ~3600/4680 files, get cleaned up, and are recreated — matchingbundled_executable_relocation_failed ... errno=-4094 code=UNKNOWN syscall=copyfilein the log. On 26.820.9563.0 the loop eventually succeeded and the window appeared (startupElapsedMs≈15600); on 26.825.3734.0 it did not recover on its own within 40+ minutes.Two independent failure modes in the relocation step:
C:\Program Files\WindowsApps\OpenAI.Codex_<ver>_x64__2p2nqsd0c76g0\app\resourcescarries the NTFSEncryptedattribute on affected machines ((Get-Item ...).Attributes→Archive, Encrypted). On accounts where EFS cannot initialize (cipher /k→ "The request is not supported"), CopyFileW-based copies fail withERROR_ENCRYPTION_FAILED("cannot encrypt the specified file") because CopyFileW preserves the Encrypted attribute on the destination. robocopy fails the same way; plain read→write copies of the same files succeed.resources\cua_nodecontains pnpm-store directory trees deeper than 260 characters; withLongPathsEnabled=0evenGet-ChildItem -Recurseerrors on them, so the relocation copy cannot enumerate the full tree.Workaround that reliably unblocks startup (~15 s): pre-create the relocation destination so the app skips its own copy:
<hash>= the hash from the leftover%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\.staging-<hash>-*directory name (e.g.759ccb73c5d75f83for 26.825.3734.0);...\app\resources\cua_node→%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\with anything that does not preserve attributes (e.g. Nodefs.readFileSync/fs.writeFileSync— 4680 files / ~319 MB, 0 failures);ChatGPT.exeand relaunch.(For the earlier "Unable to locate the Codex CLI binary" dialog variant on .7780: setting
CODEX_CLI_PATHto a realcodex.exeworked — note that pointing it at the npmcodex.cmdshim fails withspawn EINVAL.)Suggestions:
\\?\-prefixed (long-path-aware) paths in the relocation routine;