Uh oh!
There was an error while loading. Please reload this page.
Use the native Codex update command for supported versions - #4065
Use the native Codex update command for supported versions#4065Destreyf wants to merge 4 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review This PR introduces version-gated maintenance capabilities that change how Codex updates are executed based on installed version. It adds new selection logic, interface changes (sync to Effect-based), and environment handling - significant runtime behavior changes that warrant human review. You can customize Macroscope's approvability policy. Learn more. |
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
NicL9923
left a comment
There was a problem hiding this comment.
Three install-context and update-coordination issues below. The capability/snapshot state plumbing and validation otherwise look solid.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Dropje97
commented
Sep 1, 2026
Just added a second, independent reproduction of the underlying bug in #5629 — same standalone-installer layout, but with npm's global prefix set to Mentioning it here mostly as a data point that the @Destreyf — this is currently conflicting against |
90b261b to
e0ae1d7CompareDestreyf
commented
Sep 1, 2026
@Dropje97 should be rebased appropriately now. |
Tested Before this PR the advisory resolves to the npm command, which exits 1 on this machine — my npm global prefix is "status": "behind_latest", "currentVersion": "0.151.0", "latestVersion": "0.152.0",
"updateCommand": "npm install -g --allow-scripts=@openai/codex @openai/codex@latest"With this PR, driving the real resolution code against my actual filesystem and the running server's PATH: The version gate lets 0.151.0 through, the standalone Test runs on the rebased branch: Two minor observations, neither a blocker:
Update — the native command was run end to end, and it works. I ran it exactly as the runner would spawn it: Post-conditions checked:
That last point is the whole difference. Upstream's own install-context detection correctly identified the standalone layout and updated in place, where the legacy npm path either aborts with So on this configuration the PR takes the provider from "update is impossible from the UI" to "update succeeds", verified end to end. |
What Changed
["update"]arguments when the installed version is valid semver and >= 0.128.0 and the installation is npm-, Bun-, Homebrew-, or standalone-managed. Default installations continue to executecodex update, while custom names and absolute paths update the same executable that was probed.versionAdvisory.updateCommand,canUpdate, and runner execution stay aligned.Why
Codex added its native
codex updatecommand in openai/codex@b985768. It first appeared in0.126.0-alpha.9, but0.128.0was the first stable npm release containing it, so this uses0.128.0as the conservative capability boundary.Supported modern Codex installations can therefore perform their own installation-method detection instead of relying on T3 Code to invoke a package manager. Older or indeterminate installations, plus pnpm and Vite+ installations not currently supported by the native detector, continue using the existing behavior. Other provider drivers are unchanged.
Fixes#4066.
Related: #2765 covers Windows-specific child-process/PATH failures when spawning package-manager update commands. This PR may avoid that path for supported modern Codex installations, but it does not replace the Windows-specific fix.
Testing
vp check— passed with 9 existing unrelated web lint warningsvp run typecheck— passedChecklist
Note
Use native
codex updatecommand for Codex versions >= 0.128.0codexMaintenance.ts: versions >= 0.128.0 use the nativecodex updatecommand; older versions retain legacy package-manager (pnpm/vp) updates.makeCodexMaintenanceEnvironmentto setCODEX_HOMEbased on whether the executable is from a shared standalone install or an instance-specific path.ServerProviderShape.maintenanceCapabilitiesfrom a synchronous property togetMaintenanceCapabilities, an Effect, allowing capabilities to update when the probed version changes.ProviderMaintenanceCommandActionwith an optionalenvfield;ProviderMaintenanceRunnernow passes this env (e.g.CODEX_HOME) to spawned update processes.parseSemverin bothshared/src/semver.tsandproviderMaintenance.tsto strip build metadata before parsing numeric segments.ServerProviderShapemust now callgetMaintenanceCapabilitiesas an Effect instead of reading a direct property.Macroscope summarized 90b261b.
Note
Medium Risk
Changes provider self-update execution (spawn env, version-gated commands) and makes maintenance capabilities async per snapshot; mistakes could run wrong update commands or misreport update availability for Codex.
Overview
Codex provider updates now prefer the probed executable’s native
codex updateflow when the installed version is valid semver and ≥ 0.128.0; older, missing, or malformed versions keep the existing package-manager path detection (with pnpm and vp always on legacy commands).Maintenance capabilities are tied to the live snapshot:
ServerProviderShapeexposesgetMaintenanceCapabilitiesas an Effect instead of a fixed field, andmakeManagedServerProvidercanresolveMaintenanceCapabilitiesafter each probe so version advisories,canUpdate, and the update runner use the same command. Codex wires this through newcodexMaintenancehelpers (version gate, optional updateenvincludingCODEX_HOMEfor standalone installs) andresolveProviderMaintenanceCapabilitiesWithPathsEffectfor resolved binary paths.The maintenance runner forwards optional
envinto child-process spawn; shared semver gainsisValidSemverVersionand build-metadata stripping inparseSemver.Reviewed by Cursor Bugbot for commit e0ae1d7. Bugbot is set up for automated code reviews on this repo. Configure here.