fix(hooks): detect a pc installed from the retired Homebrew formula - #47
Open
mcdgavin wants to merge 1 commit into
Open
fix(hooks): detect a pc installed from the retired Homebrew formula#47mcdgavin wants to merge 1 commit into
mcdgavin wants to merge 1 commit into
Conversation
The session-start hook decides whether the Pinecone CLI is installed with `command -v pc`. The Homebrew formula pinecone-io/tap/pinecone was disabled on 2026-03-30 when the CLI moved to a cask, but a pre-existing formula install keeps a working `pc`, so those users read as "installed" and the hook never tells them, or Claude, that the install is stranded. Their next `brew upgrade` fails on the disabled formula with no prior warning. Homebrew links a formula binary into Cellar/ and a cask binary into Caskroom/, so one `readlink` on the resolved `pc` path distinguishes them. When the target contains `Cellar/pinecone/`, the hook adds a note to the agent context (suggest migrating the next time the CLI comes up; do not interrupt the user) and a one-line heads-up to the user message. A manual install is not a symlink, prints nothing, and is treated as fine. No new dependencies: readlink is in POSIX and already assumed by Homebrew.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
hooks/pinecone-api-key-check.shdecides whether the Pinecone CLI is installed withcommand -v pc. The Homebrew formulapinecone-io/tap/pineconewas disabled on 2026-03-30 when the CLI moved to a cask, but a formula installed before then keeps a workingpc. Those users read as "installed" every session, so neither they nor Claude hear that the install is stranded, and their nextbrew upgradefails on the disabled formula with no warning from the plugin.This is the gap noted as a follow-up in #46, which fixes the install string itself. The two PRs are independent and touch different hunks of the hook.
Fix
Homebrew links a formula binary into
Cellar/and a cask binary intoCaskroom/, so onereadlinkon the resolvedpcpath tells them apart:When a formula install is detected:
brew uninstall pinecone-io/tap/pinecone && brew install --cask pinecone-io/tap/pinecone.A manual install is not a symlink,
readlinkprints nothing, and it is treated as a normal install. No new dependencies;readlinkis POSIX and Homebrew already assumes it.Verification
The disabled formula cannot be installed any more, so the formula case is simulated with a temp prefix laid out the way Homebrew does it:
prefix/bin/pc -> ../Cellar/pinecone/0.3.1/bin/pc, with the fixture first on PATH.installed =pcpcon macOS, Homebrew 6.0.22 (/opt/homebrew/Caskroom/pinecone/1.0.1/pc)pcon PATHbash -npasses. Output for the cask and absent cases is byte-identical to before.