Messaging Gateway
Messaging Gateway
Section titled “Messaging Gateway”Send a message, get an AI reply with full workspace tools. The Messaging Gateway lets you run Ptah from your phone, your team chat, or anywhere else you can text.
Supported platforms
Section titled “Supported platforms”| Platform | Adapter | Voice messages |
|---|---|---|
| Telegram | Bot API | Yes |
| Discord | discord.js-compatible | Yes |
| Slack | @slack/bolt Socket Mode | Yes |
What works the same everywhere
Section titled “What works the same everywhere”- Pairing — first inbound message from a new sender produces a 6-digit code; you approve the binding in the Bindings UI before any agent work happens
- Voice — audio attachments are decoded with ffmpeg and transcribed by
nodejs-whisper - One reply per turn — the agent’s output is accumulated while it works and delivered as a single message when the turn completes (see Stream coalescing)
- Auto-approved tools — gateway turns run with tool use auto-approved; there is no per-tool prompt to answer from chat. This is why pairing and allowlists are strict, and why the gateway ships disabled by default
- Turn ceiling — a turn that produces nothing for 10 minutes is stopped automatically and you get an error reply; the conversation stays usable and your next message runs normally
Sessions & workspaces from chat (Discord-only for now)
Section titled “Sessions & workspaces from chat (Discord-only for now)”On Discord, each thread is its own Ptah session, and five slash commands (/sessions, /session use, /new, /workspace list, /workspace use) let you re-point a thread at an existing session, start fresh, or switch which workspace the thread targets — validated against a closed allowlist of folders you’ve opened in the desktop app. See Discord Setup for the full command reference. Telegram and Slack keep today’s plain-message behavior; command parity there is a planned follow-up.
Disabled by default
Section titled “Disabled by default”The gateway ships with gateway.enabled = false. Each platform also has its own gateway.<platform>.enabled flag. Both must be true for that platform to connect.
This is intentional. Bots-with-tools are a real attack surface — opt-in only.
Setup at a glance
Section titled “Setup at a glance”- Create a bot / app on the platform (instructions per-platform: Telegram · Discord · Slack)
- Paste tokens into Settings → Messaging → [platform]
- Whitelist the user / guild / team IDs you want to allow
- Enable the platform, then enable the gateway
- Send a message → approve the pairing code → start working
Read more
Section titled “Read more”- Pairing & approvals — how new senders get authorised
- Voice messages — ffmpeg + whisper setup
- Stream coalescing — why your chat won’t flap
- Settings — every gateway tunable