Repository navigation
Put the pinned Hookdeck CLI on PATH for Codex's login shells - #115
Merged
Merged
Conversation
Codex runs every command as `/bin/bash -lc`. A login shell sources Debian's /etc/profile, which replaces PATH with a fixed list that leaves out /home/node/.npm-global/bin, so the PATH the harness passes on `docker exec` never reached a Codex tool call. In release run 42044644850 every Codex attempt that invoked `hookdeck` got `command not found` (26/26, 18/22, 16/16 and 19/19 across the four Codex arms) and worked around it by absolute path, `npx`, an unpinned `npx -y hookdeck-cli@latest`, or the REST API. Claude Code runs `bash -c`, inherits the PATH, and was unaffected. - Dockerfile: put the npm prefix on PATH with `ENV` (non-login shells and any exec without an explicit PATH) and with an /etc/profile.d/npm-global.sh entry (login shells). A profile.d entry rather than symlinks into /usr/local/bin, so `skills` and anything an agent installs with `npm install -g` are covered too. The installed CLI version is unchanged. - Image tag: include a hash of the Dockerfile, so a machine with a cached image rebuilds instead of reusing one without the fix. - Sandbox self-check: before a cell starts, run `command -v hookdeck && hookdeck --version` in a non-login and a login shell and throw unless both resolve the pinned version. The throw errors the cell, so no result file is written. `--version` rather than `hookdeck version`, which creates a config file and calls GitHub inside the agent's sandbox. - triage: flag PINNED CLI NOT USED for a cell whose shell said `hookdeck: command not found` or that ran a `hookdeck-cli@<version>` other than the pin. Against run 42044644850 it flags 69 of 76 Codex cells and none of the 38 Claude Code cells. - AGENTS.md: a Trap entry for the login-shell PATH reset, and the new triage signal. Not verified in a built image: Docker was not available where this was written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The login-shell PATH fix changed only the Dockerfile, and it gave the Codex arms the pinned Hookdeck CLI they had been missing. The harness fingerprint covered the base prompt, the CLI pin, the skills CLI and the skills submodule pin, so rows measured with and without the CLI on PATH would have carried the same `harness` hash and read as measured under one instrument. `harnessFingerprint` now also hashes the image definition: the same 12-character Dockerfile hash the image tag uses, exported from the sandbox package as `sandboxImageDefinition`. Every row recorded before this change has a different `harness` from every row after it, which is the point; `export-results --merge` will report carried-forward rows as measured under a different harness. reference/results-format.md and the two code comments that list the fingerprint inputs now name the image definition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed sandbox self-check is systemic: every matrix job builds the same image from the same Dockerfile, so one broken image errors every cell. Until now each cell errored on its own and the matrix ran to the end. Reuse the provider-refusal path (#103): - Run evals: when the eval exits non-zero and the log contains `sandbox self-check failed`, write sandbox-broken.marker (experiment, eval, matched string; no log lines) and exit 1. - Record broken sandbox: upload it as `sandbox-broken-<experiment>__<eval>`, kept 90 days like the provider marker. - Cancel the run: now fires on either marker. - publish-results: refuses a run with any `sandbox-broken-*` artifact, the same way it refuses `provider-refused-*`, so a cancel that does not take still cannot publish. The string is exported from toolchain-check.ts as SANDBOX_SELF_CHECK_FAILED and starts the error the check throws. A test fails if eval-refresh.yml stops matching it. AGENTS.md's Trap entry says what CI does with the failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for the sandbox self-check and the wording around it. The self-check gave every failed probe the `sandbox self-check failed` prefix, which CI now treats as a run-level failure. An in-container timeout (124/137), a `docker exec` the daemon refused or a container that had died would therefore have cancelled the whole matrix over one cell's bad minute. - The probe now prints a sentinel and exits 3 when `command -v hookdeck` resolves nothing, so a missing CLI cannot be confused with `docker exec` exiting 1 for a dead container. - Only two outcomes are facts about the image and carry the cancelling prefix: no `hookdeck` on PATH, or a recognisable version line that is not the pin. Anything else, including a probe that throws, is retried once and then throws `sandbox self-check could not complete`, which errors that cell alone. A test holds the second prefix to not containing the first. - Tests run the real probe in a local shell, both directly and nested in single quotes as the login probe is, against a PATH with no `hookdeck`, a stand-in printing 2.5.0 and one printing 3.1.0. The fixtures for a missing CLI now match what the probe returns. - The drift test also checks that `Record broken sandbox` exists and uploads the marker, and that `Cancel the run` fires on `sandbox-broken.marker` as well as `provider-refused.marker`. - triage: the single PINNED CLI NOT USED flag is now two. PINNED CLI NOT ON PATH says the agent had to find the CLI, which by absolute path or unversioned `npx` was still the pinned 2.5.0. UNPINNED CLI is raised only where a `hookdeck-cli@<other>` ran. Against run 42044644850: 69 of 76 Codex cells flagged, 2 of them also UNPINNED CLI, and none of the 38 Claude Code cells. - Wording: Codex runs most commands in a login shell, not every one. In run 42044644850, 2,233 of its 2,456 shell commands were `bash -lc`. The four Codex attempts that invoked `hookdeck` without hitting `command not found` ran it only through `bash -c`. AGENTS.md, the Dockerfile, docker-sandbox.ts, toolchain-check.ts and pinned-cli.ts now say so. reference/results-format.md, provenance.ts and image.ts no longer claim the image change has given Codex the CLI. That is for the first run on the new image to confirm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The version match in classifyToolchainProbe is a whole whitespace-delimited token. A CLI release that coloured `--version` would put an escape code against the number. Every cell of a working image would then read as the wrong version, and the run would cancel. stdout and stderr are now stripped of CSI sequences (including SGR colour) and OSC sequences (including hyperlinks) before anything is matched. A test covers coloured output with CRLF, an OSC 8 hyperlink with both terminators, and a coloured 3.1.0, which must still read as the wrong version. The Run evals `::error::` for a broken sandbox no longer says the CLI is not on PATH, since a wrong version raises it too: "The sandbox image failed its self-check (pinned Hookdeck CLI missing from PATH or wrong version)". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #114.
What was wrong
Codex runs most commands in a login shell (
/bin/bash -lc): 2,233 of its 2,456 shell commands in release run 42044644850. A login shell sources Debian's/etc/profile, which replaces PATH with/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games. That leaves out the npm prefix holding the pinned CLI (/home/node/.npm-global/bin). The PATH the harness sets ondocker execonly reaches non-login shells, which is why Claude Code was unaffected, and why the few Codex attempts that ranhookdeckonly throughbash -cfound it.What changed
ENV(non-login shells, root execs) and through/etc/profile.d/npm-global.sh(login shells). I used a profile.d entry rather than symlinks into/usr/local/binbecause it covers the whole prefix, includingskillsand anything an agent installs withnpm install -gmid-run. The CLI version is unchanged (2.5.0).ensureSandboxImagereuses any existing tag, so without this a machine with a cached image would keep the old one.harnessvalues, andexport-results --mergereports carried rows asharness changed.reference/results-format.mdis updated.packages/sandbox/src/toolchain-check.ts): before seeding or credentials, it probesbash -candbash -lcforhookdeckand its--version, with ANSI colour stripped before the version is matched. A failure errors the cell through the existing errored-cell path, so no result file is written. There are two kinds:command -v hookdeckresolves nothing (the probe prints a sentinel and exits 3), or the version line is not the pin. These throwsandbox self-check failed.docker exec, a dead container, no version line. This is retried once, then throwssandbox self-check could not complete, which errors that cell alone.--versionrather thanhookdeck version, because the subcommand creates~/.config/hookdeck/config.tomland calls the GitHub API inside the agent's sandbox. The flag does neither.Run evalstreatssandbox self-check failedlike a provider refusal. It writes asandbox-brokenmarker, uploads it, and cancels the run.publish-resultsrefuses any run carrying asandbox-broken-*artifact. A test fails if the workflow, the marker steps or the error string drift apart.PINNED CLI NOT ON PATHmeans the shell saidhookdeck: command not found, so the agent had to find the CLI.UNPINNED CLImeans ahookdeck-cli@<other>ran.@latestdoesn't trip either flag. Against run 42044644850: 69 of 76 Codex cells flagged, 2 of them alsoUNPINNED CLI, and none of the 38 Claude Code cells.Verified
pnpm -r build,pnpm typecheck, sandbox package typecheck: passpnpm check: framework 131/131, core 115/115, sandbox 49/49, web 71/71pnpm format:check,biome check: cleanactionlint1.7.12 (with shellcheck): no findingshookdeck, a stand-in printing 2.5.0 and one printing 3.1.0--versionoutput as the version it containsRecord broken sandboxstep,Cancel the runcondition and publish refusal against the codeshwith Debian's login PATH: the prefix comes back first, appears once however often it is sourced, and is written beforeUSER nodeNot verified
Docker wasn't available, so the image hasn't been built. An independent review confirmed from source the
/etc/profilebehaviour (Debian base-files and bash skel) and the--versionoutput (v2.5.0 source, cobra, the binary's ldflags), but nobody has run either in the image. That Codex's login shells resolve the CLI on the new image is still to be confirmed. The cancel and publish-refusal path for a broken sandbox hasn't been exercised in CI.Proposed check: dispatch
codex-gpt-5.4-minionbenchmark-localdev-001-listen-locallywithruns=1andEVALS_PUBLISH=false. Then confirm the log has nosandbox self-check, the transcript has nocommand not found, andtriageraises neither flag.Not in this change
No results are re-run or re-published here. The Codex cells of the v0.5.0 matrix are re-run after this merges.
🤖 Generated with Claude Code