Skip to content

The agent that grows with you

fix(cron): W2 keep custom homes on standalone guidance

yoniebansa027b924a864
diff --git a/hermes_cli/cron.py b/hermes_cli/cron.py
index 2becfef2cb9..fed2d60abb0 100644
--- a/hermes_cli/cron.py
+++ b/hermes_cli/cron.py
@@ -457,7 +457,7 @@ def cron_status():
" hermes gateway install # Install as a user service\n"
" sudo hermes gateway install --system # Linux servers: boot-time system service\n"
" hermes gateway run # Or run in foreground")
- if active != "default":
+ if active not in ("default", "custom"):
print("\n Alternatives for this named profile:\n"
" Keep the Desktop app open with this profile included in its scheduler and the machine awake, or\n"
" configure a running default gateway to tick this profile:\n"
diff --git a/tests/hermes_cli/test_cron_satellite_diagnostics.py b/tests/hermes_cli/test_cron_satellite_diagnostics.py
index a2985c091a7..9a55f231429 100644
--- a/tests/hermes_cli/test_cron_satellite_diagnostics.py
+++ b/tests/hermes_cli/test_cron_satellite_diagnostics.py
@@ -17,6 +17,8 @@ def profile(tmp_path, monkeypatch):
monkeypatch.setenv("HERMES_PROFILE", "probe")
monkeypatch.delenv("GATEWAY_MULTIPLEX_PROFILES", raising=False)
monkeypatch.setattr("hermes_constants.get_default_hermes_root", lambda: root)
+ monkeypatch.setattr("hermes_cli.profiles._get_default_hermes_home", lambda: root)
+ monkeypatch.setattr("hermes_cli.profiles._get_profiles_root", lambda: root / "profiles")
monkeypatch.setattr(jobs, "CRON_DIR", home / "cron")
monkeypatch.setattr(jobs, "JOBS_FILE", home / "cron/jobs.json")
monkeypatch.setattr(jobs, "OUTPUT_DIR", home / "cron/output")
@@ -73,6 +75,22 @@ def test_status_preserves_profile_health_contract(profile, capsys, monkeypatch,
assert "STALLED" not in output
[email protected]("home_kind", ["default", "custom", "named"])
+def test_standalone_guidance_matches_profile_membership(profile, monkeypatch, capsys, home_kind):
+ from hermes_cli.cron import cron_status
+
+ homes = {"default": profile, "custom": profile.parent / "custom", "named": profile / "profiles/probe"}
+ home = homes[home_kind]
+ home.mkdir(exist_ok=True)
+ monkeypatch.setenv("HERMES_HOME", str(home))
+ monkeypatch.delenv("HERMES_PROFILE")
+ monkeypatch.setattr("gateway.status.is_gateway_runtime_lock_active", lambda lock_path=None: False)
+ cron_status()
+ output = capsys.readouterr().out
+ assert "hermes gateway install" in output
+ assert ("hermes --profile default gateway restart" in output) == (home_kind == "named")
+
+
@pytest.mark.parametrize("dispatch", ["catch_up", "late", "forward_error"])
def test_doctor_reports_persisted_dispatch_health(profile, capsys, dispatch):
from cron import jobs