You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The Codex desktop app's execution service (codex-code-mode-host.exe) exits during handshake, so every exec tool call fails. The error is intermittent but frequent.bug #40899
Bug Report: "code-mode host exited during handshake"
Summary
The Codex desktop app's execution service (codex-code-mode-host.exe) exits during handshake, so every exec tool call fails. The error is intermittent but frequent.
Error message
error=code-mode host exited during handshake
target=codex_core::tools::router
OS: Windows 10 (10.0.19045, build 19045.6466), Chinese locale, ANSI code page 936 (GBK)
Model: gpt-5.6-terra / gpt-5.6-sol
When it started
Immediately after the auto-update on 2026-08-26 (~17:47 local time), which bumped the bundled CLI from 0.149.0-alpha.4.x to 0.150.0-alpha.8. No such errors before the update.
Repro steps
Open the Codex desktop app.
Start any task that triggers the exec tool (e.g. "run echo hello").
The exec tool call fails with code-mode host exited during handshake; the model retries and fails repeatedly.
Key observations
The error is intermittent: some exec calls succeed, then a cluster of failures follows.
It reproduces in both ASCII and non-ASCII working directories (so it is not path/encoding specific).
No crash dump or WER report is generated for codex-code-mode-host.exe — the host exits cleanly, so this is a handshake/protocol failure, not a crash.
Running codex-code-mode-host.exe manually works; it starts and waits for the client hello.
Disabling the feature code_mode_host makes exec fail closed (the model cannot run commands at all), so that is not a viable workaround.
codex doctor reports: search command not verified, and a generic Microsoft Defender advisory (exclusions were added but did not resolve the issue).
Impact
All exec-based work (running commands, Python, spreadsheet/document artifact creation, etc.) is blocked intermittently in the desktop app. The older VS Code extension CLI (0.147.0-alpha.6.5) does NOT have this problem.
changed the title [-]The Codex desktop app's execution service (`codex-code-mode-host.exe`) exits during handshake, so every `exec` tool call fails. The error is intermittent but frequent[/-][+]The Codex desktop app's execution service (`codex-code-mode-host.exe`) exits during handshake, so every `exec` tool call fails. The error is intermittent but frequent.bug[/+]on Aug 26, 2026
while the exact same node.exe launched manually from PowerShell succeeds (v24.19.0, exit 0). A full clean-room reset of all Codex/Desktop state, reinstall, disabling code_mode_host, Defender exclusions, and stopping Nahimic did not change the result. The main Desktop -> codex app-server stdio handshake succeeds; only the local code-mode execution child-chain fails. This points to the Desktop/MSIX packaged child-process context rather than the binaries or user state.
After doing this, code-mode host exited during handshake disappeared for me and GPT-5.6 local tool execution worked again.
This matches the likely 0xC0000022 / dbghelp.dll path discussed in #40798. It is not an official fix, but it restored the Windows default Safe DLL Search Mode rather than weakening security.
Observed behavior
Desktop Work/Codex local workspace tools consistently fail before execution with:
code-mode host exited during handshake
I reproduced this across multiple fresh tasks and with GPT-5.6 Sol, GPT-5.5, and Astra.
Important isolation result
The bundled codex.exe CLI works successfully on the same machine.
Using codex.exe exec --ephemeral --skip-git-repo-check, Codex successfully invoked PowerShell and executed a read-only directory listing of:
C:\Users\alifa\Documents\Codex\2026-09-18
So local filesystem access, PowerShell execution, authentication, networking, and the Codex CLI itself are working.
Codex Doctor
Healthy:
config
auth
network/WebSocket
sandbox provisioning
state databases
desktop installation
Warnings:
Microsoft Defender advisory
rg.exe search binary not verified
optional MCP warning: CODEX_WINDOWS_REGISTERED_CORE is not set
I have not manually modified that environment variable.
I also verified that the configured paths for node_repl.exe, codex.exe, codex-code-mode-host.exe, and codex-command-runner.exe match the currently installed binaries.
This appears to be specific to the Windows Desktop code-mode host / local-tool integration layer rather than the CLI or filesystem.
Activity
[-]The Codex desktop app's execution service (`codex-code-mode-host.exe`) exits during handshake, so every `exec` tool call fails. The error is intermittent but frequent[/-][+]The Codex desktop app's execution service (`codex-code-mode-host.exe`) exits during handshake, so every `exec` tool call fails. The error is intermittent but frequent.bug[/+]CloudyRiver9 commentedon Aug 26, 2026
Related Windows Desktop report with additional diagnostics: #40913
Key extra finding there: from the ChatGPT Desktop process context, spawning the bundled runtime fails at the lowest level:
while the exact same
node.exelaunched manually from PowerShell succeeds (v24.19.0, exit 0). A full clean-room reset of all Codex/Desktop state, reinstall, disablingcode_mode_host, Defender exclusions, and stopping Nahimic did not change the result. The main Desktop -> codex app-server stdio handshake succeeds; only the local code-mode execution child-chain fails. This points to the Desktop/MSIX packaged child-process context rather than the binaries or user state.wangzongshuji commentedon Aug 27, 2026
How to solve? I have tried various methods, but none of them have solved the problem
CloudyRiver9 commentedon Aug 27, 2026
用旧版本吧,我在找了
CloudyRiver9 commentedon Aug 27, 2026
换了beta版本。能用了
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 matches the likely
0xC0000022/dbghelp.dllpath discussed in #40798. It is not an official fix, but it restored the Windows default Safe DLL Search Mode rather than weakening security.alifarhan1223-rgb commentedon Sep 18, 2026
I am experiencing the same issue on Windows.
Feedback ID:
01a0b47a-7b4c-7ca2-ab88-24407dddc84cEnvironment
Observed behavior
Desktop Work/Codex local workspace tools consistently fail before execution with:
code-mode host exited during handshakeI reproduced this across multiple fresh tasks and with GPT-5.6 Sol, GPT-5.5, and Astra.
Important isolation result
The bundled
codex.exeCLI works successfully on the same machine.Using
codex.exe exec --ephemeral --skip-git-repo-check, Codex successfully invoked PowerShell and executed a read-only directory listing of:C:\Users\alifa\Documents\Codex\2026-09-18So local filesystem access, PowerShell execution, authentication, networking, and the Codex CLI itself are working.
Codex Doctor
Healthy:
Warnings:
rg.exesearch binary not verifiedCODEX_WINDOWS_REGISTERED_CORE is not setI have not manually modified that environment variable.
I also verified that the configured paths for
node_repl.exe,codex.exe,codex-code-mode-host.exe, andcodex-command-runner.exematch the currently installed binaries.This appears to be specific to the Windows Desktop code-mode host / local-tool integration layer rather than the CLI or filesystem.