fix(desktop): don't block onboarding on GitHub CLI auth
Why
Onboarding hard-blocked the Required GitHub CLI step for users who are actually authenticated. The device-login modal even reports Logged in as <user> / already logged in to this account, yet Continue stayed disabled.
Two contributing factors:
-
Detection false-negative.
detectGhCliran a blanketgh auth status, which (per gh's docs) exits non-zero if any account on any host has an issue. Power users with a stale secondary/enterprise account have a working active github.com login but a broken other account, so the check failed. -
Hard gate. The onboarding step disabled Continue until gh auth was detected, so any detection miss left users stuck with no way forward.
Changes
-
Fix detection (
system.ts): checkgh auth status --active --hostname github.comso only a broken active github.com account counts as unauthenticated.--activeexists only in gh >= 2.40 (the release that also introduced the multi-account "any host fails" behavior), so older gh falls back togh auth status --hostname github.com, which every version accepts and which still validates the token. -
Stop gating on it (
onboarding/layout.tsx): the GitHub CLI step no longer disables Continue. Users can proceed and sign in later; the row still shows accurate Connected/Required status via the corrected detection.
(Replaces an earlier disable-onboarding PostHog kill-switch approach — no flag needed.)
Testing
bun run lint✅bun run typecheck✅ (28/28)- gh auth behavior confirmed against gh 2.92.0:
--active --hostname github.comand the--hostname-only fallback both exit 0 for a valid login; unknown flags exit 1 (why old gh needs the fallback).
Note: the detection path only runs in the packaged Electron app, so end-to-end verification means running the desktop app.