fix(server): check Homebrew for provider updates on Homebrew installs #7731
main fromrefs/pull/7731/head·opened View on GitHubWhat 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 upgrade cannot clear it until the cask is bumped, so the nag never goes away.
ProviderMaintenanceCapabilities now carries homebrewFormula, set only when the install resolves through Homebrew. For those installs resolveLatestProviderVersion reads the latest version from formulae.brew.sh (cask first, then formula), which is the same JSON API brew installs from and therefore exactly what brew upgrade can 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.0 hit npm at 21:04Z while the cask is still at 0.148.0. The app asked for brew 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#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
- I included a video for animation/interaction changes
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 fmt- Live check through the new code against the real APIs: Homebrew-managed codex resolves
0.148.0(reads as current), npm-managed resolves0.149.0
Written by Claude Fable 5 via Claude Code.
Note
Medium Risk Changes provider update advisory logic and outbound HTTP (npm vs Homebrew APIs), which can affect when users see update prompts and what version is considered “latest” for Homebrew installs.
Overview
Fixes false “update available” advisories when a provider is installed via Homebrew but npm has already published a newer release. The advisory and brew upgrade now compare against the same source Homebrew can actually deliver.
ProviderMaintenanceCapabilities adds homebrewFormula for Homebrew-managed installs. resolveLatestProviderVersion picks the latest-version source via resolveLatestVersionSource: core formulas/casks (no / in the name) use formulae.brew.sh (cask API first, formula fallback, comma-stripped cask versions); third-party taps and npm/bun/pnpm/native installs still use npm. Version cache keys are split (homebrew:<name> vs npm package name). HTTP lookup is centralized in fetchJson.
Tests add Homebrew cask/formula/tap scenarios and expect homebrewFormula: null on non-Homebrew capability shapes.
Note
Add Homebrew formula/cask version checks to resolveLatestProviderVersion#
- Homebrew-managed provider installs now resolve their latest version from
formulae.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.- A shared
fetchJsonhelper centralizes HTTP GET, timeout, status check, and Schema decode logic; npm version lookup is refactored to use it with no behavior change. - Behavioral 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.
- 1
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
bd27c785-ca87-4a26-9557-29c05be999a1You can disable this status message by setting the
reviews.review_statustofalsein 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.
Comment `@coderabbitai help` to get the list of available commands.github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: 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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Closing in favor of #6436, which includes Homebrew-specific version checks and keeps update advisories tied to the actual installer. Thanks for the fix!
juliusmarminge closed this
Sign in to join this conversation.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.