Skip to content

[Bug]: Codex threads can't run any tools when the local codex binary has no codex-code-mode-host beside it #19153

Closed

Description

@indishere

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Server, Codex provider (apps/server/src/provider/CodexInstallation.ts)

Steps to reproduce

  1. Install Codex as the bare standalone release binary on PATH, e.g. ~/.local/bin/codex (0.160.1, codex-x86_64-unknown-linux-musl), with no codex-code-mode-host next to it.
  2. Start a Codex thread in T3 Code with a model that uses Code Mode (e.g. gpt-6-sol).
  3. Ask it to run any shell command.

Expected behavior

T3 Code either uses a working Codex or falls back to its managed Codex package, which already ships bin/codex-code-mode-host.

Actual behavior

T3 Code reuses the local binary (source: "local"). Codex fails every exec call, so the agent cannot run any commands and tells the user its "diagnostic tool couldn't start".

From the T3 Code-originated rollout (originator: "T3 Code", cli_version: "0.160.1"):

custom_tool_call exec  {cmd: "pwd; uname -a; uptime; free -h; ..."}
custom_tool_call_output: failed to spawn code-mode host /home/<user>/.local/bin/codex-code-mode-host: No such file or directory (os error 2)

Same binary outside T3:

$ codex exec --json "Run the shell command 'echo hi' and reply with its output only."
{"type":"item.completed","item":{"type":"error","message":"Code Mode is unavailable because failed to spawn code-mode host /home/<user>/.local/bin/codex-code-mode-host: host executable was not found. Code mode will fail closed; enable `features.code_mode_host` and install `codex-code-mode-host`."}}
ERROR codex_core::tools::router: error=failed to spawn code-mode host /home/<user>/.local/bin/codex-code-mode-host: No such file or directory (os error 2)
{"type":"item.completed","item":{"type":"agent_message","text":"I couldn’t run the command: the shell tool is unavailable."}}

Root cause

Codex only looks for codex-code-mode-host beside its real executable. These checks show that:

Setup Result
Bare binary, host only on PATH ❌ failed to spawn code-mode host /tmp/bare/codex-code-mode-host
Binary from the official npm tarball (vendor/.../bin/ has codex + codex-code-mode-host) ✅ echo hi → hi
Symlink → that npm binary ✅ works, so the lookup uses the real path

cmp confirms that the user's ~/.local/bin/codex is byte-identical to the npm package's vendor/x86_64-unknown-linux-musl/bin/codex. Only the sibling host is missing.

In CodexInstallation.ts, fromDirectory (the managed install path) already rejects packages that lack bin/codex-code-mode-host. resolveLocal has no equivalent check. It accepts any codex on PATH that answers --version and app-server --help, and resolve() prefers local over managed. As a result, a broken local binary is preferred over a working managed install.

Impact

Major degradation: every Code Mode tool call fails (shell, web, etc.), and the agent cannot inspect or change anything.

Version or commit

T3 Code Nightly 0.0.46-nightly.20261013.3042 (commit 5d6e4192bfcf); Codex CLI 0.160.1.

Environment

Linux x64 (kernel 7.0), T3 Code desktop AppImage.

Workaround

Put the matching codex-code-mode-host (from the @openai/codex@<version>-linux-x64 npm tarball) next to the real codex binary, or remove the bare binary from PATH so that T3 installs its managed Codex.


Generated by Opus 5.5 in T3 Code Nightly

Activity

  1. added a commit that references this issue on Oct 13, 2026
    6a1c0ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions