The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(gateway): s6 slot and multiplexer guards key on the profile id, not the host service suffix
Teknium1fc033a8ef04
diff --git a/hermes_cli/gateway.py b/hermes_cli/gateway.pyindex 782fc18fea3..a86b4078c8a 100644--- a/hermes_cli/gateway.py+++ b/hermes_cli/gateway.py@@ -1385,7 +1385,7 @@ def _s6_gateway_snapshot(gateway_pids: tuple[int, ...]) -> GatewayRuntimeSnapshofrom hermes_cli.service_manager import detect_service_manager, get_service_managerif detect_service_manager() != "s6":return None- service_name = f"gateway-{_profile_suffix() or 'default'}"+ service_name = f"gateway-{_current_profile_name()}"mgr = get_service_manager()service_installed = service_running = Falsetry:@@ -1966,6 +1966,14 @@ def _profile_suffix() -> str:return name or hashlib.sha256(str(home).encode()).hexdigest()[:8]+def _current_profile_name() -> str:+ """Profile id relative to the profile ROOT: ``default`` for the root itself (Docker's ``/opt/data``+ included), ``<name>`` for ``<root>/profiles/<name>``, else the service hash. s6 slots and the+ multiplexer ask which PROFILE this is; ``_profile_suffix()`` answers which HOST SERVICE this is."""+ from hermes_constants import profile_name_for_home+ return profile_name_for_home(get_hermes_home()) or _profile_suffix()++def _profile_arg(hermes_home: str | None = None, default_root: str | Path | None = None) -> str:"""``--profile <name>`` for ``<root>/profiles/<name>``, else "". *hermes_home*/*default_root* let asudo/root process generate a unit for another user (the defaults would refer to root)."""@@ -4282,7 +4290,7 @@ def named_profile_served_by_running_multiplexer(profile_name: str | None = None)See #97120."""try:- suffix = profile_name if profile_name is not None else _profile_suffix()+ suffix = profile_name if profile_name is not None else _current_profile_name()except Exception:return Falseif not suffix or suffix == "default":@@ -4339,7 +4347,7 @@ def _guard_named_profile_under_multiplexer(force: bool = False) -> None:if force:returntry:- suffix = _profile_suffix()+ suffix = _current_profile_name()except Exception:returnif not named_profile_served_by_running_multiplexer():@@ -5688,8 +5696,7 @@ def _dispatch_via_service_manager_if_s6(action: str, profile: str | None = None)if detect_service_manager() != "s6":return Falseif profile is None:- # _profile_suffix() is "" for the default root; the default gateway is gateway-default.- profile = _profile_suffix() or "default"+ profile = _current_profile_name() # root home (Docker /opt/data included) is gateway-defaultmgr = get_service_manager()if action not in ("start", "stop", "restart"):return False