Skip to content

Telegram

What it is

The Telegram bot is a surface of your human inbox. Anything an agent sends you (a notify, an ask, a reply to your ask) is stored in the inbox and pushed to your Telegram chat. Messages you send go back into the mesh, each tracked until its agent answers.

When to use it

Use Telegram when you want phone-side mesh control, agent status updates, or image/document uploads from your phone.

Use the dashboard when you want to see an agent's work as a tree (its turns, tool calls and subagents) on a wide screen. Use Slack when a team channel should drive the mesh.

Setup

Create a Telegram bot token with @BotFather, identify the chat id Repowire should accept, then add both values to ~/.repowire/config.yaml:

telegram:
  bot_token: "..."
  chat_id: "..."

repowire setup writes those keys after the interactive prompt for Telegram credentials. When both are configured, setup installs the bot as an OS-managed user service alongside the daemon. There is no hosted Telegram bot; you bring your own bot. Use repowire telegram start only when intentionally running the bot separately on a machine that can reach the daemon.

Common workflows

The chat is your conversation with every agent at once, at the Direct zoom: asks, answers and notices for you, each labelled with its agent. There is no ask/notify choice: every message you send is tracked until its agent answers, and waits for an agent that is offline.

Send a message to the orchestrator, which routes it:

what's the state of the release?

Send it to one agent instead by starting with its name:

@repowire status?

Tap ๐Ÿ“‹ agents (or /agents) to choose from six readable name-and-machine buttons per page. Previous, Next, Refresh and Close keep the list compact. Selecting an agent sends nothing to it: the bot opens a text compose prompt showing the destination. Reply to that exact prompt to send, or reply /cancel. The picker includes available agents across your authenticated mesh; an unreadable machine is reported rather than guessed.

A compose prompt belongs to the person who opened it, expires after 15 minutes, and accepts text only. Commands, @addressing, photos and documents in that prompt are refused; use an ordinary message for those existing workflows. Topics/business contexts are not supported by the picker. There is no persistent selected target: closing Telegram's reply composer and typing normally keeps the ordinary routing below. An agent that disappears, changes identity or cannot be verified must be chosen again. A known same-identity offline agent can use the daemon's existing queued delivery; an omitted remote machine cannot be verified.

Picker and prompt creation are attempted once per retained command/callback receipt; a lost creation response is not automatically retried. Choose again deliberately if the bot cannot confirm the prompt. Draft bindings live only in the bot process. An identifiable reply to an expired prompt or after a restart is refused; it never falls back to an agent or orchestrator. Telegram can omit reply-parent metadata, so a message without that parent is an ordinary message, not a recoverable draft. If a send's response is lost, the same Telegram update can reconcile under its original idempotency key; a different message cannot take over the uncertain draft. This is bounded best effort, not a durable outbox. When draft capacity is full, new prompts are refused instead of evicting active sends.

Reply to an agent's message with Telegram's Reply: on an ask it acks the ask with your text; on anything else it opens a new ask to that agent. A reply to any part of a long, split message works. Plain text typed straight under an open ask (nothing else in the chat between them) answers that ask too, whichever agent sent it; a choice question still needs its buttons. Text right under an agent's note about its own open ask (a note whose reply link or thread names that ask) answers the ask as well. Anything else you type is a new message to the orchestrator; use @name message to send something new to an agent, even right under an ask. An ask that arrives just as you send counts as the message above yours. An agent's answer to your ask arrives as a Telegram reply under your original message.

When plain text under an agent's progress note answers an earlier ask, the bot adds a concise โœ“ Answered #ask-โ€ฆ: preview confirmation using that reply's canonical receipt. Ordinary adjacent answers keep their reaction. The preview is plain text, at most 80 characters, and the confirmation links to the older ask when its recorded Telegram reference is valid; otherwise it replies under your message. On an older daemon without this receipt context, the reaction remains unchanged.

This confirmation is best effort: one Bot API attempt, with no automatic retry or replay of the already completed reply if that attempt fails or its outcome is unknown. Cached duplicate updates do not send another confirmation. A lost response, daemon restart or expired receipt cache can leave the confirmation missing; it is not a durable delivery guarantee.

Inbox messages carry buttons only where a bot would offer a choice: a choice question shows its options (plus โœ— Deny for a tool permission), and an acknowledge question shows โœ“ Got it. A plain message or a free-text ask has no buttons; Reply, or plain text right under it, is the answer. When an agent closes an ask or notice it sent (by acking its own message), its buttons go and a reply under it says who withdrew it; there is nothing left to answer. When a message you sent expires unanswered, a reply under your message says so; an answer arrives under it as usual.

An agent's message is shown formatted: bold, italic, strikethrough, inline code, code blocks, links, headings (bold), lists and quotes, with line breaks as written. A table arrives as a monospace block, as typed, and an image as a link named by its alt text (or its URL). Only http, https and mailto links are links; any other scheme shows as text. Indented and fenced code stay verbatim. A long message is split between blocks, never inside one. If Telegram refuses the formatting, the same message is sent again as the plain text the agent wrote.

