Summary
When the gateway shuts down or restarts (e.g. due to rolling updates in Kubernetes), it sends a notification to all active sessions:
⚠️ Gateway restarting — Your current task will be interrupted. Send any message after restart and I'll try to resume where you left off.
In a multi-bot deployment (13 bots), routine operations like patching a shared Secret trigger Reloader-based rolling restarts across all Deployments. This results in every bot sending shutdown notifications to their active chats, which is noisy and confusing to users — especially when the restart is expected and brief.
Current behavior
_notify_active_sessions_of_shutdown() in gateway/run.py is called unconditionally during stop(). There is no configuration option to disable or suppress these notifications.
Proposed solution
Add a config option under agent: to control this behavior, e.g.:
agent:
shutdown_notify: false # default: true
When set to false, the gateway would skip sending shutdown/restart messages to active sessions but still perform the normal drain and interrupt flow.
Alternatively, a more granular approach:
shutdown_notify: "active_only" — only notify sessions with a currently running agent (current behavior)
shutdown_notify: "none" — suppress all notifications
shutdown_notify: "all" — notify all recent sessions (including idle ones)
Environment
- Hermes Agent v2026.5.7
- 13 bots on K3s cluster
- Reloader watches shared Secrets → triggers rolling restarts
- Relevant code:
gateway/run.py line ~2476 (_notify_active_sessions_of_shutdown)
Summary
When the gateway shuts down or restarts (e.g. due to rolling updates in Kubernetes), it sends a notification to all active sessions:
In a multi-bot deployment (13 bots), routine operations like patching a shared Secret trigger Reloader-based rolling restarts across all Deployments. This results in every bot sending shutdown notifications to their active chats, which is noisy and confusing to users — especially when the restart is expected and brief.
Current behavior
_notify_active_sessions_of_shutdown()ingateway/run.pyis called unconditionally duringstop(). There is no configuration option to disable or suppress these notifications.Proposed solution
Add a config option under
agent:to control this behavior, e.g.:When set to
false, the gateway would skip sending shutdown/restart messages to active sessions but still perform the normal drain and interrupt flow.Alternatively, a more granular approach:
shutdown_notify: "active_only"— only notify sessions with a currently running agent (current behavior)shutdown_notify: "none"— suppress all notificationsshutdown_notify: "all"— notify all recent sessions (including idle ones)Environment
gateway/run.pyline ~2476 (_notify_active_sessions_of_shutdown)