fix(server): update Codex through its CLI - #4857
Conversation
|
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:
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aa7c432. Configure here.
ApprovabilityVerdict: Needs human review This PR changes the Codex provider update mechanism from package managers to CLI-based self-update with version gating (minimum 0.126.0). Since this fundamentally changes how provider updates are executed and introduces gating that affects user workflows, human review is recommended. You can customize Macroscope's approvability policy. Learn more. |

What Changed
updatecommand.Why
Support updating codex when installed with install.sh script.
Previously T3 would install an additional version of codex.
Versions before 0.126.0 do not support the update subcommand and may interpret
updateas an interactive prompt, so those versions remain manual-only.Verification:
Checklist
Note
Medium Risk
Changes provider update execution and RPC eligibility for Codex; incorrect version gating or env handling could block valid updates or run the wrong binary, but scope is limited to maintenance paths with added tests.
Overview
Codex maintenance no longer routes through package-manager global installs; it runs the configured Codex binary with
codex update, using the instance environment when spawning the update process.Provider maintenance now supports an optional minimum installed version for self-updates. Version advisories hide the one-click command and show manual-update guidance when the installed version is below that threshold (or not valid semver). The update RPC enforces the same rule via
canRunProviderMaintenanceUpdate, so clients cannot bypass the gate.Codex is wired with
updateMinimumVersion: "0.126.0"because older Codex builds do not support theupdatesubcommand reliably.Reviewed by Cursor Bugbot for commit 69fe610. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Codex self-update to enforce minimum version
0.126.0and pass through environmentmakeProviderMaintenanceCapabilitieswithpackageName '@openai/codex',updateArgs ['update'], andupdateMinimumVersion '0.126.0'.createProviderVersionAdvisoryin providerMaintenance.ts setscanUpdate=falseand suppresses the update command when the installed version is below the declared minimum or is not valid semver, instead showing a manual update message.updateProviderwithcanRunProviderMaintenanceUpdateand returns aServerProviderUpdateErrorwith reason'This installed provider version must be updated manually.'when the version check fails.update.envto the spawned process withextendEnv=trueso the provider environment is preserved during self-update.Macroscope summarized 69fe610.