Skip to content

[Bug]: Gateway startup notification not sent. #62512

Description

@tatchanon51

Bug Description

Summary

The Gateway design to sends a "♻️ Gateway online" notification only on planned restarts (e.g. hermes gateway restart, /restart command), but it’s actually not happened. This leaves the user unaware that the gateway has come back online.

Environment

  • Hermes version: latest (gateway running on macOS)
  • Affected platforms: all platforms that use _send_home_channel_startup_notifications (Telegram, LINE, Discord, etc.)

Steps to Reproduce

  1. Start gateway: hermes gateway start (all channels connect normally)
  2. Use ‘hermes gateway restart’ or ‘hermes gateway stop’ or force quit Hermes (Cmd+Q) or kill the gateway process — shutdown notification is sent as expected
  3. Start gateway again if the gateway has been stopped if not, just wait gateway finish restarting: hermes gateway start
  4. No "♻️ Gateway online" notification is sent to the home channel

Expected Behavior

Every time the gateway starts successfully, "♻️ Gateway online — Hermes is back and ready." should be sent to configured home channels — except when a chat-originated /restart is in flight (its reply target already covers that lifecycle).

Actual Behavior

The startup notification is designed to sent only when planned_restart_notification_pending == True, which is set only on terminal / SIGUSR1 / service paths.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram

Debug Report

Report       https://paste.rs/j9kFk
  agent.log    https://paste.rs/bTp8W
  gateway.log  https://paste.rs/Nm5Rh
  gui.log      https://paste.rs/rSGHr
  desktop.log  https://paste.rs/LWGb6

Operating System

MacOS 26.5.2

Python Version

3.11.5

Hermes Version

0.18.2

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

File: hermes-agent/gateway/run.py
Lines: 7307–7313

`if planned_restart_notification_pending:    # ← only this branch sends notification
    try:
        await self._send_home_channel_startup_notifications(
            skip_targets=None,
        )
    finally:
        _clear_planned_restart_notification()
# No else branch for manual/crash recovery`

The _send_home_channel_startup_notifications() function itself correctly respects gateway_restart_notification: True (the default), but it is never called on non-planned startup paths.

Proposed Fix (optional)

Add an elif branch right after line 7313 in hermes-agent/gateway/run.py:

`elif not _restart_notification_pending():
    # Also notify on manual start / crash recovery / service restart
    try:
        await self._send_home_channel_startup_notifications(
            skip_targets=None,
        )
    except Exception as exc:
        logger.warning("Startup notification (non-planned) failed: %s", exc)`

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havebugcomp/gatewayGateway runner, session dispatch, deliverytype/featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions