Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
20260827new update
What subscription do you have?
no
What platform is your computer?
windows
What issue are you seeing?
Environment
ChatGPT Desktop: 26.820.7780.0
Codex CLI: 0.150.0-alpha.8
Windows 11: 10.0.22621 x64
Bundled Node.js: v24.19.0
Problem
Local command/file execution in ChatGPT Desktop consistently fails with:
code-mode host exited during handshake
The Desktop app is unable to reliably execute local commands such as Get-Location or read local project files.
Key diagnostic finding
ChatGPT Desktop repeatedly tries to execute its bundled Node runtime:
C:\Users\c\AppData\Local\OpenAI\Codex\runtimes\cua_node\950613ca46815e82\bin\node.exe --version
and receives:
nodeVersionError.code = 3221225506
0xC0000022
stdout = ""
stderr = ""
0xC0000022 corresponds to an access-denied status.
However, executing the exact same bundled node.exe manually from PowerShell succeeds:
v24.19.0
ExitCode = 0
This indicates that the executable itself works, while its launch from the ChatGPT Desktop process context fails.
Additional verification
The following have all been tested successfully:
- Bundled codex.exe starts and works normally.
- Main Desktop → codex app-server initialization handshake succeeds.
- codex sandbox cmd.exe works.
- codex sandbox powershell.exe works.
- codex-code-mode-host.exe --help works and exits with code 0.
- codex-command-runner.exe starts and responds as expected when manually invoked.
- Authenticode signatures for:
codex-code-mode-host.exe
codex-command-runner.exe
codex-windows-sandbox-setup.exe
bundled node.exe
are all Valid. - Bundled node.exe is signed by OpenAI OpCo, LLC.
- Project directory exists and is an ordinary local directory.
- ChatGPT process mitigation settings do not prohibit child-process creation or require Microsoft-only signed binaries.
Troubleshooting already performed
- Completely reinstalled ChatGPT Desktop.
- Performed a clean-room reset of all Codex/Desktop user state and caches.
- Temporarily isolated the npm Codex installation.
- Re-created all Desktop/Codex runtime state from scratch.
- Disabled features.code_mode_host in config.toml.
- Added Defender exclusions for ChatGPT/Codex/helper executables.
- Temporarily stopped Nahimic/A-Volute services.
None of the above resolved the issue.
The clean-room test is particularly important: even with all user configuration/runtime/cache state removed and npm Codex isolated, Desktop still produced the same:
node.exe --version
→ 3221225506 / 0xC0000022
Other observations
Windows Code Integrity logs contain repeated Event ID 3033 entries involving Nahimic/A-Volute DLL injection attempts into ChatGPT.exe, but disabling the Nahimic service did not resolve the problem, so this does not appear to be the primary cause.
No corresponding normal Application Error / WER crash for the bundled Node or code-mode host was observed.
The CLI execution path remains functional; the failure appears specific to the ChatGPT Desktop packaged-process / child-process launch context.
Expected behavior
ChatGPT Desktop should be able to launch its bundled Node/code-mode runtime and perform local command and file operations.
Actual behavior
The Desktop-local execution host exits during handshake, and bundled node.exe --version fails only when invoked from the Desktop context with:
3221225506 (0xC0000022)
while the exact same binary executes normally when started manually.
Suspected area
This appears to be related to the Windows ChatGPT Desktop/MSIX packaged-process child-process environment or the Desktop → local code-mode runtime initialization path, rather than a broken Node/Codex binary or user configuration.
What steps can reproduce the bug?
Environment
ChatGPT Desktop: 26.820.7780.0
Codex CLI: 0.150.0-alpha.8
Windows 11: 10.0.22621 x64
Bundled Node.js: v24.19.0
Problem
Local command/file execution in ChatGPT Desktop consistently fails with:
code-mode host exited during handshake
The Desktop app is unable to reliably execute local commands such as Get-Location or read local project files.
Key diagnostic finding
ChatGPT Desktop repeatedly tries to execute its bundled Node runtime:
C:\Users\c\AppData\Local\OpenAI\Codex\runtimes\cua_node\950613ca46815e82\bin\node.exe --version
and receives:
nodeVersionError.code = 3221225506
0xC0000022
stdout = ""
stderr = ""
0xC0000022 corresponds to an access-denied status.
However, executing the exact same bundled node.exe manually from PowerShell succeeds:
v24.19.0
ExitCode = 0
This indicates that the executable itself works, while its launch from the ChatGPT Desktop process context fails.
Additional verification
The following have all been tested successfully:
- Bundled codex.exe starts and works normally.
- Main Desktop → codex app-server initialization handshake succeeds.
- codex sandbox cmd.exe works.
- codex sandbox powershell.exe works.
- codex-code-mode-host.exe --help works and exits with code 0.
- codex-command-runner.exe starts and responds as expected when manually invoked.
- Authenticode signatures for:
codex-code-mode-host.exe
codex-command-runner.exe
codex-windows-sandbox-setup.exe
bundled node.exe
are all Valid. - Bundled node.exe is signed by OpenAI OpCo, LLC.
- Project directory exists and is an ordinary local directory.
- ChatGPT process mitigation settings do not prohibit child-process creation or require Microsoft-only signed binaries.
Troubleshooting already performed
- Completely reinstalled ChatGPT Desktop.
- Performed a clean-room reset of all Codex/Desktop user state and caches.
- Temporarily isolated the npm Codex installation.
- Re-created all Desktop/Codex runtime state from scratch.
- Disabled features.code_mode_host in config.toml.
- Added Defender exclusions for ChatGPT/Codex/helper executables.
- Temporarily stopped Nahimic/A-Volute services.
None of the above resolved the issue.
The clean-room test is particularly important: even with all user configuration/runtime/cache state removed and npm Codex isolated, Desktop still produced the same:
node.exe --version
→ 3221225506 / 0xC0000022
Other observations
Windows Code Integrity logs contain repeated Event ID 3033 entries involving Nahimic/A-Volute DLL injection attempts into ChatGPT.exe, but disabling the Nahimic service did not resolve the problem, so this does not appear to be the primary cause.
No corresponding normal Application Error / WER crash for the bundled Node or code-mode host was observed.
The CLI execution path remains functional; the failure appears specific to the ChatGPT Desktop packaged-process / child-process launch context.
Expected behavior
ChatGPT Desktop should be able to launch its bundled Node/code-mode runtime and perform local command and file operations.
Actual behavior
The Desktop-local execution host exits during handshake, and bundled node.exe --version fails only when invoked from the Desktop context with:
3221225506 (0xC0000022)
while the exact same binary executes normally when started manually.
Suspected area
This appears to be related to the Windows ChatGPT Desktop/MSIX packaged-process child-process environment or the Desktop → local code-mode runtime initialization path, rather than a broken Node/Codex binary or user configuration.
What is the expected behavior?
No response
Additional information
No response
Activity
CloudyRiver9 commentedon Aug 26, 2026
Environment
26.820.7780.00.150.0-alpha.810.0.22621 x64v24.19.0Problem
Local command/file execution in ChatGPT Desktop consistently fails with:
Examples that fail from Desktop include:
Get-Locationand reading local project files such as:
F:\AI_Chat\AI自构建模拟世界\界面.pngKey diagnostic
ChatGPT Desktop repeatedly fails when trying to execute its bundled Node runtime:
Desktop log:
3221225506 = 0xC0000022.However, the exact same node.exe works normally when launched manually from PowerShell:
Result:
The bundled Node executable also has a valid Authenticode signature:
Important observation
The main Desktop -> Codex app-server startup succeeds.
Desktop log shows:
So the failure is not the main Codex app-server handshake.
The failure appears later in the Desktop local execution / code-mode runtime child-process chain.
Additional verification
The following all work normally:
The following executables all have valid Authenticode signatures:
codex-code-mode-host.exe --helpexit code:0codex-command-runner.execan also start manually and exits with the expected:when invoked without its parent-provided pipe.
Clean-room test
I performed a complete clean-room reset.
The following user/runtime/cache state was moved aside and regenerated from scratch:
.codexAfter launching ChatGPT Desktop in this completely clean environment, the same error still occurred:
Therefore the problem does not appear to be caused by:
All original state was restored afterward.
Reinstall / workaround testing
Also tested:
None of these fixed the issue.
Setting:
did not restore local execution/file access.
Windows process mitigation check
The running ChatGPT.exe process does not appear to block child-process creation.
Relevant results:
So this does not appear to be caused by a standard Windows Exploit Protection child-process restriction.
Multiple Codex installations
An npm Codex installation also exists:
However, Desktop logs explicitly show that Desktop launches its bundled Codex:
not the npm wrapper.
The Desktop bundled helpers and
.codex\plugins\.plugin-appserverhelpers have identical SHA256 hashes.The npm helpers are different binary builds, despite reporting the same CLI version, but there is currently no evidence that Desktop is invoking the npm helper paths.
Expected behavior
ChatGPT Desktop should be able to launch its bundled local execution runtime and execute local commands/files.
Actual behavior
The Desktop local execution host exits during handshake.
The most reproducible low-level symptom is:
while:
Suspected area
This appears to be specific to the Windows ChatGPT Desktop packaged/MSIX child-process execution context or the Desktop -> code-mode/local-runtime initialization path.
The binaries themselves, PowerShell, Codex CLI, sandbox, project path, signatures, user config, runtime cache, and reinstall have all been independently verified.
I can provide full Desktop logs and additional Process Monitor traces if needed.
github-actions commentedon Aug 26, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
codex-code-mode-host.exe) exits during handshake, so everyexectool call fails. The error is intermittent but frequent.bug #40899Powered by Codex Action
spshepeng001-cmd commentedon Aug 28, 2026
Additional diagnostics: I was able to reduce the code-mode host exited during handshake failure to a deterministic CWD-dependent reproduction.
Environment
Codex Desktop: 26.825.4187.0 (Microsoft Store / MSIX)
Codex CLI: 0.150.0-alpha.12.2
Windows 11
Bundled Node: v24.19.0
codex-code-mode-host.exe:
C:\Users\SHE\AppData\Local\OpenAI\Codex\bin\fac60c5e9a2ae3df\codex-code-mode-host.exe
The important finding is that the same codex-code-mode-host.exe, running as the same user, succeeds or fails depending only on its current working directory.
Successful case
$hostExe = "C:\Users\SHE\AppData\Local\OpenAI\Codex\bin\fac60c5e9a2ae3df\codex-code-mode-host.exe"
Set-Location $env:USERPROFILE
& $hostExe --help
"ExitCode = $LASTEXITCODE"
Result:
ExitCode = 0
ProcMon shows the DLL search for dbghelp.dll:
C:\Users\SHE\AppData\Local\OpenAI\Codex\bin\fac60c5e9a2ae3df\dbghelp.dll
NAME NOT FOUND
C:\Users\SHE\dbghelp.dll
NAME NOT FOUND
C:\Windows\System32\dbghelp.dll
SUCCESS
CreateFileMapping
SUCCESS
Load Image
C:\Windows\System32\dbghelp.dll
SUCCESS
Failing case — only the CWD is changed
$pkg = Get-AppxPackage OpenAI.Codex
Set-Location "$($pkg.InstallLocation)\app"
& $hostExe --help
"ExitCode = $LASTEXITCODE"
Result:
ExitCode = -1073741790
which is:
0xC0000022
STATUS_ACCESS_DENIED
There is no --help output before the process exits.
ProcMon shows that in this case the loader finds the package-local DLL:
C:\Program Files\WindowsApps
OpenAI.Codex_26.825.4187.0_x64__2p2nqsd0c76g0
app\dbghelp.dll
The relevant sequence is:
Read Attributes
SUCCESS
QueryBasicInformationFile
SUCCESS
CreateFile
Desired Access: Read Data/List Directory,
Execute/Traverse,
Synchronize
ACCESS DENIED
codex-code-mode-host.exe
Process Exit
Status: 0xC0000022
The process exits approximately 10 ms after startup.
As a control, immediately after the denied access to the package-local dbghelp.dll, accesses to Windows system DLLs such as C:\Windows\System32\winmm.dll succeed, including image mapping/loading.
I also verified that the package-local dbghelp.dll actually exists:
FileVersion: 10.0.26100.7705
Description: Windows Image Helper
Its Authenticode signature verifies successfully:
Status: Valid
Signer: CN="OpenAI OpCo, LLC", O="OpenAI OpCo, LLC", ...
Reading the same file from normal PowerShell also succeeds:
$dbg = Join-Path (Get-AppxPackage OpenAI.Codex).InstallLocation "app\dbghelp.dll"
$fs = [System.IO.File]::OpenRead($dbg)
succeeds
$fs.Dispose()
There were no matching Codex, OpenAI, or dbghelp events in Microsoft-Windows-CodeIntegrity/Operational around the failure.
I also confirmed that pwsh.exe, bundled node.exe, node_repl.exe, and codex-code-mode-host.exe --help all work when launched normally outside the package app directory.
In the actual Desktop process tree, ChatGPT.exe is launched from:
C:\Program Files\WindowsApps
OpenAI.Codex_26.825.4187.0_x64__2p2nqsd0c76g0\app\ChatGPT.exe
and launches the external runtime:
C:\Users\SHE\AppData\Local\OpenAI\Codex\bin\fac60c5e9a2ae3df\codex.exe
-c features.code_mode_host=true app-server ...
The actual Desktop failure produces:
code-mode host exited during handshake
before the JS code-mode body or exec_command is executed.
Minimal reproduction
In other words, the failure can be reproduced without Desktop tool execution, without a workspace, and without invoking PowerShell/Node through Codex:
Same executable + same user
CWD = %USERPROFILE%
-> System32\dbghelp.dll
-> Load Image SUCCESS
-> ExitCode 0
CWD = <OpenAI.Codex InstallLocation>\app
-> package-local app\dbghelp.dll
-> executable/read-data access denied
-> ExitCode 0xC0000022
This suggests that the Desktop/code-mode-host launch CWD causes DLL resolution to select the package-local dbghelp.dll, and loading that DLL from the MSIX package location fails with STATUS_ACCESS_DENIED.
It may be worth ensuring that the external codex-code-mode-host.exe is launched with a non-package working directory, or otherwise preventing the package-local dbghelp.dll from being selected for this external runtime.
I have not modified the WindowsApps ACLs or any files in the package.
spshepeng001-cmd commentedon Aug 30, 2026
Update: the issue still reproduces on Codex Desktop 26.825.5331.0.
New environment:
C:\Users\SHE\AppData\Local\OpenAI\Codex\bin\6ca77c4a9caa4eed\codex-code-mode-host.exe
Desktop local execution still fails before commands start with:
code-mode host exited during handshake
The deterministic CWD reproduction is unchanged:
From %USERPROFILE%:
codex-code-mode-host.exe --help
-> ExitCode 0
From:
C:\Program Files\WindowsApps\OpenAI.Codex_26.825.5331.0_x64__2p2nqsd0c76g0\app
the exact same host binary:
codex-code-mode-host.exe --help
-> ExitCode -1073741790
-> 0xC0000022 (STATUS_ACCESS_DENIED)
So the newer 26.825.5331.0 build does not appear to fix the package-app-CWD-dependent failure.
spshepeng001-cmd commentedon Aug 30, 2026
26.818.3698.0 Desktop local execution works on the same machine, while 26.825.5331.0 fails during code-mode-host handshake. Interestingly, the 3698 host itself can still be forced to reproduce 0xC0000022 when manually launched with the installed WindowsApps ...\app as CWD. This suggests the regression may involve how newer Desktop builds launch the external code-mode host (especially its working directory/environment), rather than the host binary alone.
spshepeng001-cmd commentedon Aug 31, 2026
New A/B evidence narrows the regression further.
On the same machine, Desktop 26.818.3698.0 works normally. Process Explorer confirms that its working codex-code-mode-host.exe is launched from:
C:\Program Files\WindowsApps\OpenAI.Codex_26.818.3698.0_x64__2p2nqsd0c76g0\app\resources\codex-code-mode-host.exe
Its Current Directory is nevertheless:
C:\Program Files\WindowsApps\OpenAI.Codex_26.818.3698.0_x64__2p2nqsd0c76g0\app\
Therefore package ...\app as CWD alone is not sufficient to reproduce the failure.
In failing 26.825.x captures, Desktop instead launches the external host from:
C:\Users\SHE\AppData\Local\OpenAI\Codex\bin<hash>\codex-code-mode-host.exe
while the WindowsApps ...\app directory participates in DLL search. ProcMon shows app\dbghelp.dll being selected and executable access failing with STATUS_ACCESS_DENIED (0xC0000022), after which the host exits before handshake.
This suggests the regression may be specifically related to the newer Desktop build launching an external AppData code-mode host from a WindowsApps package launch context/CWD, rather than simply the CWD itself.
spshepeng001-cmd commentedon Aug 31, 2026
Tested the newly staged Desktop build 26.825.6671.0 on the same machine. It is not fixed. One whoami invocation succeeded, but subsequent tool calls repeatedly failed with code-mode host exited during handshake.
ProcMon on a failing invocation shows Desktop 26.825.6671.0 launching the external host:
C:\Users\SHE\AppData\Local\OpenAI\Codex\bin\b99306303521e97e\codex-code-mode-host.exe
with current directory:
C:\Program Files\WindowsApps\OpenAI.Codex_26.825.6671.0_x64__2p2nqsd0c76g0\app\
The host then attempts to open:
...\app\dbghelp.dll
with Read Data / Execute access and receives ACCESS DENIED, followed ~1 ms later by:
Process Exit: -1073741790 (0xC0000022 / STATUS_ACCESS_DENIED)
Host lifetime was only ~10 ms.
So 26.825.6671.0 still reproduces the same low-level failure observed on the earlier 26.825.x builds.
karumeno commentedon Sep 1, 2026
A workaround that fixed this on my Windows machine:
Check this registry value:
If it is
0, set it back to1, then fully quit and restart Codex Desktop.Administrator PowerShell:
After doing this,
code-mode host exited during handshakedisappeared for me and GPT-5.6 local tool execution worked again.This seems consistent with the
0xC0000022/ package-localdbghelp.dlldiagnosis in this issue and the workaround reported in #40798. It is not an official fix, but it restores the Windows default Safe DLL Search Mode.spshepeng001-cmd commentedon Sep 1, 2026
Final validation:
SafeDllSearchMode=1resolves the failure on this machineI can now confirm the
SafeDllSearchModeworkaround with a controlled A/B test and with real Codex Desktop usage.Before
On this machine:
With that setting, the previously documented deterministic reproduction was:
This matched the actual 26.825.x Desktop failure seen in ProcMon and resulted in:
Controlled A/B
I changed only:
Then I repeated the same manual reproduction using an external AppData host:
Result after
SafeDllSearchMode=1:Previously, this same external-host + WindowsApps-app-CWD condition reproduced
0xC0000022on this machine.Real 26.825.6671.0 validation
After reboot, Windows registered the already-staged package normally:
The setting persisted:
Codex Desktop 26.825.6671.0 can now execute local commands normally. For example:
More importantly, my real
D:\Program\AMMSproject is now able to proceed normally in Codex, whereas 26.825.6671.0 previously reproduced the handshake/0xC0000022 failure on this same machine.Conclusion
For this machine,
SafeDllSearchMode=0was the key system condition that exposed the 26.825.x external-host/package-context DLL-loading failure. Restoring Windows Safe DLL Search Mode to1changed the deterministic host reproduction from0xC0000022to exit code0, and 26.825.6671.0 real local execution is now working.This is strong confirmation of the workaround reported above. I have not modified WindowsApps ACLs or replaced/deleted any package DLLs.