Telegram: delivery-only notification sink for notifications.telegram_chat_id groups - #417
Open
serxa wants to merge 2 commits into
Open
Telegram: delivery-only notification sink for notifications.telegram_chat_id groups#417serxa wants to merge 2 commits into
serxa wants to merge 2 commits into
Conversation
…only sink When notifications.telegram_chat_id points at a group/supergroup, pushes (the notify tool, async questions/approvals, tg-notify.sh) are delivered there, but inbound messages in that chat must not start an agent turn — it is a one-way notification channel. A DM sink stays interactive (the guard requires a non-private chat), and inline-button callbacks are handled separately so questions/approvals delivered there remain answerable. Adds _is_delivery_only_sink() + unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
serxa
marked this pull request as ready for review
August 31, 2026 13:12
…very_only_sink flag Make the delivery-only behaviour opt-in (default false) so it never changes behaviour for an existing install — including one that points notifications.telegram_chat_id at a group it also uses to talk to the bot (a group sink still responds unless the flag is enabled). Only when delivery_only_sink is true AND the sink is a non-private chat are inbound messages ignored. Adds the config field + from_dict parsing, gates _is_delivery_only_sink, and covers the flag-off case in tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Add an opt-in setting
notifications.delivery_only_sink(default false). When enabled andnotifications.telegram_chat_idpoints at a non-private group/supergroup, that chat becomes a one-way notification channel: notifications are delivered there, but inbound messages no longer start an agent turn.Why
A user may want a dedicated Telegram group that only receives notifications (the
notifytool, async questions/approvals, and the out-of-bandtg-notify.shhelper), keeping the DM uncluttered. Without a guard, any message the bot receives in that group would spin up an agent session and reply.The behaviour is gated behind an explicit flag so it is fully backward compatible: existing installs are unaffected unless they opt in — including an install that points
telegram_chat_idat a group it also uses to talk to the bot (that group keeps responding unlessdelivery_only_sinkis set).Behavior (when
delivery_only_sink: true)telegram_chat_idat the owner's own chat is unaffected.Changes
nerve/config.py: addNotificationsConfig.delivery_only_sink(bool, default false) +from_dictparsing.nerve/channels/telegram.py: add_is_delivery_only_sink()(gated on the flag), consulted at the top of_handle_message.tests/test_telegram_notification_sink.py: unit tests for the predicate, including the flag-off backward-compat case.