Skip to content

The agent that grows with you

fix(cron): point satellite recovery hints at the scheduler host

yoniebans9f2b05bb8e32
diff --git a/hermes_cli/cron.py b/hermes_cli/cron.py
index cc3d293e365..5b9d6927884 100644
--- a/hermes_cli/cron.py
+++ b/hermes_cli/cron.py
@@ -351,7 +351,7 @@ _FD_EXHAUSTION_HINT = (" Hint: the ticker hit file-descriptor exhaustion (EMFIL
"persists, restart the gateway to recover scheduling.")
-def _print_ticker_health(pids: list) -> None:
+def _print_ticker_health(pids: list, restart_command: str = "hermes gateway restart") -> None:
"""Report builtin-ticker liveness for a gateway process known to be alive.
The ticker THREAD can die silently or stay alive while every tick fails, so check both
@@ -377,11 +377,11 @@ def _print_ticker_health(pids: list) -> None:
_warn("⚠ Gateway is running but the cron ticker has not reported a heartbeat.")
print(" Cron jobs will NOT fire until the ticker writes its first heartbeat.\n"
" If the gateway just started, wait ~60s and re-run `hermes cron status`.\n"
- " If heartbeat never appears, restart: hermes gateway restart")
+ f" If heartbeat never appears, restart: {restart_command}")
elif hb_age > STALE_AFTER: # ticker thread is gone
_warn("⚠ Gateway is running but the cron ticker looks STALLED — "
f"no heartbeat for {int(hb_age)}s (expected every ~60s).")
- print(" Cron jobs may NOT be firing. Restart: hermes gateway restart")
+ print(f" Cron jobs may NOT be firing. Restart: {restart_command}")
elif ok_age is not None and ok_age > STALE_AFTER: # loop alive but every tick fails
_warn("⚠ Gateway and cron ticker are running, but no tick has "
f"succeeded in {int(ok_age)}s — ticks may be failing.")
@@ -448,7 +448,9 @@ def cron_status():
if pids or gateway_alive_via_lock or served_by_multiplexer:
if served_by_multiplexer:
print(" Scheduler host: default-profile multiplexer")
- _print_ticker_health(pids)
+ _print_ticker_health(pids, restart_command="hermes --profile default gateway restart")
+ else:
+ _print_ticker_health(pids)
else:
print(color("✗ Gateway is not running — cron jobs will NOT fire", Colors.RED))
# Desktop scheduling requires an open app and an awake machine.
diff --git a/tests/hermes_cli/test_cron_satellite_diagnostics.py b/tests/hermes_cli/test_cron_satellite_diagnostics.py
index 3c34c268f1e..d75b259984f 100644
--- a/tests/hermes_cli/test_cron_satellite_diagnostics.py
+++ b/tests/hermes_cli/test_cron_satellite_diagnostics.py
@@ -49,6 +49,8 @@ def test_status_preserves_profile_health_contract(profile, capsys, monkeypatch,
output = capsys.readouterr().out
assert ("Scheduler host: default-profile multiplexer" in output) == (mode in {"missing", "fresh", "stale"})
assert ("will fire automatically" in output) == (mode in {"fresh", "local"})
+ if mode in {"missing", "stale"}:
+ assert "hermes --profile default gateway restart" in output
if mode == "missing":
assert "has not reported a heartbeat" in output
if mode == "stale":