Problem#
Auto updating provider in T3 Code Desktop for macOS (e.g., claude-code) would fail because claude-code was installed using homebrew using the command brew install claude-code@latest rather than brew install claude-code. T3 Code would try to run brew upgrade claude-code which fails. The correct approach is to find the right install variant of claude-code actually installed on the machine. This PR does that and automatically calls brew install claude-code@latest.
What Changed#
Provider auto-update no longer relies solely on each driver's hardcoded default Homebrew formula name. resolvePackageManagedProviderMaintenance now extracts the actual installed formula name from the resolved Homebrew Cellar/Caskroom path (e.g. .../Caskroom/claude-code@latest/2.1.228/claude) and runs brew upgrade against that formula, falling back to the driver's default when the path can't be parsed.
Why#
ClaudeDriver.ts hardcodes homebrewFormula: "claude-code". Anyone who installed via brew install claude-code@latest (a different formula from plain claude-code) gets brew upgrade claude-code from the in-app update control, which fails loudly:
$ brew upgrade claude-code
==> Downloading Homebrew API data
Error: Cask 'claude-code' is not installed.
$ echo $?
1
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 default
- Verified against this machine's actual
claude install (/opt/homebrew/bin/claude → /opt/homebrew/Caskroom/claude-code@latest/2.1.228/claude): resolver now produces brew upgrade claude-code@latest instead of the failing brew upgrade claude-code
Note
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 upgrade from the formula name on disk, not only each driver’s default homebrewFormula.
When a binary resolves through Homebrew, the resolver parses the installed formula from Cellar/Caskroom paths (e.g. package-tool@latest or claude-code@latest) and passes it into Homebrew maintenance capabilities. resolveHomebrewFormula keeps tap-qualified names like example/tap/scoped-package-tool when 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](https://cursor.com/bugbot) for commit d71fabd03de595b059f3b79b9b8f2192871be775. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Note
[!NOTE]
Fix Homebrew upgrade to target the actually-installed formula instead of the definition default#
- Adds
extractHomebrewFormulaFromPath to detect the installed Homebrew formula from a binary's Cellar/Caskroom path, and resolveHomebrewFormula to pick between the installed and definition formulas, preferring the tap-qualified definition name when basenames match.
- Updates
makeHomebrewProviderMaintenanceCapabilities to accept an optional installed formula and use the resolved formula in the brew upgrade command, falling back to manual-only capabilities when no formula is available.
- Updates
resolvePackageManagedProviderMaintenance to extract the installed formula from command paths and pass it into the capabilities factory.
- Behavioral Change:
brew upgrade commands now target the detected installed formula (e.g. package-tool@latest) rather than the static definition formula when they differ.
Macroscope summarized d71fabd.
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:
855008a1-8a81-4736-a99c-51ad50c39789You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.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.
❤️ Share