Skip to content

[POLISH] Telegram bot integration #7

Description

@hasan-malik

Judges' 402-integrity test says "trigger a machine payment in the chat." Telegram is the canonical surface for that — and chat UI in the browser already works, so this is a parallel surface.

Plan

  1. `@BotFather` on Telegram → `/newbot` → save the token.
  2. Set `TELEGRAM_BOT_TOKEN` + `TELEGRAM_CHAT_ID` in `.env`.
  3. Create `agent/telegram-bot.ts`:
    • Long-polling listener via `node-telegram-bot-api` (already in deps).
    • On every message, call `runChatTurn(message, perChatHistory)` from agent/llm/loop.ts.
    • Stream the reply back to the same chat. Render tool traces as monospace lines if they fired.
    • Persist per-chat history keyed by Telegram `chat_id` (use the same JSON store pattern as findings).
  4. Add `npm run bot` → `tsx agent/telegram-bot.ts`.
  5. Test by chatting with the bot directly from your phone.

Done when

  • Phone → message bot → agent replies in Telegram with tool calls firing
  • The "Try to scan example.com" refusal demo works in Telegram too

Why polish, not gate

Dashboard chat already covers the in-chat-payment test. Telegram is the demo-friendly surface (judges chat with the bot on their own phone). High return, low cost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    polishNice to have if time

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions