From 49558e4e959a35353db67c625a66c94ede637108 Mon Sep 17 00:00:00 2001 From: Vibe <291395314+vibecrypto@users.noreply.github.com> Date: Thu, 23 Jul 2026 10:33:57 +1200 Subject: [PATCH] fix(doctor): detect browsers installed via Nix, Home Manager, or PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #1496 (item 3). No behavior change on machines where the current candidate paths already match. --- LifeOS/install/LIFEOS/TOOLS/Doctor.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/LifeOS/install/LIFEOS/TOOLS/Doctor.ts b/LifeOS/install/LIFEOS/TOOLS/Doctor.ts index ae29aa60a1..5cc41973f4 100644 --- a/LifeOS/install/LIFEOS/TOOLS/Doctor.ts +++ b/LifeOS/install/LIFEOS/TOOLS/Doctor.ts @@ -119,13 +119,24 @@ function envKey(name: string): string | null { return null; } +function whichPath(bin: string): string | null { + const hit = (process.env.PATH || '').split(':').find(p => p && existsSync(join(p, bin))); + return hit ? join(hit, bin) : null; +} + function chromeBinary(): string | null { const candidates = [ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', + '/Applications/Nix Apps/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Brave Browser.app/Contents/MacOS/Brave Browser', + '/Applications/Nix Apps/Brave Browser.app/Contents/MacOS/Brave Browser', '/usr/bin/google-chrome', '/usr/bin/chromium', '/usr/bin/chromium-browser', ]; - return candidates.find(existsSync) || null; + // Nix/Home Manager installs expose the browser on PATH rather than in /Applications + return candidates.find(existsSync) + || whichPath('google-chrome') || whichPath('chromium') + || whichPath('brave') || whichPath('brave-browser') + || null; } // ── capability registry ──────────────────────────────────────────────────────