Telegram gives bots no read receipts, so read state is implicit: whenever you send a message or tap a button in the chat, every unread item already in the chat is marked read on every surface. A message reads everything Telegram showed before it; a tap, even on an older message's button, reads everything the bot had sent by the time the tap arrived. An item that arrives afterwards, such as an agent's answer to your tap, stays unread. A message replayed after an outage reads only what preceded it; a replayed tap (Telegram expires them quickly) can also read items sent between the tap and its handling. Items stored while the bot was offline are not sent when it reconnects (#480); read them on the dashboard or with repowire inbox. Buttons on older messages (โœ“ Seen, โœ“ Got it) keep working.

What you send from the app, the web or the CLI shows here too, muted, as "You (from the app) โ†’ Orchestrator ยท waiting for a reply" with the message under it, so the chat reads as the whole conversation. Its last word follows the send (waiting for a reply, answered, declined, withdrawn, expired, closed, lost, not delivered), edited in place when it changes. Your text is shown formatted, as the app shows your own messages: markdown you write renders here too. Swipe-reply to it to continue that message's thread with its agent. A message you send here is not echoed.

The first message after the bot starts sets the chat's keyboard (๐Ÿ“ฅ inbox, ๐Ÿ“‹ agents, or none after /keyboard off), replacing any keyboard an older version left.

To pass something on, swipe-reply to it with /fwd @name and an optional note. An open ask you hold moves to that agent (its answer still goes to the asker, and you get a copy that does not need you); anything else is sent on, quoted, as a new message.

Send a photo when an agent should inspect it: it goes to the orchestrator, or to @name at the start of its caption. Swipe-reply with a photo to answer that message with it, as text would. The bot uploads it to the daemon and includes it in the message. Attachments sent by agents are uploaded back to Telegram as photos or documents.

Commands and API

Command What it does
message Send to the orchestrator (tracked until it answers)
@peer message Send to that agent
Swipe-reply Answer that message; on anything that is not an open ask, a new message to its agent
Swipe-reply /fwd @peer [note] Forward that message to another agent; to name@machine it is sent on, quoted, and an open ask stays yours
/inbox What needs you (open asks, oldest first), then what is unread
/all [n] A digest of the last n items (default 10, at most 50) across every agent: messages, agent-to-agent chatter and delivery stages
/agents (or /peers, /list) Open the paged agent picker
/start, /help How this chat works
/keyboard on / /keyboard off Show or hide the persistent keyboard (Inbox, Peers)

Telegram pushes only the Direct zoom: there is no /zoom. /all pulls a digest of everything on demand; use the app or the web to follow the chatter as it happens. The old /select, /switch, /clear and /notify//fyi commands are gone; the bot says so if you use them.

Agents reach you by addressing human:

notify_peer("human", "deploy finished, green across CI")
# notif-delivery-1a2b3c4d inbox_item=inb-5e6f7a8b surfaces=telegram

human is you on every surface (telegram still resolves to it for older agents), so the message lands in your inbox even when the bot is down, and the sender gets a receipt. repowire trace <delivery id> shows whether the push reached Telegram (surface_pushed) or failed (surface_failed with network, rate_limited, rejected, too_long, overloaded or no_receipt). A unique service/human display name resolves across circles, so agents do not need to discover or pass the bot's configured service circle. Ordinary agent names remain circle-scoped.

Limits

  • Telegram traffic is not proxied by the relay; the bot talks directly to Telegram's API and to your daemon.
  • Telegram updates are acknowledged only after Repowire handles them successfully. A transient daemon or Telegram API failure is retried instead of silently consuming the command.
  • Attachments live in ~/.repowire/attachments/ with a 24-hour TTL and 10 MB upload limit.
  • Messages sent from Telegram are the human's: agents see them as @human, framed as human instructions. The bridge is not listed as a peer. An answer to an ask you sent from Telegram is pushed back only to Telegram while the bridge is connected.
  • Mesh broadcasts reach Telegram only with human.broadcast: true and human.surfaces.telegram.broadcast: true.
  • The bot retries network failures and rate limits up to three times per message. A retry after a lost response can deliver the same message twice.
  • Long messages are split into chunks of about 3900 characters. A reply to any chunk acts on the item; later replies on the thread anchor to the first chunk.
  • Bot API errors are logged with the bot token redacted.

Troubleshooting

  • Bot does not respond to /agents: confirm TELEGRAM_BOT_TOKEN is set and the bot is registered with @BotFather.
  • A message went to the orchestrator instead of an agent: use the Agents picker and reply to its destination prompt, or start an ordinary message with @name.
  • Photos do not reach the agent: confirm the daemon is reachable from the bot host and /attachments is not blocked by a proxy.

See also