Skip to content

feat: Telegram Bot Integration for Agents (TGRAM-001) #103

Closed

Description

@vybe

Summary

Enable per-agent Telegram bot integration. Each agent gets its own Telegram bot (created via @Botfather), allowing users to chat with agents from mobile and receive notifications.

Requirements

See detailed spec: docs/requirements/TELEGRAM_INTEGRATION.md

Architecture

  • Per-agent bots (one bot per agent, token in agent's .env via CRED-002)
  • Webhook routing by webhook_secret in URL path
  • Polling mode for development, webhook mode for production
  • Reuses public_chat_sessions table for conversation context

Phase 1 (MVP)

  • Database schema (telegram_bindings, telegram_chat_links)
  • Telegram service layer (telegram_service.py)
  • API router (routers/telegram.py)
  • Webhook endpoint for receiving messages
  • Registration endpoint (reads token from agent .env, calls getMe)
  • Message routing: Telegram → agent /api/task → Telegram response
  • /start and /help command handlers
  • Polling mode for local development
  • Frontend UI panel in Agent Detail

Future Phases

  • Phase 2: Notification forwarding to Telegram
  • Phase 3: Inline keyboards for approve/reject actions
  • Phase 4: Production webhook mode with setWebhook
  • Phase 5: QR codes, conversation persistence, error templates

Dependencies

  • aiogram>=3.0.0 (async Telegram Bot API framework)

Reference

Activity

  1. added
    enhancement
    on Mar 12, 2026
  2. vybe commented on Mar 30, 2026

    @vybe
    ContributorAuthor

    Actualization (2026-03-30)

    Current state: Not implemented. Spec exists at docs/requirements/TELEGRAM_INTEGRATION.md, requirement documented as section 15.1c (TGRAM-001).

    Note: #86 is a duplicate of this issue. #216 expands scope with media support and public link sharing.

    What exists as groundwork:

    • Channel adapter abstraction (SLACK-002) — ChannelAdapter base class, ChannelMessageRouter pipeline
    • The adapter pattern was designed to support Telegram as a second adapter
    • /announce skill already has Telegram support (sends messages to Telegram channels)
    • Dependency aiogram>=3.0.0 specified in spec

    Recommendation: Still valid at P1c. The channel adapter infrastructure is ready; implementing a TelegramAdapter would follow the Slack adapter pattern. Consider #216's expanded scope when implementing.

  3. vybe commented on Apr 4, 2026

    @vybe
    ContributorAuthor

    Closing — Telegram bot integration was implemented via #216 (closed). routers/telegram.py and services/telegram_media.py exist in codebase.

  4. added
    complexity-low
    on Jun 3, 2026
  5. added a commit that references this issue on Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions