Repository navigation
Fix #1880: codex lane runs a current Codex CLI, names it, and accepts consult.codexPath - #1889
Merged
Merged
Conversation
…t, and allow an override `consult -m codex --model-id gpt-6-astra` failed with "requires a newer version of Codex" because the lane runs the Codex CLI bundled inside @openai/codex-sdk, and `^0.146.0` on a 0.x package pins the minor, so no install could get past 0.146.x. Upgrading the user's own codex changed nothing, and nothing said which binary ran. - Bump @openai/codex-sdk to ^0.167.0 (bundled codex-cli 0.167.0). The SDK API change is additive; credential handling is byte-identical (CODEX_API_KEY only from apiKey, which consult never passes). The widened ModelReasoningEffort union adds max, ultra and persistent, which the Spec 1286 exhaustiveness guard requires us to accept. - Print `[CODEX] binary:` (bundled version, or override path + its --version) on every run, and name the binary in every codex-lane error annotation. - Add consult.codexPath (absolute path, off by default), passed to the SDK as codexPathOverride. A path that does not run fails loudly; no fallback to the bundle.
…cycle A missing or non-executable consult.codexPath threw before the try block, so it skipped discardStaleOutput and the failure metrics: a review file from an earlier run could survive and be read as the current result. Found by codex at CMAP.
…e SDK lookup walks paths; thread verdicts
Contributor
Author
|
Clean and well-scoped, thank you. The bump, the binary-and-version line, the error annotation naming the client, and consult.codexPath with a fail-loud preflight all match what was asked, and the subscription check on the new bundled binary is in the body where it belongs. Both doc trees are updated. One observation, no change needed: |
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.
Summary
consult -m codex --model-id gpt-6-astrafailed with a provider 400 ("requires a newer version of Codex") because the codex lane runs the Codex CLI bundled inside@openai/codex-sdk, which was stuck at 0.146.x. This bumps the SDK to 0.167.0, prints which Codex binary and version ran, and adds an opt-inconsult.codexPathso a lagging bundle can't block a new model again.Fixes #1880
Root Cause
packages/codev/package.jsondeclared"@openai/codex-sdk": "^0.146.0". On a 0.x package a caret pins the minor (>=0.146.0 <0.147.0), so no install could get past 0.146.x. The SDK pins its@openai/codexbinary to its own exact version and resolves it from its own install location, never PATH, so upgrading the user'scodexchanged nothing. And nothing in consult's output said which binary ran, so the error read like a CLI upgrade the user had already done.Fix
@openai/codex-sdk^0.146.0→^0.167.0(bundledcodex-cli 0.167.0). The API diff is additive (configOverrides,threadSource,cyberAccessProgram).ModelReasoningEffortwidens to addmax | ultra | persistent; the Spec 1286 exhaustiveness guard requiresREASONING_EFFORTSto accept them, so that list, its test and bothconsult.mdcopies grow to match.[CODEX] binary: …(bundled version, or override path + its--version), and every codex-lane error annotation ends withThe codex lane ran …. That includes failures on the shipped default model, which the annotation used to leave bare.consult.codexPath(off by default): an absolute path, passed to the SDK ascodexPathOverride. The lane runs<path> --versionbefore consulting. A missing or non-executable path fails the consultation, naming the config file, with no fallback to the bundled CLI. Documented incodev/andcodev-skeleton/resources/commands/consult.md.apiKey(owner constraint: stay on the ChatGPT subscription). Unchanged, now pinned by a test.~130 LOC of production code + docs; ~180 LOC of tests.
Subscription check on the new bundled binary (requested by the architect)
The
.envis loaded exactly as consult'sloadDotenvdoes it. The binary is the one the SDK itself resolves (new Codex(...)with noapiKey), run with the env the SDK hands its subprocess. Key values are never printed.The SDK's credential code is byte-identical between 0.146.1 and 0.167.0:
CODEX_API_KEYis set only from theapiKeyoption, and the subprocess env is a copy ofprocess.envplus the originator tag.Test Plan
consult/__tests__/bugfix-1880-codex-binary.test.ts(9 tests). Without the fix, 7 of the original 8 fail; the 8th ("never passes apiKey") guards the billing constraint, which was already true. The 9th, added at CMAP, checks that a failedcodexPathpreflight still discards a stale review file; it fails without the preflight-inside-trymove.lane-models.test.ts's "default-model failure is left unannotated" now expects the binary line, and still expects no model provenance.buildcheck).consult, from the worktree:consult -m codex --model-id gpt-6-astra --prompt "Reply with the single word OK."→[CODEX] binary: Codex CLI 0.167.0 bundled with codev …thenOK. The released 3.3.7 gives the 400 on the same command.consult.codexPath = /opt/homebrew/bin/codex→[CODEX] binary: /opt/homebrew/bin/codex, codex-cli 0.167.0 (from \consult.codexPath` in …/.codev/config.local.json)thenOK`.consult.codexPathset to a path that doesn't exist → exit 1:Cannot run the codex binary … ENOENT … Codev does not fall back to the bundled CLI.Not done
CODEX_PATHenv var: one config surface, and the global~/.codev/config.jsonlayer already covers "all my projects".consult.codexPathplus the[CODEX] binary:line make that visible and self-serviceable. Bumping the SDK at release time remains a manual step.CMAP
gemini APPROVE · codex REQUEST_CHANGES → APPROVE (stale-review-file gap, fixed in
84af4e1a0) · claude APPROVE