GPT-5.6 Sol fails to execute shell commands: code-mode host exited during handshake
What version of Codex CLI is running?
codex-cli 0.144.2
What subscription do you have?
ChatGPT Pro ($100/month)
Which model were you using?
_No response_
What platform is your computer?
macOS 26.5.2 (Apple Silicon / arm64)
What terminal emulator and version are you using (if applicable)?
Ghostty 1.3.1
Codex doctor report
{
"schemaVersion": 1,
"generatedAt": "1783937968s since unix epoch",
"overallStatus": "ok",
"codexVersion": "0.144.2",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is not running",
"details": {
"control socket": "/Users/username/.codex/app-server-control/app-server-control.sock",
"daemon state dir": "/Users/username/.codex/app-server-daemon",
"mode": "ephemeral",
"pid file": "/Users/username/.codex/app-server-daemon/app-server.pid (missing)",
"settings": "/Users/username/.codex/app-server-daemon/settings.json (missing)",
"status": "not running",
"update-loop pid file": "/Users/username/.codex/app-server-daemon/app-server-updater.pid (missing)"
},
"remediation": null,
"durationMs": 0
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "/Users/username/.codex/auth.json",
"auth storage mode": "File",
"stored API key": "false",
"stored ChatGPT tokens": "true",
"stored agent identity": "false",
"stored auth mode": "chatgpt"
},
"remediation": null,
"durationMs": 0
},
"config.load": {
"id": "config.load",
"category": "config",
"status": "ok",
"summary": "config loaded",
"details": {
"CODEX_HOME": "/Users/username/.codex",
"config.toml": "/Users/username/.codex/config.toml",
"config.toml parse": "ok",
"cwd": "/Users/username/Tutorials/tmp/codex-test",
"enabled feature flags": "shell_tool, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
"feature flag overrides": "none",
"feature flags enabled": "35",
"log dir": "/Users/username/.codex/log",
"mcp servers": "1",
"model": "gpt-5.6-sol",
"model provider": "openai",
"sqlite home": "/Users/username/.codex"
},
"remediation": null,
"durationMs": 0
},
"git.environment": {
"id": "git.environment",
"category": "git",
"status": "ok",
"summary": "git version 2.55.0",
"details": {
"PATH git #1": "/opt/homebrew/bin/git",
"PATH git #2": "/usr/bin/git",
"PATH git entries": "2",
"git build options": "git version 2.55.0; cpu: arm64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; rust: disabled; feature: fsmonitor--daemon; gettext: enabled; libcurl: 8.7.1; zlib: 1.2.12; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
"git exec path": "/opt/homebrew/opt/git/libexec/git-core",
"git version": "git version 2.55.0",
"repo detected": "false",
"selected git": "/opt/homebrew/bin/git"
},
"remediation": null,
"durationMs": 140
},
"installation": {
"id": "installation",
"category": "install",
"status": "ok",
"summary": "installation looks consistent",
"details": {
"PATH codex #1": "/opt/homebrew/bin/codex",
"current executable": "/opt/homebrew/bin/codex",
"install context": "brew",
"managed by bun": "false",
"managed by npm": "false",
"managed by pnpm": "false",
"managed package root": "not set"
},
"remediation": null,
"durationMs": 3
},
"mcp.config": {
"id": "mcp.config",
"category": "mcp",
"status": "ok",
"summary": "MCP configuration is locally consistent",
"details": {
"configured servers": "1",
"disabled servers": "0",
"streamable_http servers": "1"
},
"remediation": null,
"durationMs": 215
},
"network.env": {
"id": "network.env",
"category": "network",
"status": "ok",
"summary": "network-related environment looks readable",
"details": {
"proxy env vars": "none"
},
"remediation": null,
"durationMs": 0
},
"network.provider_reachability": {
"id": "network.provider_reachability",
"category": "reachability",
"status": "ok",
"summary": "active provider endpoints are reachable over HTTP",
"details": {
"ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
"reachability mode": "ChatGPT auth"
},
"remediation": null,
"durationMs": 218
},
"network.websocket_reachability": {
"id": "network.websocket_reachability",
"category": "websocket",
"status": "ok",
"summary": "Responses WebSocket handshake succeeded",
"details": {
"DNS": "2 IPv4, 0 IPv6, first IPv4",
"auth mode": "chatgpt",
"connect timeout": "15000 ms",
"endpoint": "wss://chatgpt.com/backend-api/<redacted>",
"handshake result": "HTTP 101 Switching Protocols",
"model provider": "openai",
"models etag present": "true",
"provider name": "OpenAI",
"proxy env vars": "none",
"reasoning header": "false",
"server model present": "false",
"supports websockets": "true",
"wire API": "responses"
},
"remediation": null,
"durationMs": 617
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running brew on macos-aarch64",
"details": {
"commit": "unknown",
"current executable": "/opt/homebrew/bin/codex",
"install method": "brew",
"platform": "macos-aarch64",
"version": "0.144.2"
},
"remediation": null,
"durationMs": 0
},
"runtime.search": {
"id": "runtime.search",
"category": "search",
"status": "ok",
"summary": "search is OK (system)",
"details": {
"search command": "rg",
"search command readiness": "ripgrep 15.1.0",
"search provider": "system"
},
"remediation": null,
"durationMs": 3
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "OnRequest",
"codex-linux-sandbox helper": "none",
"execve wrapper helper": "/Users/username/.codex/tmp/arg0/codex-arg0bvZ16h/codex-execve-wrapper",
"filesystem sandbox": "restricted",
"network sandbox": "restricted"
},
"remediation": null,
"durationMs": 0
},
"state.paths": {
"id": "state.paths",
"category": "state",
"status": "ok",
"summary": "state paths and databases are inspectable",
"details": {
"CODEX_HOME": "/Users/username/.codex (dir)",
"active rollout files": "428 files, 277306644 total bytes, 647912 average bytes",
"archived rollout files": "0 files, 0 total bytes, 0 average bytes",
"goals DB": "/Users/username/.codex/goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "/Users/username/.codex/logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "/Users/username/.codex/log (dir)",
"memories DB": "/Users/username/.codex/memories_1.sqlite (file)",
"memories DB integrity": "ok",
"sqlite home": "/Users/username/.codex (dir)",
"state DB": "/Users/username/.codex/state_5.sqlite (file)",
"state DB integrity": "ok"
},
"remediation": null,
"durationMs": 363
},
"state.rollout_db_parity": {
"id": "state.rollout_db_parity",
"category": "threads",
"status": "ok",
"summary": "rollout files and state DB thread inventory agree",
"details": {
"default model provider": "openai",
"rollout DB active files": "428",
"rollout DB active rows": "428",
"rollout DB archive mismatches": "0",
"rollout DB archived files": "0",
"rollout DB archived rows": "0",
"rollout DB duplicate DB paths": "0",
"rollout DB duplicate rollout thread ids": "0",
"rollout DB malformed file names": "0",
"rollout DB missing active rows": "0",
"rollout DB missing archived rows": "0",
"rollout DB model providers": "openai=428",
"rollout DB rows": "428",
"rollout DB scan cap reached": "false",
"rollout DB scan errors": "0",
"rollout DB sources": "vscode=418, cli=10",
"rollout DB stale rows": "0"
},
"remediation": null,
"durationMs": 977
},
"system.environment": {
"id": "system.environment",
"category": "system",
"status": "ok",
"summary": "OS language en-SI",
"details": {
"EDITOR": "not set",
"LANG": "en_US.UTF-8",
"LESS": "set",
"PAGER": "set",
"VISUAL": "not set",
"os": "Mac OS 26.5.2 [64-bit]",
"os language": "en-SI",
"os type": "Mac OS",
"os version": "26.5.2"
},
"remediation": null,
"durationMs": 2
},
"terminal.env": {
"id": "terminal.env",
"category": "terminal",
"status": "ok",
"summary": "terminal metadata was detected",
"details": {
"COLORTERM": "truecolor",
"TERMINFO": "/Applications/Ghostty.app/Contents/Resources/terminfo (dir)",
"TERM_PROGRAM": "ghostty",
"color output": "enabled",
"effective locale": "en_US.UTF-8",
"stderr is terminal": "true",
"stdin is terminal": "true",
"stdout is terminal": "true",
"terminal": "Ghostty",
"terminal size": "316x80",
"terminal version": "1.3.1"
},
"remediation": null,
"durationMs": 0
},
"terminal.title": {
"id": "terminal.title",
"category": "title",
"status": "ok",
"summary": "terminal title default",
"details": {
"terminal title activity": "true",
"terminal title items": "activity, project-name",
"terminal title project source": "cwd",
"terminal title project value": "codex-test",
"terminal title source": "default"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.144.1",
"check for update on startup": "true",
"last checked at": "2026-07-13T06:07:04.217709Z",
"latest version": "0.144.3",
"latest version status": "newer version is available",
"update action": "brew upgrade --cask codex",
"version cache": "/Users/username/.codex/version.json"
},
"remediation": null,
"durationMs": 53
}
}
}
What issue are you seeing?
GPT-5.6 models can answer normal text prompts, but every shell/tool execution fails before the first command runs. The shell retries multiple times and eventually fails with:
code-mode host exited during handshake
GPT-5.5 works correctly in the same environment and can execute shell commands without any issues.
I reproduced this in an empty directory, multiple repositories, after reinstalling Codex 0.144.2, and with codex doctor reporting no problems.
What steps can reproduce the bug?
Uploaded thread: 019f5afa-2ce8-76a3-85d7-7d8a32c761c7
What is the expected behavior?
GPT-5.6 should initialize the shell successfully and execute the requested command, just like GPT-5.5 does. For example, Run pwd and list the files in this directory. should return the current working directory and file listing instead of failing during shell initialization.
Additional information
- Codex CLI: 0.144.2 (installed via Homebrew)
- macOS 26.5.2 (Apple Silicon / arm64)
- ChatGPT Pro subscription (ChatGPT authentication, not API key)
codex doctorreports no issues- Reinstalling Codex did not resolve the issue
- Reproduced in an empty directory and in multiple repositories
- GPT-5.6 can answer normal text prompts; the failure only occurs when it attempts to execute shell/tool commands
- GPT-5.5 works correctly in the same environment and can execute shell commands successfully
- I also reproduced the same behavior in T3 Code and OpenCode when using GPT-5.6
Update
I upgraded to Codex CLI 0.144.3 and tested again.
The issue is still reproducible:
- GPT-5.6 Sol can answer normal text prompts.
- Any request requiring shell/tool execution fails before the first command runs with:
````
code-mode host exited during handshake
- GPT-5.5 continues to work correctly in the same environment and can execute shell commands successfully.
I also confirmed the issue is not repository-specific by reproducing it in a brand-new empty directory.
18 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Don't change the fxxx input, give back the transformer "pasted-text.txt -> input text", stupid codex
I can reproduce the same model-specific A/B behavior on Windows x64.
Environment:
The desktop initially had the separate 26.820 bundled-resource
relocation regression. I recovered it by materializing the per-user
runtime caches from the currently installed official Store package.
The desktop and app server now start normally.
Model A/B test using the same machine, app installation, working
directory, account, and PowerShell command:
GPT-5.6 Sol Ultra:
code-mode host exited during handshake
GPT-5.5:
The same PowerShell command executes successfully and returns the
expected output.
Local code-mode host validation:
%LOCALAPPDATA%\OpenAI\Codex\bin\d0097be4feba73d0\codex.exe
3B93FC5DF0B38358D7FFFB290A3F11A56CECBEBBF70EB62BF8C58D6D994B28E3
This appears to be a GPT-5.6 Code Mode handshake regression or
compatibility issue rather than a missing, corrupted, encrypted, or
blocked local host binary. GPT-5.5 tool execution remains functional.
I have also encountered a similar issue while using Codex version 26.819.11345. When using GPT-5.6, it is only capable of chatting and cannot function properly, displaying the error 'code-mode host exited during handshake.' However, when switching to GPT-5.5, it works normally. I believe this is a problem with the model. I kindly request the developers to address this issue.
Same here. A few hours ago, I was still able to use 5.6 sol to run tasks normally. However, after I refined some of my plans and tried running the task again, it suddenly stopped working. I suspect there may have been an automatic version update in the meantime. Like you, switching to the 5.5 model made it work again.
Yes, I also believe it may be related to the update. Everything was working fine for me until a few minutes ago when I manually updated Codex. After that, I used it as usual, but it reported the error "codex code-mode host exited during handshake". This is truly frustrating. I initially suspected that the issue might be with my computer or my .git, but after reading previous responses, I feel it may indeed be related to the update. Moreover, switching to GPT-5.5 allows it to work normally, which rules out any issues with my local folder.[eos]
Confirmed: rolling back the complete Windows Desktop package fixes the
GPT-5.6 Code Mode handshake failure on the same machine.
Controlled version A/B:
Broken
I can confirm a very similar failure on Windows Codex Desktop after clean restarts. This appears to affect the Desktop GPT-5.6 local tool / code-mode path specifically.
Environment
OpenAI.Codex 26.820.7780.0codex-cli 0.150.0-alpha.8codex.exe:%LOCALAPPDATA%\OpenAI\Codex\bin\d0097be4feba73d0\codex.execodex-code-mode-host.exe:%LOCALAPPDATA%\OpenAI\Codex\bin\d0097be4feba73d0\codex-code-mode-host.exeDesktop Reproduction
In brand-new no-project Codex Desktop tasks:
Example failing prompt:
Desktop result:
Controls Already Checked
CODEX_CODE_MODE_HOST_PATHare all empty after clean restart.codex-code-mode-host.exeexists besidecodex.exe.codex-code-mode-host.exe --helpsucceeds with exit code 0.OpenAI OpCo, LLC.codex.exe, same auth, same machine, and same GPT-5.6 Sol model also succeeds.Log Evidence Summary
Recent local logs show the failure under:
Both GPT-5.6 Sol and GPT-5.6 Luna produced three consecutive handshake failures before the first PowerShell command executed. I can provide the exact log rows / call IDs privately if maintainers need them.
Assessment
This does not look like a corrupted local host binary, workspace issue, authentication issue, Defender block, or general GPT-5.6 availability problem. The failure appears specific to the Codex Desktop GPT-5.6 code-mode/custom-tool routing path in the
26.820.7780.0Desktop/runtime combination.Could the team please confirm whether this is a known regression and whether there is a safe feature-flag workaround or patched Desktop build?
So you also encountered the same problem, right?
Do you think it was caused by updating to the new version?
However, it is very strange that when I asked people around me to help test, they also updated to the latest version, but did not encounter this problem and were able to use GPT-5.6 normally.
Given the rollback report above, this does seem likely to be related to the newer Desktop version, although it may not affect every user on the latest build.
One more piece of context that may or may not be relevant: after updating to the affected Desktop version, my main workflow involved one parent conversation driving multiple subtask conversations. I am not sure whether that contributed to triggering or exposing the issue, but it is a difference from some nearby users who updated to the latest version and did not reproduce the failure.
That said, after the failure started, I was able to reproduce it in brand-new no-project Desktop tasks after clean restarts, so it does not appear to be limited to one corrupted old conversation.
I have also encountered a similar issue while using Codex version 26.819.11345. 5.5 works ,but 5.6 not
It’s honestly mind-boggling how a multi-billion dollar AI company manages to completely break a foundational, business-critical feature like Code Mode in GPT-5.6 Sol. The fact that a fresh local execution environment crashes on a basic handshake, and we're forced to downgrade to GPT-5.5 just to run Get-Date, is an absolute joke. Stop shipping half-baked Alpha versions as production-ready models and fix your sandbox infrastructure already. We are paying to build tools, not to debug your basic communication pipe errors.
I found a minimal workaround on Windows (by Codex CLI).
Environment:
26.820.7780.0codex-cli 0.150.0-alpha.8The same bundled
codex.exebehaves differently depending on its process CWD:...\appdirectory → GPT-5.6 tool calls fail withcode-mode host exited during handshake%USERPROFILE%or the project directory → the tool call succeedsThe workaround is to point
CODEX_CLI_PATHto a small native forwarding shim. The shim:SetCurrentDirectory(%USERPROFILE%);CODEX_CLI_PATHback to the real officialcodex.exeto avoid recursion;Conceptually:
```text
Desktop
-> codex-cwd-shim.exe
chdir(%USERPROFILE%)
CODEX_CLI_PATH=<real codex.exe>
CreateProcess(<real codex.exe>, original args,
inheritHandles=true,
stdin/stdout/stderr=GetStdHandle(...))
Then set:
[Environment]::SetEnvironmentVariable(
"CODEX_CLI_PATH",
"$env:USERPROFILE\.codex\bin\codex-cwd-shim.exe",
"User"
)
and restart Codex Desktop.
https://github.com/openai/codex/issues/41049#issuecomment-5438015120 this worked for me
I can reproduce the same issue on Windows.
Environment:
Behavior:
code-mode host exited during handshakeIsolation performed:
codex-doctor.json
.codexdata.Therefore, this does not appear to be caused by the Windows user profile, proxy configuration, skills, plugins, EasyEDA agent, or a corrupted Codex installation. It appears to be specific to GPT-5.6 Sol tool execution / code-mode host initialization.
I’m seeing the same issue on Windows with GPT-5.6 Sol.
Environment:
[windows] sandbox = "unelevated"Symptom:
code-mode host exited during handshakeTroubleshooting already attempted:
.agentsdoes not exist in the minimal test project, so the known.agentsownership workaround does not apply.sandbox = "unelevated"was already set; this does not resolve the issue.code_mode_onlymarker from the local model cache and making the cache read-only. This did not provide a valid fix and was reverted.Conclusion:
This looks model-specific: GPT-5.6 Sol fails during Windows code-mode/sandbox handshake, while GPT-5.5 works in the same environment. Please investigate the GPT-5.6 Sol Windows code-mode integration path and provide either a fixed Codex build/model config or an official workaround.
https://github.com/openai/codex/issues/41049#issuecomment-5447211401
This method works for me
Thank you,This method works for me too。
折断翅膀在飞
@.***