fix(gateway): notify home channel on ordinary startup - #48360
Conversation
|
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 |
teknium1
left a comment
There was a problem hiding this comment.
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_restarthandling and planned-marker cleanup atgateway/run.py:7292-7313. - Add lifecycle tests for an ordinary no-marker startup sending one home notice and a chat-originated
/restartsuppressing 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(): |
There was a problem hiding this comment.
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.
Summary
/restartbehavior targeted to the initiating chat/topic only, avoiding an extra home-channel broadcast.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 -quv run --extra dev pytest -o addopts='' tests/gateway/test_restart_notification.py -qManual verification
Sent home-channel startup notification to feishu:oc_....