fix(doctor): correct Amp brew package and register missing brew/npm channels#763
Conversation
…hannels Four install-channel bugs in PACKAGE_IDS of the same class as the recent Claude-Code brew miss (commit a23d4b2): users on unregistered channels got no Update affordance, and — in Amp's case — got an update command pointing at the wrong package entirely. 1. Amp brew was `amp` — but homebrew-core's `amp` is an unrelated GPL-3.0 terminal text editor by Jordan MacDonald. A brew-installed Sourcegraph Amp resolved (Brew, Main) -> "amp", so `brew upgrade amp` would silently swap in the text editor. Switched to `ampcode`, the formula name on the `ampcode/tap` tap. Critical safety fix. 2. Cursor was missing its brew cask. The official `cursor-cli` cask (`brew install --cask cursor-cli`) ships the headless `cursor-agent` binary; brew-installed users hit Unknown -> no Update. Added a `(Brew, "cursor-cli", Brew, Any)` entry alongside the existing CurlPipe/GitHubReleases entry. 3. Copilot was missing its brew cask. GitHub's `copilot-cli` cask is the official brew distribution (announced 2026-01-14). Added a `(Brew, "copilot-cli", Brew, Any)` entry alongside the existing npm entry. 4. Codex was missing its npm main package. OpenAI publishes Codex via npm at `@openai/codex` — historically primary, still actively promoted at developers.openai.com/codex/cli. An npm-installed Codex resolved (Npm, Main) -> None -> no Update affordance. Added the entry with a WARNING comment that the unscoped `codex` package on npm is an unrelated 2012 project; only the scoped form is OpenAI's. The role tag keeps it cleanly separated from the existing bridge (`@zed-industries/codex-acp`, Role::Bridge) on the same install source. Tests added in the existing `package_ids::tests` module covering all four lookups plus regression guards: the previously-resolving npm/curl entries for Cursor and Copilot must still resolve after the additions, and the Codex Npm/Bridge lookup must still pick `@zed-industries/codex-acp` (guards against the new Main entry shadowing the bridge). Out of scope (per audit, deferred): renaming `install_command` recipes in `agents.rs`, adding winget channels, Cursor auth subcommand renaming, switching `derive_update_command` to `brew upgrade --cask`, and the `getcursor/cursor` GitHub-releases slug. Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5b06dbf21
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| InstallSource::Brew, | ||
| "copilot-cli", | ||
| LatestSource::Brew, |
There was a problem hiding this comment.
Avoid offering a no-op update for Copilot cask
For a brew-installed Copilot CLI, this new entry makes freshness derive brew upgrade copilot-cli, but the current cask metadata marks copilot-cli with auto_updates: true (Homebrew API), and Homebrew documents --greedy-auto-updates as including auto_updates true casks that would otherwise be skipped (manpage). So when doctor detects a stale Copilot cask under default Homebrew settings, the displayed update command is likely to skip the cask instead of updating it; this entry should either not produce an actionable Brew update or derive a cask/greedy update command for this case.
Useful? React with 👍 / 👎.
Summary
Follow-up to #762. Four install-channel bugs in
PACKAGE_IDSof the same class as the recent Claude-Code brew miss:amp— homebrew-core'sampis an unrelated GPL-3.0 terminal text editor by Jordan MacDonald. A brew-installed Sourcegraph Amp would resolve to that, andbrew upgrade ampwould silently swap in the text editor. Switched toampcode(the formula name on theampcode/taptap). Critical safety fix.(Brew, "cursor-cli", Brew, Any)so brew-installed Cursor users (brew install --cask cursor-cli) get an Update affordance.(Brew, "copilot-cli", Brew, Any)— GitHub's official brew distribution (announced 2026-01-14).@openai/codex. An npm-installed Codex was resolving toNonewith no Update affordance. Added the entry with a WARNING comment that the unscopedcodexpackage on npm is an unrelated 2012 project — only the scoped form is OpenAI's.Tests added in
package_ids::testscovering all four lookups plus regression guards: the previously-resolving npm/curl entries for Cursor and Copilot must still resolve, and the Codex Npm/Bridge lookup must still pick@zed-industries/codex-acp(guards against the new Main entry shadowing the bridge).Out of scope (per audit, deferred): renaming
install_commandrecipes inagents.rs, adding winget channels, Cursor auth subcommand renaming, switchingderive_update_commandtobrew upgrade --cask, and thegetcursor/cursorGitHub-releases slug.Test plan
cargo test -p doctor package_idspasses