-
Notifications
You must be signed in to change notification settings - Fork 261
fix(cli): stop reporting "up to date" when the Homebrew update check fails #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
groksrc
wants to merge
3
commits into
main
Choose a base branch
from
fix/1297-brew-update-false-uptodate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
brew outdatedfails while PyPI has published a newer release but the Homebrew tap has not caught up, this fallback setsupdate_available=Trueand the normal periodic/MCP path proceeds tobrew upgradeeven though that version is unavailable through Homebrew. This window is explicitly possible because.github/workflows/release.ymlpublishes to PyPI in thereleasejob before the dependent Homebrew formula job runs; a Homebrew-check failure during that window therefore causes a misleading availability result and a spurious automatic upgrade attempt. Preserve an unanswered/failed Homebrew outcome, or prevent automatic installation when availability was inferred only from PyPI.AGENTS.md reference: AGENTS.md:L146-L148
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — confirmed and fixed in 2f3aa9b.
Verified both halves of the claim before acting:
release.yml: thehomebrewjob declaresneeds: release, andreleasepublishes to PyPI. So the window where PyPI leads the tap is real, not theoretical.check_onlyorsource == UNKNOWN, the function does fall through to--- Automatic install ---and runbrew upgrade.There is a second reason the old behaviour was wrong, beyond the release window: whatever prevented
brew outdatedfrom answering (untrusted tap, brew missing) also blocksbrew upgrade, so the auto-install was doomed regardless of tap lag. The new regression test demonstrates exactly that — without the fix it does not merely mis-report, it returnsFAILEDbecause the upgrade actually ran and errored.The fix keeps the asymmetry rather than dropping the fallback: PyPI stays authoritative for the negative answer, since the tap can only lag PyPI and never lead it, so "nothing newer exists" is still sound. Only the positive answer is unsafe to act on. When availability was inferred from PyPI because brew could not answer, the result is now
UPDATE_AVAILABLEwithupdated=False, surfacing the brew failure reason plus thebrew upgradehint, and no subprocess is launched.Two tests added: one asserting no
["brew", "upgrade", ...]call on that path, one pinning the negative-answer behaviour so a future change does not "fix" the asymmetry away.On retry/backoff, which was also suggested: deliberately not doing it. The dominant failure modes here are persistent, not transient — an untrusted tap is a policy gate and a missing brew will not heal on a second attempt — so backoff would add latency to an interactive command and to the silent MCP path while only reducing how often the fallback is reached, not making it correct.