From 599f23521f537f2d2d908f6c9a48f1b1eb04a211 Mon Sep 17 00:00:00 2001 From: john Date: Sun, 2 Aug 2026 20:40:37 +0800 Subject: [PATCH] fix(release): accept active launchctl state for portal tunnel preflight Tunnel agents can report spawn scheduled while the SSH forward is already healthy; treating that as failure caused successful releases to roll back. Co-authored-by: Cursor --- scripts/release-portal-runtime-prod.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/release-portal-runtime-prod.sh b/scripts/release-portal-runtime-prod.sh index be8da71..57a631b 100755 --- a/scripts/release-portal-runtime-prod.sh +++ b/scripts/release-portal-runtime-prod.sh @@ -618,9 +618,9 @@ EOF launchctl bootstrap "${LAUNCHD_GUI}" "${HOME}/Library/LaunchAgents/${tunnel_label}.plist" >/dev/null 2>&1 || true launchctl enable "${LAUNCHD_GUI}/${tunnel_label}" >/dev/null 2>&1 || true launchctl kickstart -k "${LAUNCHD_GUI}/${tunnel_label}" >/dev/null 2>&1 || true - sleep 2 + sleep 5 - if ! launchctl print "${LAUNCHD_GUI}/${tunnel_label}" 2>/dev/null | grep -q 'state = running'; then + if ! launchctl print "${LAUNCHD_GUI}/${tunnel_label}" 2>/dev/null | grep -Eq 'state = (running|active)'; then echo "portal tunnel failed to start (${tunnel_label})" >&2 return 1 fi