Skip to content

Feature Request: Telegram bridge for remote agent monitoring #49

@realproject7

Description

@realproject7

Summary

A bidirectional Telegram bridge that lets operators monitor and control AgentChattr agents from their phone. We built this for our own multi-agent setup and it's been working well — wanted to gauge interest before cleaning it up for a PR.

What it does

  • Read path: Polls /api/messages and relays new messages to a Telegram chat (formatted with sender, channel, timestamp)
  • Write path: Polls Telegram getUpdates() and relays operator messages to AgentChattr via /api/send
  • Channel routing: Operator can prefix messages with #channel-name or use /channel <name> to switch sticky default
  • Operator commands: /status, /channels, /channel <name>, /help
  • State persistence: Tracks cursors in a JSON file so no messages are lost on restart

Architecture

Single Python script (~400 lines), no dependencies beyond requests. Registers with AgentChattr as a regular agent via the REST API — no internal modifications needed. Runs as a daemon alongside the server.

Telegram Bot API  ←→  telegram_bridge.py  ←→  AgentChattr REST API
 (getUpdates)           (polling both)         (/api/messages, /api/send)
 (sendMessage)                                 (/api/register, /api/heartbeat)

Config

Uses the existing config.toml with a [telegram] section:

[telegram]
bot_token = ""        # from @BotFather
chat_id = ""          # operator's chat ID
poll_interval = 2     # seconds

Also supports env vars (TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID) for containerized setups.

Use case

We run 4 agents (Claude Code + Codex CLI) in an autonomous dev loop. The Telegram bridge lets the operator (project owner) monitor agent chatter, approve merges, and unblock workflows from mobile — without needing to be at the web UI.

Open questions

  • Is this something you'd want in core, or better as a community plugin/example?
  • Should it support group chats (multiple operators) or just 1:1?
  • Any preference on where it lives in the repo (e.g., bridges/telegram/)?

Happy to clean up and submit a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions