fix(gateway): use kickstart -k for atomic launchd restart

Replace the two-step stop/start restart with a single
launchctl kickstart -k call. When the gateway triggers a
restart from inside its own process tree, the old stop
command kills the shell before the start half is reached.
kickstart -k lets launchd handle the kill+restart atomically.
This commit is contained in:
Trevin Chow 2026-04-04 21:00:19 -07:00 committed by Teknium
parent aab74b582c
commit 74ff62f5ac
2 changed files with 14 additions and 5 deletions

View file

@ -297,7 +297,7 @@ class TestGatewaySystemServiceRouting:
gateway_cli,
"launchd_restart",
lambda: (_ for _ in ()).throw(
gateway_cli.subprocess.CalledProcessError(5, ["launchctl", "start", "ai.hermes.gateway"])
gateway_cli.subprocess.CalledProcessError(5, ["launchctl", "kickstart", "-k", "gui/501/ai.hermes.gateway"])
),
)