Skip to content

fix(release): assert the Codex CLI pin the candidate declares - #137136

Merged
steipete merged 2 commits into
mainfrom
fix/codex-release-package-contract-candidate-pin
Sep 3, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/codex-release-package-contract-candidate-pin

Conversation

@steipete

@steipete steipete commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Related: #136918 (make plugin dependency freshness advisory for frozen releases).

What Problem This Solves

Resolves a problem where release operators validating the frozen 2026.9.1 candidate with newer trusted tooling hit false failures in codex-on-demand and live-codex-npm-plugin. Full Release Validation 33722524584 hit this in Docker job 100549513614: the candidate declares Codex CLI 0.152.1, while the tooling required main's 0.153.0.

Why This Change Was Made

Each lane mounts its candidate checkout's extensions/codex/package.json read-only, separately from the trusted harness, and the shared assertion uses that manifest's exact CLI pin. It still requires the installed plugin dependency, resolved CLI package, platform alias specification/version, and executable --version to match that pin, retaining platform metadata and managed-path containment checks.

The candidate checkout already owns package/plugin preparation: on-demand receives OPENCLAW_DOCKER_E2E_REPO_ROOT, and npm-live uses CANDIDATE_ROOT. The core tarball excludes dist/extensions/codex/**, and its external-plugin catalog has no CLI pin; using the installed plugin alone would lose the independent candidate/plugin comparison. Duplicate caller containment checks and a one-use evidence writer are removed.

User Impact

Release operators can validate a self-consistent frozen candidate after main advances its Codex version. Candidate/plugin mismatches and non-exact pins remain blocking. No candidate, runtime, configuration, environment option, dependency version, or publication change.

Evidence

  • Before: the two archived CI lane logs show @openclaw/codex must depend on @openai/codex 0.153.0; found 0.152.1. The frozen unit fixtures also fail against the original assertion for this mismatch.
  • pnpm test test/scripts/codex-install-assertions.test.ts test/scripts/codex-client-version-contract.test.ts: 51 passed. Both callers accept the frozen pin and reject a plugin pin differing from the candidate; the three non-exact candidate-pin cases now use the same invalid pin in candidate and plugin metadata, fail against pre-fix code for the intended hardcoded-version error, and pass on this branch. Existing installed-package, platform, CLI, and missing-native-binary checks remain covered.
  • pnpm check:changed: passed. bash -n for both changed Docker scripts and git diff --check also passed.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base 7aff510afad21033fd0e7cd9bfc8197fdab1d4f3 --max-priority P2: scoped-clean, no actionable P0–P2 findings after the invalid-pin test correction. Intervening main changes did not touch these files, and the current three-way merge is clean.
  • Frozen candidate 904200199c209c1abeaa42914e6359e5cb36afc4: pnpm install && pnpm build passed in a second detached worktree. node scripts/package-openclaw-for-docker.mjs --source-dir "$candidate" --skip-build --output-dir "$candidate/.artifacts/codex-pin-proof" --output-name openclaw-current.tgz passed, including tarball integrity/import-graph checks. Core tarball SHA-256: 91b3d3f7392310bd45a6b704af1630e1977e5c8c3959a78890569d1a88284709.
  • The existing prepublish-plugin-registry-artifact.mjs create helper built the companion from that same clean frozen checkout; packed @openclaw/[email protected] declares @openai/codex: 0.152.1.

Tooling LOC: +17/-19 (net −2); tests: +42/-1. Direct Codex source inspection at 728cb12fe5794b0c3a8e776fb4994b1650b973a8 confirmed the platform aliases in codex-cli/bin/codex.js, npm alias/version generation in codex-cli/scripts/build_npm_package.py, and the CLI package/bin contract in codex-cli/package.json.

Local Docker proof used the exact lane command below on Linux ARM64 (CI was Linux x64), with the same rebuilt core/plugin artifacts for both runs:

OPENCLAW_SKIP_DOCKER_BUILD=1 \
OPENCLAW_DOCKER_E2E_IMAGE=openclaw-codex-pin-proof:bare \
OPENCLAW_DOCKER_E2E_REPO_ROOT="$candidate" \
OPENCLAW_DOCKER_E2E_SELECTED_SHA=904200199c209c1abeaa42914e6359e5cb36afc4 \
OPENCLAW_CURRENT_PACKAGE_TGZ="$candidate/.artifacts/codex-pin-proof/openclaw-current.tgz" \
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR="$candidate/.artifacts/codex-pin-proof/registry" \
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION=2026.9.1 \
bash scripts/e2e/codex-on-demand-docker.sh
  • Original tooling 13799ec4f8380c14f7ce1836ce611291254bdda2: exit 1, reproducing must depend on @openai/codex 0.153.0; found 0.152.1 at the shared assertion.
  • PR head 4a9f799ae6cbff007f0bfb6f1ca0ee0507b2137b: exit 0, full Codex on-demand Docker E2E passed. Evidence: package and CLI 0.152.1, platform alias @openai/codex-linux-arm64, platform version 0.152.1-linux-arm64, OS linux, CPU arm64. The managed-app-server doctor check returned ok:true with zero findings. Ordinary doctor completed 30 checks with the empty-fixture heartbeat and loopback onboarding warnings expected by the lane.

Not rerun: hosted Full Release Validation/Linux x64 lanes or credentialed live Codex agent turns. Both assertion callers are covered by unit tests; real Docker proof covers installation, onboarding, native CLI execution, and doctor. The release candidate remains unchanged.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling labels Sep 3, 2026
@steipete
steipete marked this pull request as ready for review September 3, 2026 07:20
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 3, 2026
Trusted Docker assertions used main's Codex CLI pin for frozen release
packages, rejecting the self-consistent 2026.9.1 candidate after main
advanced from 0.152.1 to 0.153.0.

The candidate plugin manifest owns the expected version. Mount it separately
in both lanes and retain exact plugin dependency, installed package,
platform alias, and executable checks. Remove duplicate containment checks
and inline the one-use evidence writer; tooling is net -2 lines.

Proof: candidate fixtures reproduce the old version failure; 51 focused
Codex install/client-version tests pass, pnpm check:changed passes, and
independent P0-P2 autoreview reports no actionable findings.
@steipete
steipete force-pushed the fix/codex-release-package-contract-candidate-pin branch from 4a9f799 to 20575e3 Compare September 3, 2026 07:54
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 4:12 AM ET / 08:12 UTC.

ClawSweeper review

What this changes

The PR makes Docker release-validation assertions obtain the expected Codex CLI version from the frozen candidate’s plugin manifest and tests both Docker assertion callers against matching and mismatching pins.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

No blocking findings. This active maintainer PR repairs a real frozen-candidate validation failure: current main still hardcodes the trusted harness pin, while the branch makes the candidate manifest authoritative and retains independent installed-package, platform, and executable checks.

Priority: P2
Reviewed head: 20575e3db1599305ffb42a8e88428520a20a8048

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair is narrowly scoped and well-covered, with supplied packaged Docker evidence aligned to the changed owner boundary.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored release-tooling PR is exempt from the contributor proof gate; its supplied before/after Docker evidence nevertheless exercises the changed candidate-to-installed-package assertion path.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored release-tooling PR is exempt from the contributor proof gate; its supplied before/after Docker evidence nevertheless exercises the changed candidate-to-installed-package assertion path.
Evidence reviewed 6 items Current-main failure source: Current main still defines the expected Codex version as 0.153.0 in the shared assertion, which cannot validate a self-consistent frozen candidate pinned to an earlier release.
Candidate-owned contract: The branch reads the separately mounted candidate manifest, requires an exact pin, and compares the installed plugin dependency, resolved package, platform alias, and CLI output to that one value.
Both release entrypoints: The on-demand lane mounts the candidate manifest read-only, while the npm-live lane already separates trusted harness and candidate roots; the shared harness runner forwards explicit Docker arguments.
Findings None None.
Security None None.

How this fits together

Release Docker lanes package a frozen OpenClaw candidate, install its Codex plugin, and validate the resolved CLI and platform package before accepting the candidate. The changed assertions connect candidate metadata to the installed plugin, Codex package, platform package, and executable version checks.

flowchart LR
  A[Frozen candidate manifest] --> B[Docker release lane]
  B --> C[Mounted candidate metadata]
  C --> D[Shared package assertion]
  E[Installed plugin and CLI] --> D
  D --> F[Platform and version checks]
  F --> G[Release validation result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +36, Other -2. Total +34 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 37 1 +36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 5 17 19 -2
Total 6 54 20 +34

Review metrics

Metric Value Why it matters
Production versus tests production +17/-19 (net -2); tests +37/-1 The repair removes the trusted-harness version constant while adding focused regression coverage for both assertion callers.

Technical review

Best possible solution:

Merge the candidate-manifest contract after normal exact-head CI, preserving one candidate-owned expected version and independent checks of the installed plugin, package, platform alias, and executable.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main unconditionally expects 0.153.0, whereas the branch’s focused fixtures model a frozen candidate at 0.152.1 and exercise the two shared assertion callers. The supplied PR body also records a before/after Docker run, though it was not rerun during this read-only review.

Is this the best way to solve the issue?

Yes. The candidate manifest is the correct expected-version owner for frozen validation, and the patch preserves the independent installed-artifact checks rather than weakening them.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 51becd0cfe8c.

Labels

Label changes:

  • add P2: This repairs frozen-release validation for operators without changing runtime behavior, user configuration, or published dependency versions.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored release-tooling PR is exempt from the contributor proof gate; its supplied before/after Docker evidence nevertheless exercises the changed candidate-to-installed-package assertion path.

Label justifications:

  • P2: This repairs frozen-release validation for operators without changing runtime behavior, user configuration, or published dependency versions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored release-tooling PR is exempt from the contributor proof gate; its supplied before/after Docker evidence nevertheless exercises the changed candidate-to-installed-package assertion path.

Evidence

What I checked:

  • Current-main failure source: Current main still defines the expected Codex version as 0.153.0 in the shared assertion, which cannot validate a self-consistent frozen candidate pinned to an earlier release. (scripts/e2e/lib/codex-release-package-assertions.mjs:7, 51becd0cfe8c)
  • Candidate-owned contract: The branch reads the separately mounted candidate manifest, requires an exact pin, and compares the installed plugin dependency, resolved package, platform alias, and CLI output to that one value. (scripts/e2e/lib/codex-release-package-assertions.mjs:28, 20575e3db159)
  • Both release entrypoints: The on-demand lane mounts the candidate manifest read-only, while the npm-live lane already separates trusted harness and candidate roots; the shared harness runner forwards explicit Docker arguments. (scripts/e2e/codex-on-demand-docker.sh:70, 20575e3db159)
  • Focused regression coverage: Table-driven cases exercise both assertion callers for a candidate/plugin pin mismatch, and invalid candidate pin cases remain rejected. (test/scripts/codex-install-assertions.test.ts:847, 20575e3db159)
  • Introduced-delta provenance: The reviewed head has the pinned base as its raw recorded parent, and its introduced diff replaces the fixed expected version with candidate metadata across the shared assertion and both lane mounts. (scripts/e2e/lib/codex-release-package-assertions.mjs:29, 20575e3db159)
  • Codex package boundary: The directly inspected Codex package identifies openai/codex as its repository and exposes the Codex executable through bin/codex.js; its wrapper maps supported platform packages before running the native executable. This PR only checks package/version consistency and does not alter Codex protocol behavior. (codex-cli/package.json:16, 41e22fee981a)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 377ea48 into main Sep 3, 2026
144 checks passed
@steipete
steipete deleted the fix/codex-release-package-contract-candidate-pin branch September 3, 2026 11:59
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 3, 2026
* commit '13b1f71c7010baaf2394555198e2fc04bef03586': (283 commits)
  fix(ui): retire stale MCP feedback across context changes (#128490)
  fix(agents): clarify set-identity workspace output (#126320)
  fix(auth): preserve OAuth metadata during session SDK refresh (#127988)
  fix(agents): recover catalog worker after generation mismatch (#127712)
  fix(memory-wiki): reject out-of-range claim confidence (#125656)
  ci: remove redundant contract runs and costly test work (#137220)
  fix(release): assert the Codex CLI pin the candidate declares (#137136)
  test(voice-call): reuse shared guards and deferred gates (#137262)
  fix(cron): isolate scheduler-disabled shared-store writes (#131733)
  fix(telegram): surface allowed custom reactions in react guidance (#129817)
  test(infra): reuse the shared npm call presence guard (#137254)
  fix: generated images disappear after failed tool calls (#131226)
  fix(docs): match source anchor checks to published sections (#137157)
  fix(backup): preserve audit capture across slow snapshots (#130962)
  fix(release): preserve legacy gh log reads (#137016)
  fix(memory-core): make forget rewrites atomic (#131383)
  fix(agents): write settings atomically (#131431)
  fix(plugins): keep the memory indexing runtime with the selected slot owner (#131779)
  fix(ci): pin iOS screenshot evidence to workflow revision (#136334)
  test(logging): remove redundant stderr spy casts (#137238)
  ...

# Conflicts:
#	scripts/e2e/lib/codex-release-package-assertions.mjs
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…aw#137136)

* fix(release): assert the Codex CLI pin the candidate declares

Trusted Docker assertions used main's Codex CLI pin for frozen release
packages, rejecting the self-consistent 2026.9.1 candidate after main
advanced from 0.152.1 to 0.153.0.

The candidate plugin manifest owns the expected version. Mount it separately
in both lanes and retain exact plugin dependency, installed package,
platform alias, and executable checks. Remove duplicate containment checks
and inline the one-use evidence writer; tooling is net -2 lines.

Proof: candidate fixtures reproduce the old version failure; 51 focused
Codex install/client-version tests pass, pnpm check:changed passes, and
independent P0-P2 autoreview reports no actionable findings.

* test(release): prove invalid candidate Codex pins

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants