Skip to main content
Chat with your agent fleet via CLI REPL, Telegram, Discord, Slack, WhatsApp, or Webhook. Channels provide a unified interface for interacting with agents from any platform.

Activation: token-presence, not a flag

Channels auto-start as soon as the mesh resolves a usable token. There is no separate enabled: true flag — drop a token in and the channel comes up on next openlegion start. The mesh looks for each channel’s bot token in this order:
  1. OPENLEGION_SYSTEM_<NAME> (mesh-tier env)
  2. OPENLEGION_CRED_<NAME> (agent-tier env)
  3. Bare env (e.g., TELEGRAM_BOT_TOKEN)
  4. mesh.yaml channels.<name>.bot_token

Pairing

On startup, each active channel prints a one-time pairing code to the console. Send /start <code> from your account in that channel to claim the channel — the first user to pair becomes the channel owner. After pairing, the channel persists the owner mapping (e.g., config/telegram_paired.json for Telegram).

Supported Channels

Channel Configuration

API tokens are stored as environment variables:
Per-channel options (default agent, allowed users, etc.) live under channels.<name> in config/mesh.yaml:

WhatsApp caveats

WhatsApp is the channel with the most operational gotchas:
  • Graph v21.0 Cloud API only.
  • Text-only. Inbound non-text messages (images, audio, documents, stickers, locations) are dropped — the agent never sees them.
  • WHATSAPP_APP_SECRET is required in production. The webhook handler verifies inbound payloads with HMAC-SHA256. If MESH_AUTH_TOKEN is set and WHATSAPP_APP_SECRET is missing, the channel raises RuntimeError at startup — it will not silently run unauthenticated.
  • The verify token regenerates on every restart unless you set OPENLEGION_SYSTEM_WHATSAPP_VERIFY_TOKEN explicitly. Set it so your Meta-side webhook config stays stable.

Channel Commands

These commands work across all channels (CLI commands are documented in the CLI Reference): CLI-only commands (not available in messaging channels): /add, /agent, /remove, /restart, /history, /blackboard, /queue, /cron, /project, /credential, /removekey, /logs, /traces (alias /debug).

Per-channel routing semantics

Routing semantics differ slightly per channel:
  • Telegram / Discord: per-user. Each user’s messages route to the agent they’ve /use-d.
  • Slack: composite user_id:thread_ts. The same user gets a separate active-agent per thread.
  • WhatsApp: per-user, keyed on phone number.
  • CLI: single-user (the REPL session itself).