code-mode host exited during handshake; the 5.6 model is not working properly
Open 💬 33 comments Opened Aug 27, 2026 by yanweichao123
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
版本 26.820.71523
What subscription do you have?
pro 20x
What platform is your computer?
win10 H22
What issue are you seeing?
刚才无法自动读取目录,是因为本地命令执行通道在初始化握手阶段异常退出(code-mode host exited during handshake),不是项目文件损坏,也不是中文路径导致的。 5.6模型无法正常使用现在只能用5.5
What steps can reproduce the bug?
Feedback ID: 01a0418f-d5fa-7d72-bb4a-c67e8bb31044
What is the expected behavior?
_No response_
Additional information
_No response_
33 Comments
English translation:
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.820.71523
What subscription do you have?
pro 20x
What platform is your computer?
win10 H22
What issue are you seeing?
The directory could not be read automatically just now because the local command execution channel exited unexpectedly during the initialization handshake (
code-mode host exited during handshake). It was not caused by corrupted project files or a Chinese path. The 5.6 model is not working properly, so I can only use 5.5 now.What steps can reproduce the bug?
Feedback ID: 01a0418f-d5fa-7d72-bb4a-c67e8bb31044
What is the expected behavior?
_No response_
Additional information
_No response_
<!-- codex-issue-translator -->
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
我也遇到了,重装chatgpt,重启电脑都不行,这个能降版本吗?
我也遇到了,有解决么
遇到+1
I’m experiencing the same issue. Has anyone found a solution or workaround for this?
遇到了+1,无法读写文件,并且显示原始信息为:
code-mode host exited during handshake
Has the same problem not been solved yet?
Has the same problem not been solved yet?
+1
你是怎么解决的呢
我也遇到了,目前有什么办法解决吗
我也不知道怎么解决你有办法吗
<img width="1655" height="956" alt="Image" src="https://github.com/user-attachments/assets/753036d9-9d4e-43c8-9970-254ee762c381" /> 要不要回滚版本到26.818.8289.0?
没有安装包怎么回滚呢
确实。 我很奇怪,我昨天从plus升级到pro,然后就不能用了;之前用的plus,没记得有这个问题。我今天捣鼓了一下午,发现5.6的三个模型都不行,但是5.5 5.4 模型都能用, code_mode_host这个能关闭吗?
感觉就是pro的问题 好烦躁
是不是也是刚升级到pro后,才出现的这个问题?
不是
https://github.com/Wangnov/codex-app-mirror/releases#release-codex-app-26.818.61809
You can download the package here and test if it works.
先给你说个结论。我跟我老婆同一个pro账号,我验证了下她的电脑用5.6sol就可以读取,操作,不需要握手;我的就不可以。https://github.com/openai/codex/issues/32759 这个帖子你可以参考系下。后来我就让5.6sol给我找问题,然后再powershell中进行输入代码,最终就跳过握手,解决了这个问题
<img width="1674" height="870" alt="Image" src="https://github.com/user-attachments/assets/eb4705f7-93c1-43ae-9b1f-7cee76dedb4f" />
<img width="1660" height="663" alt="Image" src="https://github.com/user-attachments/assets/dd3766a9-6df3-4ee4-93ae-a65910dd9b10" />
<img width="1587" height="1245" alt="Image" src="https://github.com/user-attachments/assets/40c17925-70b2-442e-8474-47617cf99c16" />
具体是怎么操作的
Awesome, this works for me, thank you so much
I’m experiencing the same issue on Windows after the recent Codex update, and I want to add another reproducible case.
Symptoms:
This looks related to the 5.6 local-execution/handshake regression reported in this issue, and possibly also to the Windows 26.820 local execution/startup regression tracked in #41088.
Please prioritize investigation of the Windows + GPT-5.6 path. GPT-5.5 is currently the only usable workaround for me, but the application startup/chat-loading slowdown is also present.
Expected behavior:
If useful, please indicate which logs/diagnostics would best help distinguish the GPT-5.6 tool-call failure from the broader Windows 26.820 startup/chat-loading regression.
I am experiencing the same issue on Codex Desktop for Windows.
Environment
26.820.7152310.0.26200, build26200Error
The local command execution environment fails during the startup handshake. Codex retries three times and then stops.
The error shown in the UI is approximately:
The underlying error is:
Reproduction steps
List the files in the current directory.Troubleshooting already attempted
Expected behavior
Codex should start the local command execution host, complete the handshake, and execute the requested command.
Actual behavior
The code-mode host exits during the handshake. Codex retries three times and then reports that the command execution environment could not start.
Additional observation
GPT-5.5 works correctly in the same projects and on the same computer.
The issue started suddenly on August 27, 2026, and it reproduces in every project I tested. Codex Desktop itself opens normally.
I can provide sanitized logs or a Feedback ID if needed.
I encountered the exact same error on Windows:
code-mode host exited during handshakeThe impact was broader than directory access or a single tool call. While the issue was present:
Get-DateandGet-Locationfailed before execution.skill-installercould not even read its own installation instructions or start the GitHub download script.SKILL.mdfailed with the same handshake error.Examples of GitHub skill repositories that could not be installed or accessed through Codex at that time included:
The GitHub requests did not appear to start. The failure occurred earlier, while the local code-mode host was starting.
I found this Windows registry value explicitly set to
0:I can consistently reproduce the same issue in Codex Desktop.
A/B test in the same client, on the same machine and workspace, using a very simple file task ("create a .txt file"):
For GPT-5.6 Sol, the UI reports:
code-mode host exited during handshakeI also cannot reliably read/write workspace files with the 5.6 variants, including TXT, Word, and PDF-related tasks.
I already updated Codex, restarted the app multiple times, terminated background processes, and retried. The behavior remains unchanged. Since GPT-5.5 succeeds immediately under the same conditions, this looks specific to the GPT-5.6 tool/workspace runtime rather than a local file-permission or document-format issue.
Hope this A/B result helps narrow down the regression.
下面是一份可直接粘贴到 [GitHub issue #32759](https://github.com/openai/codex/issues/32759) 的英文说明。它总结了我们实际遇到的全部错误、最终生效的代码和回滚方式。
---
WindowsApps variant: copy the bundled CLI and helper executables before using the CWD shim
I confirmed the CWD-related workaround, but on my Microsoft Store/MSIX installation the original approach needed one additional step.
Tested environment
26.820.9563.0codex-cli 0.150.0-alpha.8C:\Program Files\WindowsAppscode-mode host exited during handshakeAdditional problem
Launching the bundled CLI directly from an unpackaged PowerShell process failed:
A shim pointing directly to:
also caused Codex Desktop to fail during startup:
The working solution was:
codex.exeoutsideWindowsApps.%USERPROFILE%;CODEX_CLI_PATHto the copied CLI;CODEX_CLI_PATHto the shim.Installation script
Completely quit Codex Desktop first, then run this in a fresh Windows PowerShell session:
Expected test output:
Why the helper executables are necessary
Copying only
codex.execaused these additional failures:Then:
Finally:
The final error disappeared after copying:
The working directory therefore contains:
After restarting Codex Desktop, code-mode tool execution and DOCX reading both succeeded.
Rollback
Run this outside Codex Desktop:
Then completely quit and restart Codex Desktop.
The copied files can remain in
%USERPROFILE%\.codex\bin; withoutCODEX_CLI_PATH, Codex will not use the shim.Caveat
This is an unofficial, version-specific workaround. After a Codex Desktop update, rerun the script so the copied CLI and helper executables match the newly installed package version. Do not change ACLs or take ownership of
C:\Program Files\WindowsApps.---
这份说明的重点是:原帖的 CWD shim 思路是正确的,但 Microsoft Store/MSIX 版本还受到 WindowsApps 执行权限限制,所以必须复制 CLI 以及三个辅助程序到用户目录。
这是我让codex帮我总结的,看能否帮到大家
I can add a detailed diagnostic data point for the same failure pattern.
Possibly related: #41241
Environment
26.820.715230.150.0-alpha.8elevatedMinimal reproduction
On the same machine and the same Codex installation:
Get-Date.PowerShell,
cmd.exe, and Git were also independently tested outside Codex and work normally.GPT-5.5 vs GPT-5.6 execution path
The local session records show different execution paths.
GPT-5.5:
The successful execution reports:
GPT-5.6 Terra:
followed by:
Codex internal error
The structured Codex log reports:
codex-code-mode-host.exeexists in the current Codex installation, so this is not the same observed failure as a missing host executable.Model tool-mode observation
The local
models_cache.jsonshows:GPT-5.5 does not have this field.
I am not suggesting that
code_mode_onlyitself is incorrect. The relevant observation is that GPT-5.6 reaches the code-mode host path, while GPT-5.5 successfully uses the normal unified-exec path on the same machine.Main app/runtime health
Codex Desktop / app-server initialization succeeds:
Primary runtime diagnostics also report:
Windows Event Log investigation
I performed a read-only Windows Event Log investigation covering approximately:
which includes repeated GPT-5.6 failures.
No
codex-code-mode-host.execrash or security-block event was found.Specifically:
No matching blocking event was found in:
Security event 4688 also did not provide a matching
codex-code-mode-host.exeprocess-creation record. Sysmon is not installed/enabled on this machine.So far, there is no Windows Event Log evidence that Defender, AppLocker, or Code Integrity blocked
codex-code-mode-host.exe.Current assessment
This appears specific to the GPT-5.6 code-mode execution path rather than PowerShell,
cmd.exe, Git, or the GPT-5.5 unified-exec path.On the same machine and installation, GPT-5.5 executes local commands successfully while GPT-5.6 consistently fails while initializing the code-mode host.
I do not yet have evidence proving whether the host exits because of a Codex regression, a runtime initialization issue, or a machine-specific Windows interaction.
Workaround
Switching from GPT-5.6 Terra to GPT-5.5 restores local command execution.
Related reports
os error 2 / file not foundfailure. On this machine,codex-code-mode-host.exeexists and the observed failure occurs during handshake.I meet the same problem and this works for me
Confirmed fixed on my machine.
SafeDllSearchMode was explicitly set to 0. After changing it to 1 and fully restarting Windows, GPT-5.6 local tool execution works normally again.
The same commands that previously failed with:
code-mode host exited during handshake
now execute successfully.
Additional reproduction notes from the same user/session:
gpt-5.6-sol, local document/tool execution repeatedly failed before any DOCX parsing with:gpt-5.6-terra, but the already-wedged local code-mode/tool host still failed with the same handshake error. This suggests there may be task-level/runtime state involved, not only a single model response.gpt-5.5, local tools initialized successfully again. I was able to read a local skill file and use GitHub tooling from the same Windows environment.soffice/LibreOffice, but that is a different issue from this handshake failure.Expected behavior: switching models should not leave the local tool host in a broken handshake state, and
gpt-5.6-sol/gpt-5.6-terrashould be able to initialize the same local document/tool execution path that works undergpt-5.5.