Skip to content

fix(gateway): notify home channel on ordinary startup - #48360

Open
dabuge wants to merge 1 commit into
NousResearch:mainfrom
dabuge:fix/gateway-home-startup-notification
Open

fix(gateway): notify home channel on ordinary startup#48360
dabuge wants to merge 1 commit into
NousResearch:mainfrom
dabuge:fix/gateway-home-startup-notification

Conversation

@dabuge

@dabuge dabuge commented Jun 18, 2026

Copy link
Copy Markdown

Summary

  • Send home-channel startup notifications for ordinary gateway starts, boot autostarts, Scheduled Task launches, service restarts, and other non-chat-initiated restarts once a platform is connected.
  • Keep chat-originated /restart behavior targeted to the initiating chat/topic only, avoiding an extra home-channel broadcast.
  • Add tests for the startup-notification decision helper.

Test Plan

  • uv run --extra dev pytest -o addopts='' tests/gateway/test_restart_notification.py::test_home_channel_startup_notice_sent_for_plain_startup tests/gateway/test_restart_notification.py::test_home_channel_startup_notice_suppressed_for_chat_originated_restart tests/gateway/test_restart_notification.py::test_send_home_channel_startup_notification_to_configured_home -q
  • uv run --extra dev pytest -o addopts='' tests/gateway/test_restart_notification.py -q

Manual verification

  • Restarted the local Windows Scheduled Task gateway and verified the log line: Sent home-channel startup notification to feishu:oc_....

@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have labels Jun 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #24271 (opt-in startup-notification flag), #27278 (unconditional every-start), #30787 (per-platform opt-in), and issue #27870. This PR uses a startup-notification decision helper that fires on non-chat-initiated restarts while keeping /restart targeted to the initiating chat — a different mechanism than the opt-in-flag and unconditional approaches. Competing same-feature cluster; maintainer chooses the mechanism.

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Acknowledged: noted competing PR(s) #24271, #27278, #30787, #27870. My approach differs and is complementary, not mutually exclusive. Open to consolidating if reviewers prefer one direction.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused gateway fix. The underlying gap is still present on current main: gateway/run.py:7307-7313 only sends the home-channel online message when .restart_pending.json exists, so an ordinary startup remains silent.

Problems

  • The new tests cover only _should_send_home_channel_startup_notification; they do not exercise the real startup sequence that captures markers before _send_restart_notification() consumes .restart_notify.json (gateway/run.py:7291-7300).

Suggested changes

  • Salvage the predicate/call into the current startup block while preserving _booted_from_restart handling and planned-marker cleanup at gateway/run.py:7292-7313.
  • Add lifecycle tests for an ordinary no-marker startup sending one home notice and a chat-originated /restart suppressing that broadcast.

Automated hermes-sweeper review.

assert gateway_run._planned_restart_notification_pending() is False


def test_home_channel_startup_notice_sent_for_plain_startup():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These truth-table checks do not verify the production ordering around _send_restart_notification(), which consumes the chat marker. Please add lifecycle coverage for a no-marker startup send and a chat-originated restart suppressing the home-channel send.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants