Skip to content

Telegram: delivery-only notification sink for notifications.telegram_chat_id groups - #417

Open
serxa wants to merge 1 commit into
mainfrom
serxa/telegram-notification-sink
Open

Telegram: delivery-only notification sink for notifications.telegram_chat_id groups#417
serxa wants to merge 1 commit into
mainfrom
serxa/telegram-notification-sink

Conversation

@serxa

@serxa serxa commented Aug 31, 2026

Copy link
Copy Markdown
Member

What

When notifications.telegram_chat_id points at a group/supergroup, deliver notifications there but make it a one-way channel: inbound messages in that chat no longer start an agent turn.

Why

A user may want a dedicated Telegram group that only receives notifications (the notify tool, async questions/approvals, and the out-of-band tg-notify.sh helper), keeping the DM uncluttered. Today, any message the bot receives in that group would spin up an agent session and reply — undesirable for a delivery-only channel.

Behavior

  • Inbound messages in the configured non-private sink chat are ignored (logged, no turn).
  • A DM sink stays fully interactive — the guard requires a non-private chat, so pointing telegram_chat_id at the owner's own chat is unaffected.
  • Inline-button callbacks are handled separately, so questions/approvals delivered to the sink remain answerable.

Changes

  • nerve/channels/telegram.py: add _is_delivery_only_sink(), consulted at the top of _handle_message.
  • tests/test_telegram_notification_sink.py: unit tests for the predicate.

…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
serxa marked this pull request as ready for review August 31, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant