From 400e87c937f31db8ec5f51b2fdf6a00a721f5241 Mon Sep 17 00:00:00 2001 From: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com> Date: Tue, 23 Jun 2026 01:37:08 -0600 Subject: [PATCH] fix: align launchd polling with exit timeout --- src/daemon/launchd.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon/launchd.ts b/src/daemon/launchd.ts index 7922cca64601..0745c919b949 100644 --- a/src/daemon/launchd.ts +++ b/src/daemon/launchd.ts @@ -23,6 +23,7 @@ import { execFileUtf8 } from "./exec-file.js"; import { isCurrentProcessLaunchdServiceLabel } from "./launchd-current-service.js"; import { buildLaunchAgentPlist as buildLaunchAgentPlistImpl, + LAUNCH_AGENT_EXIT_TIMEOUT_SECONDS, readLaunchAgentProgramArgumentsFromFile, } from "./launchd-plist.js"; import { scheduleDetachedLaunchdRestartHandoff } from "./launchd-restart-handoff.js"; @@ -50,7 +51,7 @@ const LAUNCH_AGENT_ENV_DIR_NAME = "service-env"; const LAUNCH_AGENT_STDERR_PATH = "/dev/null"; const OPENCLAW_UPDATE_LAUNCHD_LABEL_PREFIX = "ai.openclaw.update."; const OPENCLAW_MANUAL_UPDATE_LAUNCHD_LABEL_PATTERN = /^ai\.openclaw\.manual-update\.\d+$/; -const LAUNCH_AGENT_STOP_PORT_RELEASE_TIMEOUT_MS = 2_000; +const LAUNCH_AGENT_STOP_PORT_RELEASE_TIMEOUT_MS = LAUNCH_AGENT_EXIT_TIMEOUT_SECONDS * 1_000; const LAUNCH_AGENT_STOP_PORT_RELEASE_POLL_MS = 100; export type StaleOpenClawUpdateLaunchdJob = {