Repository navigation
codex: self-check unpinned CLI versions instead of refusing them - #251
Merged
Merged
Conversation
selfCheck sends the exact argv Run builds (now shared via execArgs) to a loopback Responses endpoint with a scratch home and a random key, applies the contract test's checkWireRequest (moved into the product), and fails closed unless dropping the catalog override visibly offers tools. Not wired into the gate yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
validate (Open/doctor) and Run now gate each (version, model) on ensureToolFree after the catalog is fetched: pinned versions pass as before, any other pair must be recorded in <runtime>/codex/verified.json or pass selfCheck now. Only passes are recorded. Login and wire readiness no longer gate on the version: they send no transcript, and a plan login's catalog only exists after login. The contract test drops its not-pinned assertion and lets the self-check's own calls through untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing on every unpinned release TestContractSelfCheck runs the production self-check on the real CLI for gpt-6.1-sol and gpt-5.5; the latest leg goes red only when the self-check or the wire contract rejects the CLI, which is exactly when users on it are refused. Docs and AGENTS.md describe the self-check. Verified locally against Codex CLI 0.172.0 (unpinned): wire contract and self-check pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The sensitivity run now requires visibly offered tools (top-level tools or a non-message input item), not any contract failure: a CLI whose uncatalogued request only changes its instructions text no longer counts as having shown its tools. - A record vouches for the checked binary (version, size, mtime), not for every binary printing that version. - A verified.json of null no longer panics; it is re-checked like any corrupt record. Re-verified against the real Codex CLI 0.172.0: wire contract and self-check pass on gpt-6.1-sol and gpt-5.5. 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.
Why
The Codex runner admitted only exact pinned CLI versions. Codex shipped 11 stable releases in 28 days, and each one turned the daily contract check red (#244, #250). Each also refused every user on the new CLI until a witness release shipped the pin, even though in both cases the wire contract passed unchanged. Today 0.172.0 is out, and v0.15.1 only admits up to 0.171.0.
What changes
internal/platform/codex/selfcheck.go). Before an unpinned (version, model) pair gets a transcript, witness runs the realcodex execwith the exact argvRunbuilds (now shared throughexecArgs) against a loopback fake Responses endpoint. It uses a scratchCODEX_HOME, a random key and no proxy variables, so the user's key and witness's login are never involved.checkWireRequestto pass: no tools, only developer instructions and one user corpus. That function moved here from the contract test.<runtime>/codex/verified.json; failures are never recorded.validate(Open and doctor) andRuncallensureToolFreeafter the catalog is fetched. Pinned versions skip the check, so a bug in it can only affect versions that were refused before this change.TestLoginAndReadinessRejectUnverifiedCLIis replaced byTestLoginAndReadinessAcceptUnpinnedCLI.TestContractSelfCheck, the production self-check on the real CLI forgpt-6.1-solandgpt-5.5. Red now means users on latest are refused.Pins stay as a CI-verified fast path. Bump them when convenient, not on every Codex release.
Verification
make fmt vet testgreen;go vet -tags codexcontractclean.openai_base_url:os/execkeeps the last duplicate env key.TestContractToolFreeWireandTestContractSelfCheckpass. The self-check took ~14.5 s per model, once.Known limits (unchanged from pins)
Closes #250.
🤖 Generated with Claude Code