Skip to content

The agent that grows with you

fix(gateway): a gateway that is shutting down never starts multiplexing

Teknium7cf686757440
diff --git a/gateway/run_profile_reconcile.py b/gateway/run_profile_reconcile.py
index 7af86f636d9..ec78d7d0ed6 100644
--- a/gateway/run_profile_reconcile.py
+++ b/gateway/run_profile_reconcile.py
@@ -348,6 +348,8 @@ class GatewayProfileReconcileMixin:
record_multiplex_decision, recorded_standalone_reason)
from hermes_cli.profiles import profiles_to_serve
from hermes_constants import get_default_hermes_root, get_process_hermes_home
+ if not self._running or getattr(self, "_draining", False):
+ return False # shutdown began: never arm fail-closed secrets under drain-time work
if recorded_standalone_reason() not in (SINGLE_PROFILE_REASON, AUTO_MIGRATION_OPTED_OUT_REASON):
return False
launch = get_process_hermes_home().resolve()