Common Features
All adapters share a common foundation:Graceful Shutdown
Resilient Connections
Secret Management
Message Splitting
Flexible Overrides
Policy Enforcement
Rate Limiting
Format Support
All 40 Channels
Core Platforms (7)
Enterprise (8)
Social Media (8)
Community Platforms (6)
Self-Hosted (1)
Privacy-Focused (3)
Workplace (4)
Notification Services (2)
Integration (1)
Channel Configuration
All channel configurations live in~/.openfang/config.toml under the [channels] section.
Common Configuration Fields
bot_token_env / token_env
bot_token_env / token_env
Zeroizing<String> and wiped from memory on drop.default_agent
default_agent
allowed_users
allowed_users
overrides
overrides
Channel Overrides
Every channel adapter supportsChannelOverrides, which let you customize behavior per channel without modifying the agent manifest.
Override Fields
Output Formats and Policies
Output Formatter
The formatter module converts Markdown output from the LLM into platform-native formats:DM Policy
Controls how the adapter handles direct messages:Group Policy
Controls how the adapter handles messages in group chats, channels, and rooms:dispatch_message() before the message reaches the agent loop. This means ignored messages consume zero LLM tokens.Setup Guides
Telegram
Create a bot
/newbot and follow the prompts.Set environment variable
Configure in config.toml
Restart the daemon
getUpdates API with 30-second timeout. Automatically splits responses over 4096 characters.
Interactive Setup:
Discord
Create a Discord application
Add a bot
Invite the bot
bot and permissions Send Messages + Read Message History. Use the generated URL to invite the bot.Set environment variable
Configure in config.toml
Slack
Create a Slack app
Enable Socket Mode
connections:write.Add bot scopes
chat:write, app_mentions:read, im:history, im:read, im:write.Install to workspace
Set environment variables
Configure in config.toml
threading = true, replies are sent to the message’s thread via thread_ts.
Set up Meta Business account
Add WhatsApp product
Get credentials
Set environment variables
Configure in config.toml
Set up webhook
https://your-domain.com:8443/webhook/whatsapp with your verify token.Matrix
Create bot account
Set environment variable
Configure in config.toml
Invite the bot
/sync. Processes new messages from joined rooms.
Create app password
Set environment variable
Configure in config.toml
Agent Routing
TheAgentRouter determines which agent receives an incoming message:
Per-channel default
default_agent field. Messages from that channel go to that agent.User-agent binding
Command prefix
/agent coder in chat. Subsequent messages route to the “coder” agent.Fallback
WebChat (Built-in)
The WebChat UI is embedded in the daemon and requires no configuration:Real-time Chat
Streaming Responses
Agent Selection
Token Usage Display
Writing Custom Adapters
To add support for a new messaging platform, implement theChannelAdapter trait.
The ChannelAdapter Trait
Implementation Steps
Define your adapter
crates/openfang-channels/src/myplatform.rs:Implement the trait
ChannelType::Custom("myplatform".to_string()) for the channel type. Wrap secrets in Zeroizing<String>. Use exponential backoff for connection failures.Register the module
crates/openfang-channels/src/lib.rs:Wire into the bridge
crates/openfang-api/src/channel_bridge.rs.Add config support
openfang-types and add to ChannelsConfig.Add CLI setup wizard
cmd_channel_setup in crates/openfang-cli/src/main.rs.- Only the 9 most common channels have named
ChannelTypevariants. All others useCustom(String). - Wrap secrets in
Zeroizing<String>so they are wiped from memory on drop. - Accept a
watch::Receiver<bool>for coordinated shutdown with the daemon. - Use the shared
split_message(text, max_len)utility for platforms with message length limits.