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
Codex CLI doesn't work at all. Rather, it complains:
I’m blocked by the local Codex command runner: ~/.local/bin/codex-code-mode-host is missing. No commands ran and no files, commits, branches, or PRs were changed.
Please restore/reinstall that binary or restart Codex.
I solved it with clade code lol, here is what worked for me:
Root cause looks like helper resolution off the un-canonicalizedcurrent_exe() — same class as #30732 / #30856, which hit the sandbox helpers on Windows.
The standalone installer creates ~/.local/bin/codex -> ~/.codex/packages/standalone/current/bin/codex (per #17022). codex-code-mode-host ships next to the real binary and is intentionally not placed on PATH. But the spawner resolves the helper as a sibling of current_exe(), and on macOS that returns the symlink path rather than its target — so it looks in ~/.local/bin/ and finds nothing. Neither fallback saves it: the packaged codex-resources/ contains only the bundled zsh.
Notably, codex doctor reports install: consistent and correctly resolves bin to the release directory, while printing executable: ~/.local/bin/codex. So the two code paths disagree — doctor canonicalizes, the spawner doesn't.
Minimal A/B on 0.144.0, macOS aarch64. Same binary, two invocation paths:
$ ~/.local/bin/codex exec --sandbox read-only "Run: git rev-parse --abbrev-ref HEAD. Report only its exact output."ERROR codex_core::tools::router: error=failed to spawn code-mode host /Users/.../.local/bin/codex-code-mode-host: No such file or directory (os error 2)codexmain
$ ~/.codex/packages/standalone/current/bin/codex exec --sandbox read-only "Run: git rev-parse --abbrev-ref HEAD. Report only its exact output."exec /bin/zsh -lc 'git rev-parse --abbrev-ref HEAD' ... succeeded in 1549ms:mastercodexmaster
Since code_mode_host is stable and enabled by default, this breaks every tool call on standalone installs.
The more severe bug is the second-order failure
In the first run there is no exec block at all. The helper spawn fails, the error is logged — and then the turn continues and the model answers from nothing. It reported the branch as main. The actual branch is master.
A tool-host spawn failure is being surfaced to the model as something it can proceed past, so a hard infrastructure error degrades into a silently fabricated tool result. That seems worth separating from the install bug: even after the path issue is fixed, a helper that dies mid-session would presumably produce the same class of invented output.
Workarounds
No reinstall needed — the helper is already on disk, just not where the spawner looks.
Put ~/.codex/packages/standalone/current/bin ahead of ~/.local/bin on PATH (note: ~/.zshrc is only read by interactive shells, so non-interactive/GUI launches still break), or
symlink the packaged helper into ~/.local/bin/, or
set CODEX_CODE_MODE_HOST_PATH to the packaged helper.
Suggested fix
Canonicalize current_exe() before the sibling lookup — matching what doctor already does — and fail the turn when the helper cannot spawn, rather than letting the model answer without its tools.
Reacted by Yonatan Haike, github user, Wojciech Wentland and Pablo Opazo
Completely broken on archlinux as well, with no opportunity to symlink if installed directly from the arch packages, because that bin doesn't exist anywhere in .codex either.
Reacted by github user, littleya, Bastian Bloessl, NazarKalytiuk, David Ellis and Andrei
Completely broken on archlinux as well, with no opportunity to symlink if installed directly from the arch packages, because that bin doesn't exist anywhere in .codex either.
default_host_program() in codex-rs/code-mode/src/remote_session.rs passes std::env::current_exe() directly to resolve_host_program(), which derives the host path as a sibling of the exe. On macOS, current_exe() is backed by _NSGetExecutablePath and returns the invocation path (the symlink), not its target.
The standalone installer creates ~/.local/bin/codex as a symlink to ~/.codex/packages/standalone/current/bin/codex but does not create a matching codex-code-mode-host symlink. So the sibling lookup resolves to ~/.local/bin/codex-code-mode-host — which doesn't exist — and every tool call fails before execution.
The host binary is on disk at ~/.codex/packages/standalone/current/bin/codex-code-mode-host, just not where the resolver looks for it.
Proposed fix
Canonicalize current_exe before the sibling lookup:
dunce::canonicalize is already used throughout the workspace (e.g. windows-sandbox-rs, path-utils, core). The pure resolve_host_program function stays unchanged — canonicalization happens at the call site, which is the filesystem boundary.
The unwrap_or(exe) fallback preserves the current behavior if canonicalization fails.
This is the same class of bug as #30732 / #30856 (Windows sandbox helpers resolved current_exe() without canonicalization).
Workarounds
Any of these unblocks tool execution until the fix lands:
FWIW, I also see this with 0.144.0 on Windows, but the workaround doesn't apply as there isn't a codex-code-mode-host.exe anywhere in %USERPROFILE%\.codex as with the macOS workaround, nor anywhere in %USERPROFILE%\scoop. Installed via scoop and codex doctor doesn't find anything wrong, but GPT 5.6 Sol is unable to access local files, reporting that "the tool adapter expects codex-code-mode-host.exe".
FWIW, I also see this with 0.144.0 on Windows, but the workaround doesn't apply as there isn't a codex-code-mode-host.exe anywhere in %USERPROFILE%\.codex as with the macOS workaround. Installed via scoop and codex doctor doesn't find anything wrong, but GPT 5.6 Sol is unable to access local files, reporting that "the tool adapter expects codex-code-mode-host.exe".
Well not only on windows. Same issue on arch linux where the file simply does not exist when using the official package so there is nothing to symlink.
The maintainer says the issue is with codex itself not the package which has been confirmed by the issue not being arch specific.
The archlinux package issue: https://gitlab.archlinux.org/archlinux/packaging/packages/openai-codex/-/work_items/49
All shell/tool execution failed before the command ran, including pwd and true.
The same failure reproduced in the parent agent, existing subagents, and newly spawned subagents.
gh itself was installed and authenticated, but gh could not be reached from affected agents because the tool host failed first.
Errors observed:
failed to spawn code-mode host /home/linuxbrew/.linuxbrew/Caskroom/codex/0.144.0/codex-code-mode-host: No such file or directory (os error 2)
After manually symlinking codex-code-mode-host to codex-x86_64-unknown-linux-musl, the missing-file error changed to:
code-mode host exited during handshake
That symlink did not fix the issue, presumably because the regular CLI binary does not behave as a valid code-mode host entrypoint when invoked under that name.
Homebrew cask contents after brew reinstall --cask codex:
No codex-code-mode-host binary was present anywhere under the cask directory.
codex doctor reported the install as broadly healthy, and websocket/auth checks passed, so the issue was isolated to the code-mode host execution path.
Workaround that restored shell/tool execution:
[features]
code_mode_host = false
After disabling code_mode_host, newly spawned agents could run:
For Homebrew users: opened Homebrew/homebrew-cask#274197 switching the cask to the codex-package-<arch>-<os>.tar.gz release asset, which already contains both bin/codex and bin/codex-code-mode-host. Tested end-to-end on Apple Silicon — tool execution works again with no code-mode host spawn errors.
Reacted by Minoru Mizutani and Thiago Majesk Goulart
Thanks for reporting the issue. We're working on a fix.
@etraut-openai can you expand on what the "fix" is? Do downstream packages need to change how they build from source? In a later comment you said you were fixing "for homebrew", does that mean a new release of Codex to solve it or changes to how Homwbrew's Codex formula works?
For Homebrew users: opened Homebrew/homebrew-cask#274197 switching the cask to the codex-package-<arch>-<os>.tar.gz release asset, which already contains both bin/codex and bin/codex-code-mode-host. Tested end-to-end on Apple Silicon — tool execution works again with no code-mode host spawn errors.
FWIW this was previously done for the homebrew cask and it caused some issues so was backed out. We're still figuring out how to make the new packaging strategy compatible with Apple's signing requirements and will follow up to update the cask when it's ready. I would not recommend using this approach right now.
Guys I ask you to please read the issue in its entirety before posting comments, there is a lot of duplicated info/messages and it only clutters this thread.
If you don't have anything new just don't comment please, thank you.
I have no authority, I am just kindly asking you to keep it to the theme here.
Activity
github-actions commentedon Jul 9, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
tyler-lloyd commentedon Jul 9, 2026
on apple silicon, seems like it got placed in
symlinking fixes it for now
MoJony commentedon Jul 9, 2026
I solved it with clade code lol, here is what worked for me:
Root cause looks like helper resolution off the un-canonicalized
current_exe()— same class as #30732 / #30856, which hit the sandbox helpers on Windows.The standalone installer creates
~/.local/bin/codex -> ~/.codex/packages/standalone/current/bin/codex(per #17022).codex-code-mode-hostships next to the real binary and is intentionally not placed on PATH. But the spawner resolves the helper as a sibling ofcurrent_exe(), and on macOS that returns the symlink path rather than its target — so it looks in~/.local/bin/and finds nothing. Neither fallback saves it: the packagedcodex-resources/contains only the bundledzsh.Notably,
codex doctorreportsinstall: consistentand correctly resolvesbinto the release directory, while printingexecutable: ~/.local/bin/codex. So the two code paths disagree —doctorcanonicalizes, the spawner doesn't.Minimal A/B on 0.144.0, macOS aarch64. Same binary, two invocation paths:
Since
code_mode_hostisstableand enabled by default, this breaks every tool call on standalone installs.The more severe bug is the second-order failure
In the first run there is no
execblock at all. The helper spawn fails, the error is logged — and then the turn continues and the model answers from nothing. It reported the branch asmain. The actual branch ismaster.A tool-host spawn failure is being surfaced to the model as something it can proceed past, so a hard infrastructure error degrades into a silently fabricated tool result. That seems worth separating from the install bug: even after the path issue is fixed, a helper that dies mid-session would presumably produce the same class of invented output.
Workarounds
No reinstall needed — the helper is already on disk, just not where the spawner looks.
~/.codex/packages/standalone/current/binahead of~/.local/binonPATH(note:~/.zshrcis only read by interactive shells, so non-interactive/GUI launches still break), or~/.local/bin/, orCODEX_CODE_MODE_HOST_PATHto the packaged helper.Suggested fix
Canonicalize
current_exe()before the sibling lookup — matching whatdoctoralready does — and fail the turn when the helper cannot spawn, rather than letting the model answer without its tools.PaulRBerg commentedon Jul 9, 2026
Can confirm that symlinking works
Sushisource commentedon Jul 9, 2026
Completely broken on archlinux as well, with no opportunity to symlink if installed directly from the arch packages, because that bin doesn't exist anywhere in
.codexeither.mustafa0x commentedon Jul 9, 2026
I assume this PR (and related) are supposed to fix: #31858
littleya commentedon Jul 9, 2026
You can download codex-code-mode-host from releases and place it to /usr/bin/codex-code-mode-host after decompress, such as: https://github.com/openai/codex/releases/download/rust-v0.144.0/codex-code-mode-host-x86_64-unknown-linux-musl.tar.gz
GithubUser5462 commentedon Jul 9, 2026
Download, extract and run:
morluto commentedon Jul 9, 2026
Working on a fix for this, submitting a PR shortly
morluto commentedon Jul 9, 2026
Root cause
default_host_program()incodex-rs/code-mode/src/remote_session.rspassesstd::env::current_exe()directly toresolve_host_program(), which derives the host path as a sibling of the exe. On macOS,current_exe()is backed by_NSGetExecutablePathand returns the invocation path (the symlink), not its target.The standalone installer creates
~/.local/bin/codexas a symlink to~/.codex/packages/standalone/current/bin/codexbut does not create a matchingcodex-code-mode-hostsymlink. So the sibling lookup resolves to~/.local/bin/codex-code-mode-host— which doesn't exist — and every tool call fails before execution.The host binary is on disk at
~/.codex/packages/standalone/current/bin/codex-code-mode-host, just not where the resolver looks for it.Proposed fix
Canonicalize
current_exebefore the sibling lookup:dunce::canonicalizeis already used throughout the workspace (e.g.windows-sandbox-rs,path-utils,core). The pureresolve_host_programfunction stays unchanged — canonicalization happens at the call site, which is the filesystem boundary.The
unwrap_or(exe)fallback preserves the current behavior if canonicalization fails.This is the same class of bug as #30732 / #30856 (Windows sandbox helpers resolved
current_exe()without canonicalization).Workarounds
Any of these unblocks tool execution until the fix lands:
ln -s ~/.codex/packages/standalone/current/bin/codex-code-mode-host ~/.local/bin/codex-code-mode-hostexport CODEX_CODE_MODE_HOST_PATH=~/.codex/packages/standalone/current/bin/codex-code-mode-host~/.codex/packages/standalone/current/binahead of~/.local/binonPATHsmithwinston commentedon Jul 9, 2026
FWIW, I also see this with
0.144.0on Windows, but the workaround doesn't apply as there isn't acodex-code-mode-host.exeanywhere in%USERPROFILE%\.codexas with the macOS workaround, nor anywhere in%USERPROFILE%\scoop. Installed via scoop andcodex doctordoesn't find anything wrong, but GPT 5.6 Sol is unable to access local files, reporting that "the tool adapter expectscodex-code-mode-host.exe".ChromMob commentedon Jul 9, 2026
Well not only on windows. Same issue on arch linux where the file simply does not exist when using the official package so there is nothing to symlink.
The maintainer says the issue is with codex itself not the package which has been confirmed by the issue not being arch specific.
The archlinux package issue:
https://gitlab.archlinux.org/archlinux/packaging/packages/openai-codex/-/work_items/49
7 remaining items
mattpodolak commentedon Jul 9, 2026
Hit this issue after switching back to codex after a while and riiiiight back to claude i go
disneyLadySango commentedon Jul 9, 2026
Additional Linux/Homebrew data point.
Environment:
/home/linuxbrew/.linuxbrew/Caskroom/codex/0.144.0/codex-x86_64-unknown-linux-muslgpt-5.6-solObserved behavior:
pwdandtrue.ghitself was installed and authenticated, butghcould not be reached from affected agents because the tool host failed first.Errors observed:
After manually symlinking
codex-code-mode-hosttocodex-x86_64-unknown-linux-musl, the missing-file error changed to:That symlink did not fix the issue, presumably because the regular CLI binary does not behave as a valid code-mode host entrypoint when invoked under that name.
Homebrew cask contents after
brew reinstall --cask codex:No
codex-code-mode-hostbinary was present anywhere under the cask directory.codex doctorreported the install as broadly healthy, and websocket/auth checks passed, so the issue was isolated to the code-mode host execution path.Workaround that restored shell/tool execution:
After disabling
code_mode_host, newly spawned agents could run:successfully.
krinoid commentedon Jul 9, 2026
Using
codex -c features.code_mode_host=falseseems to be a workaround for me before the upstream fixanh-sunbound commentedon Jul 9, 2026
For Homebrew users: opened Homebrew/homebrew-cask#274197 switching the cask to the
codex-package-<arch>-<os>.tar.gzrelease asset, which already contains bothbin/codexandbin/codex-code-mode-host. Tested end-to-end on Apple Silicon — tool execution works again with no code-mode host spawn errors.austinbutler commentedon Jul 9, 2026
@etraut-openai can you expand on what the "fix" is? Do downstream packages need to change how they build from source? In a later comment you said you were fixing "for homebrew", does that mean a new release of Codex to solve it or changes to how Homwbrew's Codex formula works?
bolinfest commentedon Jul 9, 2026
https://github.com/openai/codex/actions/runs/29053738151 is the build for the
0.144.1hotfix that should fix the Homebrew release.anp-oai commentedon Jul 9, 2026
FWIW this was previously done for the homebrew cask and it caused some issues so was backed out. We're still figuring out how to make the new packaging strategy compatible with Apple's signing requirements and will follow up to update the cask when it's ready. I would not recommend using this approach right now.
cconger commentedon Jul 9, 2026
A short term workaround until version 0.144.1 lands in homebrew: you can download the released
codex-code-mode-host-*from the latest release https://github.com/openai/codex/releases/tag/rust-v0.144.0 and colocate the binary with your currentcodexbinary.johnbindel commentedon Jul 9, 2026
Easy mode workaround for MacOS users (using Darwin) who installed with homebrew:
Nick2bad4u commentedon Jul 9, 2026
Tip
For Windows NPM / Node Users the
codex-code-mode-host.exeis located here:%APPDATA%\Roaming\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\binAll you need to do is copy the
codex-code-mode-host.exeto%USERPROFILE%\.codex\plugins\.plugin-appserver\after that, everything works.
renoirvieir4 commentedon Jul 9, 2026
Additional confirmation from macOS ARM64 with Codex CLI
0.144.0installed via Homebrew:/opt/homebrew/bin/codex-code-mode-host(No such file or directory (os error 2)).codex doctor --summary --no-colorreports17 ok · 1 idle · 0 warn · 0 fail, includinginstall: consistent.codexbinary but not the separate code-mode host expected at that path.~/.codexreset are unrelated; the terminal CLI can launch independently.This also suggests
codex doctorshould validate that the code-mode host required by the active workspace/client path exists and is executable.ChromMob commentedon Jul 9, 2026
Guys I ask you to please read the issue in its entirety before posting comments, there is a lot of duplicated info/messages and it only clutters this thread.
If you don't have anything new just don't comment please, thank you.
I have no authority, I am just kindly asking you to keep it to the theme here.
anp-oai commentedon Jul 9, 2026
Homebrew/homebrew-cask#274225 updates homebrew to point at
0.144.1which we expect to resolve the issue for brew users.