feat(gateway): add Telegram notification mode to suppress intermediate push notifications#22772
Closed
CalmProton wants to merge 1 commit into
Closed
feat(gateway): add Telegram notification mode to suppress intermediate push notifications#22772CalmProton wants to merge 1 commit into
CalmProton wants to merge 1 commit into
Conversation
…e push notifications Add a configurable notifications mode for the Telegram platform adapter that controls which messages trigger push notifications. - display.platforms.telegram.notifications: "all" (default) | "important" - HERMES_TELEGRAM_NOTIFICATIONS env var override - In "important" mode, all sends use disable_notification=True except: - Approvals (send_exec_approval) and slash confirmations - Final response messages (metadata["notify"]=True) - Zero overhead in default "all" mode - Zero impact on non-Telegram platforms Closes NousResearch#22771
Contributor
|
Merged via salvage PR #22793. salvage cherry-picked your commit; default flipped to 'important' on top per maintainer feedback (per-tool-call notifications were too noisy as the default). Thanks for the contribution! |
This was referenced May 10, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"all"), zero impact on non-Telegram platforms.Problem
When using Hermes Agent through Telegram, every message — tool calls, thinking updates, streaming previews, commentary — triggers a push notification. The user's phone buzzes dozens of times per turn.
Telegram's Bot API has
disable_notificationon all send methods, which delivers messages silently (visible in chat but no device buzz). This PR uses that parameter.Solution
New config option:
Or env var:
HERMES_TELEGRAM_NOTIFICATIONS=importantallimportantWhat gets silenced in
importantmodeWhat still notifies in
importantmodeTechnical details
TelegramAdaptergains_notifications_modeattribute and_notification_kwargs(metadata)helpersend,send_voice,send_image_file,send_document,send_video,send_image,send_animation,send_multiple_images) passdisable_notification=Truewhen silencedsend_exec_approval()andsend_slash_confirm()intentionally not modified — always notifyBasePlatformAdapter._process_message_background()viametadata["notify"]=Trueon a cloned metadata dict (avoids mutating the typing-indicator task's reference)GatewayRunner._create_adapter(), gated toPlatform.TELEGRAMonlyTesting
"all"mode produces identical API calls — backward compatiblegetattrfallback handles tests that bypass__init__viaobject.__new___notification_kwargs(None)returns{}inallmodeFiles changed
gateway/platforms/telegram.py_notifications_modeattr,_notification_kwargs()helper, wired into all send methodsgateway/platforms/base.pynotify=Truebefore final response deliverygateway/run.pyconfig.yaml/ env var, set on adaptertests/gateway/test_base_topic_sessions.pyCloses #22771