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 = {