Uh oh!
There was an error while loading. Please reload this page.
fix(server): upgrade the actually-installed Homebrew formula - #6247
fix(server): upgrade the actually-installed Homebrew formula#6247rohitashwin wants to merge 2 commits into
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 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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 805e2f1a99130dbb2f22adbd7117e6ce7fe3b3bb. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review This bug fix modifies which formula name is passed to You can customize Macroscope's approvability policy. Learn more. |
rohitashwin
commented
Aug 12, 2026
Good catch — that was a real regression, not a hypothetical. Homebrew's Cellar path is keyed by the formula's bare name only ( Pushed a fix: the extracted formula only overrides the configured |
Provider auto-update hardcoded each driver's default Homebrew formula name (e.g. "claude-code"), so `brew upgrade <formula>` silently no-ops for anyone who installed a differently-named formula or cask, such as `claude-code@latest`. Now the resolver extracts the real formula name from the resolved Cellar/Caskroom path and upgrades that instead. Fixespingdotgg#6245 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Homebrew Cellar/Caskroom paths are keyed by the formula's bare name
only ("rack = HOMEBREW_CELLAR/name"), so a tap-qualified formula like
"anomalyco/tap/opencode" can never be recovered from the install path.
Only override the configured formula with the extracted one when the
extracted name actually diverges from the configured formula's
basename, so tapped formulas keep their tap qualifier and bare-name
formulas still pick up divergent installs like "claude-code@latest".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>8502e57 to
d71fabdComparejuliusmarminge
commented
Sep 1, 2026
Closing in favor of #6436, which includes the installed Homebrew formula fix, preserves tap-qualified names, and handles cask upgrades. Keeping provider-update review there. Thanks for the fix and follow-up regression coverage. |

Problem
Auto updating provider in T3 Code Desktop for macOS (e.g.,
claude-code) would fail becauseclaude-codewas installed using homebrew using the commandbrew install claude-code@latestrather thanbrew install claude-code. T3 Code would try to runbrew upgrade claude-codewhich fails. The correct approach is to find the right install variant ofclaude-codeactually installed on the machine. This PR does that and automatically callsbrew install claude-code@latest.What Changed
Provider auto-update no longer relies solely on each driver's hardcoded default Homebrew formula name.
resolvePackageManagedProviderMaintenancenow extracts the actual installed formula name from the resolved Homebrew Cellar/Caskroom path (e.g..../Caskroom/claude-code@latest/2.1.228/claude) and runsbrew upgradeagainst that formula, falling back to the driver's default when the path can't be parsed.Why
ClaudeDriver.tshardcodeshomebrewFormula: "claude-code". Anyone who installed viabrew install claude-code@latest(a different formula from plainclaude-code) getsbrew upgrade claude-codefrom the in-app update control, which fails loudly:Fixes#6245
UI Changes
None.
Checklist
Test plan
pnpm exec vitest run src/provider/providerMaintenance.test.ts— 18/18 pass, including a new case covering a Homebrew install under a different formula name than the driver's defaultclaudeinstall (/opt/homebrew/bin/claude→/opt/homebrew/Caskroom/claude-code@latest/2.1.228/claude): resolver now producesbrew upgrade claude-code@latestinstead of the failingbrew upgrade claude-codeNote
Low Risk
Localized change to provider maintenance command resolution with new unit tests; no auth or data-path impact.
Overview
Provider auto-update now builds
brew upgradefrom the formula name on disk, not only each driver’s defaulthomebrewFormula.When a binary resolves through Homebrew, the resolver parses the installed formula from Cellar/Caskroom paths (e.g.
package-tool@latestorclaude-code@latest) and passes it into Homebrew maintenance capabilities.resolveHomebrewFormulakeeps tap-qualified names likeexample/tap/scoped-package-toolwhen the path basename matches the definition; otherwise it uses the detected installed name. If nothing can be resolved, behavior still falls back to the definition default or manual-only updates.Tests cover tap-qualified formulas and variant formula names that differ from the driver default.
Reviewed by Cursor Bugbot for commit d71fabd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
[!NOTE]
Fix Homebrew upgrade to target the actually-installed formula instead of the definition default
extractHomebrewFormulaFromPathto detect the installed Homebrew formula from a binary's Cellar/Caskroom path, andresolveHomebrewFormulato pick between the installed and definition formulas, preferring the tap-qualified definition name when basenames match.makeHomebrewProviderMaintenanceCapabilitiesto accept an optional installed formula and use the resolved formula in thebrew upgradecommand, falling back to manual-only capabilities when no formula is available.resolvePackageManagedProviderMaintenanceto extract the installed formula from command paths and pass it into the capabilities factory.brew upgradecommands now target the detected installed formula (e.g.package-tool@latest) rather than the static definition formula when they differ.Macroscope summarized d71fabd.