From 91db7c72a18b86c48a734918e35ae702760449e0 Mon Sep 17 00:00:00 2001 From: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:51:00 +0000 Subject: [PATCH] fix: surface load failure detail alongside GUI-session guidance When bootstrap fails with a GUI-domain error but launchctl load fails for a different reason (permissions, plist syntax), include both error details so users can diagnose the actual problem. --- src/daemon/launchd.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/daemon/launchd.ts b/src/daemon/launchd.ts index c85a4607a25..b2b7559560f 100644 --- a/src/daemon/launchd.ts +++ b/src/daemon/launchd.ts @@ -231,11 +231,12 @@ async function bootstrapLaunchAgentOrThrow(params: { return; } const loadDetail = (load.stderr || load.stdout).trim(); - // Only show GUI-session guidance when the failure is actually gui-domain related. - // For other load failures (e.g. plist syntax, permissions), surface the real error. + // Only show GUI-session guidance when the failure is actually gui-domain related + // and the load fallback didn't reveal a different, more actionable error. if (isUnsupportedGuiDomain(effectiveDetail)) { + const isLoadDifferentError = loadDetail && !isUnsupportedGuiDomain(loadDetail); throwBootstrapGuiSessionError({ - detail: effectiveDetail, + detail: isLoadDifferentError ? `${loadDetail} (bootstrap: ${effectiveDetail})` : effectiveDetail, domain: params.domain, actionHint: params.actionHint, });