Skip to content

feat(telegram): add group chat support — agents as community managers (#297) - #301

Merged
vybe merged 3 commits into
mainfrom
feature/297-telegram-group-chat
Apr 11, 2026
Merged

vybe merged 3 commits into
mainfrom
feature/297-telegram-group-chat

Conversation

@vybe

@vybe vybe commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Enable agents to participate in Telegram group chats via @mentions and reply-to-bot triggers
  • Per-group configuration for trigger mode (mention-only vs all messages) and welcome messages for new members
  • Auto-creates group configs on first interaction; handles bot added/removed from groups via my_chat_member events

Changes

  • Adapter (telegram_adapter.py): Group detection, @mention parsing from entities, reply-to-bot detection, member event handling, command @botName suffix stripping
  • Transport (telegram_webhook.py): Handle my_chat_member and chat_member updates, inject _bot_username metadata, updated allowed_updates for webhook
  • DB (migrations.py, telegram_channels.py, database.py): New telegram_group_configs table with trigger mode, welcome message config, active state; cascading deletes
  • Router (telegram.py): CRUD endpoints for group configs with IDOR-safe ownership verification
  • Message Router (message_router.py): Silent rate-limit drops in groups, fresh context per group message (no session history bleed), channel-agnostic file upload rate keys
  • Frontend (TelegramChannelPanel.vue): Group list with trigger mode radio buttons and welcome message configuration
  • Requirements (requirements.md): Documented TGRAM-GROUP requirement

Test Plan

  • Bot responds to @mentions in group chats
  • Bot responds to direct replies to its messages
  • Bot ignores non-mentioned messages when trigger_mode=mention
  • my_chat_member creates/deactivates group configs on bot add/remove
  • Welcome messages sent on user join (when enabled)
  • Group config UI shows groups with trigger mode and welcome config
  • Rate limiting silently drops in groups (no public error messages)
  • No session history context bleed in group replies
  • Group config CRUD endpoints verify ownership (no IDOR)
  • Bot re-added to group reactivates previously deactivated config

Closes #297

Generated with Claude Code

vybe and others added 3 commits April 11, 2026 11:00
…#297)

Enable agents to participate in Telegram group chats via @mentions and
reply-to-bot triggers. Per-group configuration for trigger mode (mention-only
vs all messages) and welcome messages for new members.

Key changes:
- Adapter: group detection, @mention parsing from entities, reply-to-bot
  detection, member event handling (bot added/removed, user join/leave)
- Transport: handle my_chat_member and chat_member update types, inject
  bot_username metadata, updated allowed_updates for webhook registration
- DB: new telegram_group_configs table with per-group trigger mode, welcome
  message config, and active state tracking
- Router: CRUD endpoints for group configs with ownership verification
- Frontend: group list with trigger mode radio buttons and welcome message
  configuration in TelegramChannelPanel
- Message router: silent rate-limit drops in groups, fresh context per group
  message (no session history to prevent context bleed), channel-agnostic
  file upload rate-limit keys

Closes #297

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add group chat section to telegram-integration.md covering:
- Group message flow diagram with trigger rules
- Member event handling (my_chat_member, chat_member)
- telegram_group_configs table schema
- Group config API and frontend UI
- Security notes and known limitations
- Update feature flows index

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add /validate-schema and /validate-config skills for weekly maintenance
- Add README and DEVELOPMENT_WORKFLOW entries for new validation skills
- Add quota deploy/redeploy test agent templates
- Add dev announcement for workshop promo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

feat: Telegram group chat support — agents as community managers (TGRAM-GROUP)

1 participant