fix(doctor): detect browsers installed via Nix, Home Manager, or PATH#1567
Closed
vibecrypto wants to merge 1 commit into
Closed
fix(doctor): detect browsers installed via Nix, Home Manager, or PATH#1567vibecrypto wants to merge 1 commit into
vibecrypto wants to merge 1 commit into
Conversation
chromeBinary() only probed legacy install paths (/Applications and /usr/bin), so on machines where the browser is installed declaratively (nix-darwin / Home Manager), Doctor reported the Interceptor capability as 'broken — no Chrome/Brave/Chromium binary found' even though Chrome was installed and on PATH. Add the '/Applications/Nix Apps/' locations and fall back to a PATH lookup via the existing which() helper. The fallback includes 'brave-browser', which also fixes the Linux-Brave false negative reported in danielmiessler#1496 (item 3). No behavior change on machines where the current candidate paths already match.
Owner
|
Ported with credit. The |
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
Doctor.ts'schromeBinary()only probes legacy install locations:/Applications/Google Chrome.app//Applications/Brave Browser.app/usr/bin/google-chrome,/usr/bin/chromium,/usr/bin/chromium-browserOn machines where the browser is installed declaratively — nix-darwin / Home Manager put GUI apps under
/Applications/Nix Apps/and expose the binary on PATH (e.g./run/current-system/sw/bin/google-chrome) — none of these candidates exist, so Doctor reports:…even though Chrome is installed and fully working. The cached "broken" verdict (7-day TTL in
capabilities.json) then steers sessions into declaring Interceptor unusable and suggesting a redundant Chrome install.Fix
Two additions to
chromeBinary(), no behavior change on machines where the current paths already match:/Applications/Nix Apps/locations for Chrome and Brave to the candidate list.whichPath()helper (like the existingwhich(), but returning the resolved path — the probe's detail string doesbrowser.split('/'), so the fallback must yield a string, not a boolean). Coversgoogle-chrome,chromium,brave, andbrave-browser— the last also fixes the Linux-Brave false negative reported in Six bugs found during a fresh 7.1.1 install (TELOS parser, Doctor.ts, hook wiring, timezone default) #1496 (item 3), which was closed without the fix landing:/usr/binis on PATH, so the lookup finds/usr/bin/brave-browserwithout more hardcoded candidates.Testing
On a nix-darwin machine with Chrome installed via Home Manager (
/Applications/Nix Apps/Google Chrome.app, binary on PATH):✗ Browser verification (Interceptor) — broken — no Chrome/Brave/Chromium binary found✅ Browser verification (Interceptor) — live — skill present, browser found (Google Chrome)Unchanged on a machine with a standard
/Applications/Google Chrome.appinstall (first candidate still wins).