Feature Request: Add config option to suppress shutdown notifications when no active sessions exist
Problem
When the gateway shuts down (e.g. daily scheduled machine reboot via systemd), it unconditionally sends a "⚠️ Gateway shutting down — Your current task will be interrupted." message to all home channels, even when there are no active sessions running.
For users who schedule routine restarts (e.g. daily 4 AM reboot via cron/systemd timer), this results in a spurious notification every single day that serves no purpose — there's no active task to warn about.
Current Behavior
In gateway/run.py, _notify_active_sessions_of_shutdown() does two things:
- Notifies sessions with active agents (useful ✅)
- Unconditionally notifies all home channels regardless of whether any session is active (noisy ❌)
This means even an idle gateway restart triggers a notification to every configured home channel.
Desired Behavior
Either:
Option A (recommended): Skip home-channel notifications entirely when there are no active sessions. The notification is only meaningful when a task is actually being interrupted.
Option B: Add a config option like agent.shutdown_notify: false (or agent.shutdown_notify_home: false) to allow users to opt out of shutdown notifications to home channels.
Suggested Fix (Option A)
In _notify_active_sessions_of_shutdown(), after the loop that notifies active sessions, add an early return before the home-channel loop:
# After notifying active sessions, skip home-channel notification
# when idle — no running task means nothing to warn about.
if not active:
logger.info("No active sessions — skipping home-channel shutdown notification")
return
This keeps the notification useful (it still fires when a task is actually interrupted) but eliminates the noise for scheduled/idle restarts.
Environment
- Hermes Agent v0.12.0
- Platform: Weixin (WeChat) home channel
- Gateway runs as systemd service, machine reboots daily at 4 AM
Feature Request: Add config option to suppress shutdown notifications when no active sessions exist
Problem
When the gateway shuts down (e.g. daily scheduled machine reboot via systemd), it unconditionally sends a "⚠️ Gateway shutting down — Your current task will be interrupted." message to all home channels, even when there are no active sessions running.
For users who schedule routine restarts (e.g. daily 4 AM reboot via cron/systemd timer), this results in a spurious notification every single day that serves no purpose — there's no active task to warn about.
Current Behavior
In
gateway/run.py,_notify_active_sessions_of_shutdown()does two things:This means even an idle gateway restart triggers a notification to every configured home channel.
Desired Behavior
Either:
Option A (recommended): Skip home-channel notifications entirely when there are no active sessions. The notification is only meaningful when a task is actually being interrupted.
Option B: Add a config option like
agent.shutdown_notify: false(oragent.shutdown_notify_home: false) to allow users to opt out of shutdown notifications to home channels.Suggested Fix (Option A)
In
_notify_active_sessions_of_shutdown(), after the loop that notifies active sessions, add an early return before the home-channel loop:This keeps the notification useful (it still fires when a task is actually interrupted) but eliminates the noise for scheduled/idle restarts.
Environment