fix(server): check Homebrew for provider updates on Homebrew installs - #7731
fix(server): check Homebrew for provider updates on Homebrew installs#7731ishaanko wants to merge 2 commits into
Conversation
Provider update advisories compared the installed version against npm's latest for every install kind. A Homebrew-managed Codex or Claude is flagged as outdated the moment a release hits npm, and the offered `brew upgrade` cannot clear it until the cask catches up, so the nag never goes away. Homebrew-managed installs now resolve the latest version from formulae.brew.sh (cask first, then formula), which is what `brew upgrade` can actually deliver. Third-party taps keep npm since they have no public API. Everything else is unchanged.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
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 |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes runtime behavior by modifying how provider version checks work for Homebrew installs - introducing new HTTP calls to Homebrew's API (formulae.brew.sh) instead of npm. This behavioral change to the update-checking system warrants human review. You can add or adjust custom eligibility rules. Learn more. |
What Changed
Provider update advisories compared the installed version against npm's latest for every install kind. A Homebrew-managed Codex or Claude is flagged as outdated the moment a release hits npm, and the offered
brew upgradecannot clear it until the cask is bumped, so the nag never goes away.ProviderMaintenanceCapabilitiesnow carrieshomebrewFormula, set only when the install resolves through Homebrew. For those installsresolveLatestProviderVersionreads the latest version fromformulae.brew.sh(cask first, then formula), which is the same JSON APIbrewinstalls from and therefore exactly whatbrew upgradecan deliver. Cask build suffixes (1.2.3,4567) are stripped before the semver compare. Third-party taps (anomalyco/tap/opencode) have no public API and keep npm. npm, bun, pnpm, Vite+, and native installs are unchanged.Fixes #7730
Why
npm and the Homebrew cask publish at different times. Today
@openai/codex@0.149.0hit npm at 21:04Z while the cask is still at 0.148.0. The app asked forbrew upgrade codex, which had nothing to do, and kept showing "update available". Comparing against the source the update command actually pulls from makes the advisory and the button agree.UI Changes
None.
Checklist
Test plan
vp test run src/provider/providerMaintenance.test.ts21/21, with three new cases: Homebrew cask lookup (and build-suffix strip), formula fallback when the name is not a cask, third-party tap stays on npmproviderMaintenanceRunner,makeManagedServerProvider,ProviderRegistrytests 61/61tsgo --noEmitfor apps/server, targeted lint and fmt0.148.0(reads as current), npm-managed resolves0.149.0Written by Claude Fable 5 via Claude Code.
Note
Low Risk
Scoped to provider version-advisory HTTP lookups; no auth, install, or update-command execution changes. Failure still returns null and leaves the advisory unknown.
Overview
Stops Homebrew-managed providers from being flagged as outdated whenever npm publishes first. Latest-version checks now follow the same source as
brew upgrade.ProviderMaintenanceCapabilitiesnow carrieshomebrewFormula(set only for Homebrew-resolved installs).resolveLatestProviderVersionqueriesformulae.brew.sh(cask, then formula), strips cask build suffixes, and caches underhomebrew:<name>. Third-party taps still use npm because they are not on that API. npm/bun/pnpm/Vite+/native installs are unchanged.Reviewed by Cursor Bugbot for commit 4a2d57c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Homebrew formula/cask version checks to
resolveLatestProviderVersionformulae.brew.shinstead of npm.fetchHomebrewLatestVersiontries the cask endpoint first, then falls back to the formula endpoint, stripping build suffixes after a comma.ProviderMaintenanceCapabilitiesgains a readonlyhomebrewFormulafield (string or null) that records the formula/cask name for Homebrew-managed installs.resolveLatestVersionSourcepicks Homebrew for core formulas (no slash in the name), keeps npm for third-party taps and npm installs, and returns no source otherwise.fetchJsonhelper centralizes HTTP GET, timeout, status check, and Schema decode logic; npm version lookup is refactored to use it with no behavior change.resolveLatestProviderVersionnow uses separate cache keys (homebrew:<name>vs npm package name) and may return a version sourced from Homebrew rather than npm for Homebrew-managed installs.Macroscope summarized 4a2d57c.