OpenHuman Messaging Channels: Protocol Differences and Implementation Guide
OpenHuman messaging channels provide a unified JSON-RPC interface that abstracts diverse chat platforms—enabling the core application to interact with Telegram, Discord, Slack, and others through standardized methods while respecting platform-specific protocols and security constraints.
OpenHuman is an extensible framework that unifies external chat services under a common messaging architecture. Each OpenHuman messaging channel is implemented as a separate domain under src/openhuman/channels/, following a shared RPC-based contract that abstracts protocol complexities. This design allows developers to send messages, fetch conversation history, and manage interactions across multiple platforms without writing platform-specific integration code.
Architecture of OpenHuman Messaging Channels
OpenHuman implements a provider-pattern architecture where each messaging service operates as a distinct domain module. All channels expose the same JSON-RPC namespace (/channel), enabling frontend components to invoke methods like list_conversations, send_message, and fetch_history generically regardless of the underlying platform.
The core routing mechanism resides in src/openhuman/core/all.rs, where each channel registers its controllers during initialization. When the frontend issues a request, the runtime routes calls to the appropriate provider based on the channel identifier supplied in the RPC payload.
Supported Channels and Protocol Differences
The framework supports eight distinct messaging platforms, each utilizing different underlying protocols and offering unique feature sets:
Telegram operates via the Bot API (HTTPS) protocol. It supports inline keyboards, media uploads, and message editing through the implementation in src/openhuman/channels/telegram.rs. Typical use cases include automated bots, notifications, and two-way chat applications.
Discord uses the Gateway + REST API protocol. It provides rich embeds, role-based permissions, and slash command support via src/openhuman/channels/discord.rs. This channel suits community hubs and development operations notifications.
Slack implements the Web API (OAuth) protocol, supporting threads, file sharing, and reaction handling. The src/openhuman/channels/slack.rs file handles token exchange and channel lookup, making it ideal for workspace team alerts and corporate notifications.
Signal leverages Signal-CLI (local binary) for end-to-end encrypted communication. This desktop-only daemon approach provides secure personal messaging and group chat capabilities without exposing cryptographic keys to the network stack.
WhatsApp connects through the official Cloud API, enabling template messages, media handling, and two-way synchronization for customer support workflows.
iMessage requires native macOS database access and supports conversation import and read receipts, making it suitable for Apple-centric automation workflows.
IRC uses the classic IRC protocol with channel and nickname management features, serving legacy chat room integrations and bot implementations.
Email (via tinychannels/email) operates over SMTP/IMAP protocols, providing threaded conversations and attachments as a fallback for long-form messaging.
Configuration and Security Model
Each provider requires a TOML configuration section in config.toml (e.g., [[channels.telegram]] for Telegram settings). These sections store API keys, webhook URLs, and optional default parameters.
When credentials are missing or malformed, the channel's RPC methods return a CHANNEL_NOT_CONFIGURED error, prompting the UI to request user input through the web interface.
Security enforcement follows the standard agent tool policy. Channel interactions require:
Networkpermission class for external API callsWritepermission class for workspace modificationsDestructivepermission class for destructive operations like bulk deletion
The approval gate, enabled by default, surfaces interactive prompts for any operation exceeding the current autonomy tier.
Implementation Examples
Listing configured channels using the Rust core:
use openhuman::core::rpc::RpcOutcome;
use openhuman::channels::controller::list_channels;
// Inside an async handler
let result: RpcOutcome<Vec<String>> = list_channels(&ctx).await?;
Sending a message via the frontend TypeScript client:
import { coreRpcClient } from '@/services/coreRpcClient';
async function sendTelegram() {
await coreRpcClient.call('channel_send_message', {
channel_id: 'telegram',
chat_id: '@mygroup',
text: 'Hello from Open Human!',
});
}
Fetching conversation history from Slack:
use openhuman::channels::slack::client::SlackClient;
let client = SlackClient::new(&config)?;
let history = client.fetch_conversation_history("C12345678", 50).await?;
Key Source Files and Module Structure
Understanding the codebase organization helps developers extend the framework:
src/openhuman/channels/mod.rs– The entry point that conditionally compiles each provider modulesrc/openhuman/channels/telegram.rs– Telegram Bot API implementation with webhook registrationsrc/openhuman/channels/discord.rs– Discord gateway connection and event dispatchsrc/openhuman/channels/slack.rs– OAuth flows and Slack Web API clientsrc/openhuman/channels/webview_accounts.rs– UI glue for OAuth redirect flowssrc/openhuman/channels/whatsapp_data.rs– WhatsApp event parsing and data mappingsrc/openhuman/core/all.rs– Controller registration and RPC routing setupsrc/openhuman/config/schema/channels.rs– TOML serialization structures for channel configuration
Summary
- OpenHuman messaging channels abstract Telegram, Discord, Slack, Signal, WhatsApp, iMessage, IRC, and Email behind a unified JSON-RPC interface.
- Each channel implements a specific protocol (Bot API, Gateway, Signal-CLI, etc.) while exposing standard methods like
send_messageandfetch_history. - Configuration occurs through TOML sections in
config.toml, with missing credentials triggeringCHANNEL_NOT_CONFIGUREDerrors. - Security policies enforce
Network,Write, andDestructivepermission classes, with interactive approval gates for sensitive operations. - New providers can be added by implementing a module under
src/openhuman/channels/and registering controllers insrc/openhuman/core/all.rs.
Frequently Asked Questions
What is the difference between OpenHuman messaging channels and direct API integrations?
OpenHuman messaging channels provide a standardized RPC layer that abstracts protocol-specific details, whereas direct API integrations require handling authentication, rate limiting, and data formats individually for each platform. The channel_send_message method works identically across Telegram, Discord, and Slack, while the underlying implementations in src/openhuman/channels/ handle platform-specific formatting and transport.
How does OpenHuman handle security for messaging operations?
All channel interactions pass through the security policy system defined in the core runtime. Operations requiring network access need the Network permission class, while writing to conversations requires Write permissions. Destructive actions like bulk deletion trigger additional Destructive class checks and interactive approval prompts when the autonomy gate is enabled.
Can I add custom messaging channels to OpenHuman?
Yes, the modular architecture supports custom channels. Create a new Rust module under src/openhuman/channels/, implement the required RPC controller methods (such as send_message and list_conversations), and register the controller in src/openhuman/core/all.rs. The channel will automatically inherit the security framework and configuration schema validation.
Why does Signal require a local binary while other channels use HTTPS APIs?
Signal uses the Signal-CLI local binary to maintain end-to-end encryption without exposing decryption keys to the OpenHuman process or network stack. This architecture ensures that sensitive cryptographic operations remain isolated within the Signal daemon, whereas channels like Telegram and Slack rely on server-side APIs where encryption terminates at the vendor's infrastructure.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →