Skip to content

Install Codex's code-mode host beside the pinned binary - #473

Merged
renmengye merged 2 commits into
mainfrom
fix/codex-code-mode-host
Oct 4, 2026
Merged

renmengye merged 2 commits into
mainfrom
fix/codex-code-mode-host

Conversation

@renmengye

Copy link
Copy Markdown
Member

Urgent fix. Native Codex sessions on the pinned Codex 0.160.0 fail on their first turn:

Code Mode is unavailable because failed to spawn code-mode host /opt/agent/codex-code-mode-host: host executable was not found. Code mode will fail closed ...

The agent cannot run any command, so every run ends "without a submit" and the fleet starts another one each cadence. On one fleet this produced 18 empty runs and research-log comments in one evening before its launches were held.

Cause. With a native OpenAI model, Codex 0.160 runs tools through code mode, which needs a companion binary codex-code-mode-host beside codex. We installed only codex. Endpoint (chat-bridge) sessions don't use code mode, which is why fleets running endpoint authors were unaffected. Checked with the 0.160 binary: setting features.code_mode, code_mode_only and code_mode_host to false does not help (the model requires code mode, which then fails closed). With the host beside codex, a real command_execution runs.

Fix.

  • harnesses.toml [codex]: code_mode_host_sha256 for codex-code-mode-host-x86_64-unknown-linux-musl.tar.gz, matching GitHub's published digest. A codex version override must also supply OUTERLOOP_CODEX_CODE_MODE_HOST_SHA256; it is added to the tick and deploy allowlists.
  • install_codex.sh: fetches the host and verifies its sha256 before extracting, then installs it as codex-code-mode-host beside codex, both atomically with their own verified markers. A host fetch or verify failure fails the whole install.
  • harness_cli.verified: a codex without a matching host counts as drift, so harness upgrade (run by every deploy as --used) repairs existing installs with no manual step.
  • CodexHarness: binds the host read-only at /opt/agent/codex-code-mode-host beside /opt/agent/codex. The session refuses to start (codex-code-mode-host-missing) when the host is absent, so no session runs without tools.

Tests. Installer pair install, plus failure cases (bad host sha, failed host fetch, bad codex sha) on fresh and legacy installs. Pins and override rule, container bind, launch refusal, and drift detection. Mutation checks: removing the host sha check or the launch refusal each fails a test. Full gate: ruff, format, mypy, 3154 passed, 12 skipped.

Compatibility. No persisted kernel state changes. An existing single-binary 0.160 install is repaired on the next harness upgrade. Rolling back to a kernel without this change leaves an unused extra file beside codex. release/0.3 also pins Codex 0.160, so this needs a cherry-pick there (rc2).

Built by Codex (gpt-5.6-terra); diagnosed, verified against the 0.160 binary and cross-reviewed by Claude Opus 5.5; advisory review panel to follow.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head fd6d353a — reviewer summarizer:hermes/gpt-5.6-terra over coverage+credentials+deployment+general+lifecycle+prose.

terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.

Verdict: nothing blocking — 2 advisory notes.

2 findings attached to the lines below.

Merged verdict: two non-blocking change findings. Rejected: none.

Comment thread src/outerloop/harness.py
Comment thread scripts/install_codex.sh
@renmengye renmengye added the outerloop:review re-request the advisory review label Oct 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head 89ac3ac4 — reviewer hermes/gpt-5.6-terra.

terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.

Verdict: no defects found.

@renmengye
renmengye merged commit b749775 into main Oct 4, 2026
5 checks passed
@renmengye
renmengye deleted the fix/codex-code-mode-host branch October 4, 2026 01:59
@renmengye

Copy link
Copy Markdown
Member Author

Correction to the description: release/0.3 still pins Codex 0.130.0 (it was frozen before the 0.160 bump), so it never had the code-mode host problem, and this PR and #476 need no cherry-pick for 0.3. The only harness question for 0.3.0 final is #477's Claude Code 2.1.285 bump (2.1.272 refuses claude-opus-5-5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

outerloop:review re-request the advisory review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant