Skip to content

Feature request: config option to suppress gateway shutdown/restart notifications #21871

@Davi-He

Description

@Davi-He

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliverysweeper:implemented-on-mainSweeper: behavior already present on current maintype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions