Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): check Homebrew for provider updates on Homebrew installs #7731

Closedishaanko(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7731/headopened View on GitHub

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 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.ts 21/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 npm
  • providerMaintenanceRunner, makeManagedServerProvider, ProviderRegistry tests 61/61
  • tsgo --noEmit for 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 resolves 0.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.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 22d5767d12c4c44f94900c0af9a66bfd6b28dbf1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add Homebrew formula/cask version checks to resolveLatestProviderVersion

  • Homebrew-managed provider installs now resolve their latest version from formulae.brew.sh instead of npm. fetchHomebrewLatestVersion tries the cask endpoint first, then falls back to the formula endpoint, stripping build suffixes after a comma.
  • ProviderMaintenanceCapabilities gains a readonly homebrewFormula field (string or null) that records the formula/cask name for Homebrew-managed installs.
  • resolveLatestVersionSource picks 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 fetchJson helper centralizes HTTP GET, timeout, status check, and Schema decode logic; npm version lookup is refactored to use it with no behavior change.
  • Behavioral Change: resolveLatestProviderVersion now 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 22d5767.
    1. You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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: bd27c785-ca87-4a26-9557-29c05be999a1

      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.
    3. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    4. 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).
    5. Closing in favor of #6436, which includes Homebrew-specific version checks and keeps update advisories tied to the actual installer. Thanks for the fix!

    6. juliusmarminge closed this

Sign in to join this conversation.