Skip to content

fix(server): update Codex through its CLI - #4857

Open
EdwinMiranda2701 wants to merge 3 commits into
pingdotgg:mainfrom
EdwinMiranda2701:fix/codex-self-update
Open

fix(server): update Codex through its CLI#4857
EdwinMiranda2701 wants to merge 3 commits into
pingdotgg:mainfrom
EdwinMiranda2701:fix/codex-self-update

Conversation

@EdwinMiranda2701

@EdwinMiranda2701 EdwinMiranda2701 commented Jul 29, 2026

Copy link
Copy Markdown

What Changed

  • Use the configured Codex binary’s update command.
  • Limited one-click updates to Codex 0.126.0 (released April) and newer.
  • Older or unknown Codex versions now show manual-update guidance.
  • Added server-side enforcement so the update RPC cannot bypass the version requirement.

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 update as an interactive prompt, so those versions remain manual-only.

Verification:

  • 31 focused provider-maintenance tests pass.
  • Targeted lint passes.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes; screenshots are not applicable
  • No animation or interaction changes; video is not applicable

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 the update subcommand 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.0 and pass through environment

  • CodexDriver now declares self-update capabilities using makeProviderMaintenanceCapabilities with packageName '@openai/codex', updateArgs ['update'], and updateMinimumVersion '0.126.0'.
  • createProviderVersionAdvisory in providerMaintenance.ts sets canUpdate=false and suppresses the update command when the installed version is below the declared minimum or is not valid semver, instead showing a manual update message.
  • providerMaintenanceRunner.ts guards updateProvider with canRunProviderMaintenanceUpdate and returns a ServerProviderUpdateError with reason 'This installed provider version must be updated manually.' when the version check fails.
  • Update commands now forward update.env to the spawned process with extendEnv=true so the provider environment is preserved during self-update.
  • Behavioral Change: providers below their declared minimum version will no longer surface a one-click update command and will require a manual update.

Macroscope summarized 69fe610.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b0652f8a-ee6d-4e1f-8fac-07aeddcde4d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 29, 2026
Comment thread apps/server/src/provider/Drivers/CodexDriver.ts
Comment thread apps/server/src/provider/providerMaintenanceRunner.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread apps/server/src/provider/Drivers/CodexDriver.ts
Comment thread apps/server/src/provider/providerMaintenance.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@EdwinMiranda2701 EdwinMiranda2701 changed the title Fix/codex self update fix(server): update Codex through its CLI Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant