Skip to content

The agent that grows with you

fix(gateway): exclude service-managed PIDs from orphan reaping

RelaxJonhac9b058ef4d3
diff --git a/hermes_cli/gateway.py b/hermes_cli/gateway.py
index 1bd6410c8a6..51334da1401 100644
--- a/hermes_cli/gateway.py
+++ b/hermes_cli/gateway.py
@@ -1565,6 +1565,11 @@ def _reap_unsupervised_gateway_orphans(extra_exclude: set | None = None) -> bool
own |= _get_service_pids()
except Exception:
pass
+ try:
+ # launchd/systemd-supervised gateways are not orphans — never reap them.
+ own |= _get_service_pids()
+ except Exception:
+ pass
try:
# find_gateway_pids() includes no-supervisor `gateway restart` runtimes
# for the current profile when no systemd supervisor is present.