hermes - 💡(How to fix) Fix [Feature]: send startup notification to home channels when gateway first comes online

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

async def _send_home_channel_startup_notifications(
    self,
    *,
    skip_targets: Optional[set[...]] = None,
    message: str = "♻ Gateway online — Hermes is back and ready.",
) -> set[...]:

---

if restart_notification_pending or delivered_restart_target is not None:
    await self._send_home_channel_startup_notifications(...)

---

Reble Wang(Lord.Rebel) 5/18 16:24:19
skip_home_targets = (
    {delivered_restart_target} if delivered_restart_target else None
)
if restart_notification_pending or delivered_restart_target is not None:
    await self._send_home_channel_startup_notifications(
        skip_targets=skip_home_targets,
    )
else:
    await self._send_home_channel_startup_notifications(
        skip_targets=skip_home_targets,
        message="✅ Gateway online — ready to serve.",
    )

---
RAW_BUFFERClick to expand / collapse

Feature Description

When the gateway shuts down, a notification is sent to active sessions and home channels (via _notify_active_sessions_of_shutdown). But when the gateway starts up for the first time (not a /restart), there is no equivalent notification to home channels.

Motivation

Users who rely on messaging platforms (WeChat, Telegram, etc.) as their primary interface to Hermes have no way to know whether the gateway is alive after a server reboot, systemd restart, or crash recovery — except by sending a message and waiting for a reply. A startup notification would give immediate confidence that the gateway is operational.

Proposed Solution

Proposed Solution

Two changes in gateway/run.py:

1. _send_home_channel_startup_notifications() — accept a custom message

Add an optional message parameter so callers can differentiate first-time startup from /restart recovery:


async def _send_home_channel_startup_notifications(
    self,
    *,
    skip_targets: Optional[set[...]] = None,
    message: str = "♻ Gateway online — Hermes is back and ready.",
) -> set[...]:

And remove the hardcoded message = "♻ …" inside the function body in favor of the parameter.

2. start() method — always call the notification, not just on restart

Currently the call is guarded by:


if restart_notification_pending or delivered_restart_target is not None:
    await self._send_home_channel_startup_notifications(...)

Change it to always invoke, with different messages:


Reble Wang(Lord.Rebel) 5/18 16:24:19
skip_home_targets = (
    {delivered_restart_target} if delivered_restart_target else None
)
if restart_notification_pending or delivered_restart_target is not None:
    await self._send_home_channel_startup_notifications(
        skip_targets=skip_home_targets,
    )
else:
    await self._send_home_channel_startup_notifications(
        skip_targets=skip_home_targets,
        message="✅ Gateway online — ready to serve.",
    )

3. (Optional) Add a config toggle

A notify_on_startup: bool = True field in the platform config (alongside the existing gateway_restart_notification) would let users opt out.

Alternatives Considered

  • Hooks system: The gateway already emits gateway:startup via HookRegistry, but the hook context ({"platforms": [...]}) doesn't include adapter references, so a hook handler cannot send messages without additional code changes in hooks.py.

Affected Files

  • gateway/run.py_send_home_channel_startup_notifications() signature + start() caller logic
  • (Optional) gateway/config.py — add notify_on_startup field

Related

  • Uses the same delivery path as the existing shutdown notification (_notify_active_sessions_of_shutdown), including respecting the gateway_restart_notification: false per-platform opt-out.

Alternatives Considered

No response

Feature Type

Gateway / messaging improvement

Scope

None

Contribution

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

Debug Report (optional)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: send startup notification to home channels when gateway first comes online