Skip to content

fix(doctor): correct Amp brew package and register missing brew/npm channels#763

Merged
matt2e merged 1 commit into
mainfrom
better-doctor-amp-package
Jun 4, 2026
Merged

fix(doctor): correct Amp brew package and register missing brew/npm channels#763
matt2e merged 1 commit into
mainfrom
better-doctor-amp-package

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Jun 4, 2026

Summary

Follow-up to #762. Four install-channel bugs in PACKAGE_IDS of the same class as the recent Claude-Code brew miss:

  1. Amp brew was amp — homebrew-core's amp is an unrelated GPL-3.0 terminal text editor by Jordan MacDonald. A brew-installed Sourcegraph Amp would resolve to that, and 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 brew cask missing. Added (Brew, "cursor-cli", Brew, Any) so brew-installed Cursor users (brew install --cask cursor-cli) get an Update affordance.
  3. Copilot brew cask missing. Added (Brew, "copilot-cli", Brew, Any) — GitHub's official brew distribution (announced 2026-01-14).
  4. Codex npm main missing. OpenAI publishes Codex via npm at @openai/codex. An npm-installed Codex was resolving to None with 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.

Tests added in package_ids::tests covering 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_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.

Test plan

  • cargo test -p doctor package_ids passes
  • Manual: brew-installed Amp/Cursor/Copilot and npm-installed Codex each surface an Update affordance pointing at the correct package

…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>
@matt2e matt2e requested review from baxen and wesbillman as code owners June 4, 2026 08:09
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +180 to +182
InstallSource::Brew,
"copilot-cli",
LatestSource::Brew,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@matt2e matt2e merged commit 0198cb4 into main Jun 4, 2026
7 checks passed
@matt2e matt2e deleted the better-doctor-amp-package branch June 4, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant