Channel Plugins

One-line summary

The channel plugin system defines a modular adapter-based contract (ChannelPlugin) that 38 messaging extensions implement to connect platforms like Telegram, Discord, Slack, Signal, and iMessage to OpenClaw.

Responsibilities

  • Define the ChannelPlugin interface with ~20 optional adapter slots
  • Manage plugin registration, loading, and lifecycle
  • Normalize inbound messages from diverse platform formats
  • Route outbound replies to the correct platform API
  • Handle platform-specific features (threading, reactions, inline buttons, pairing, onboarding)

Architecture diagram

Key source files

FileLinesRole
src/channels/plugins/types.plugin.ts85Core contract: ChannelPlugin type with ~20 adapter slots
src/channels/plugins/types.core.ts371Core types: ChannelMeta, ChannelCapabilities, ChannelAccountSnapshot
src/channels/plugins/types.adapters.ts310Adapter interfaces: config, setup, security, outbound, status, threading, etc.
src/channels/plugins/index.tsPlugin registry and loader
src/channels/plugins/catalog.tsBuilt-in channel plugin catalog

ChannelPlugin adapter slots

AdapterPurposeRequired
configAccount/channel configurationYes
metaChannel metadata (name, icon)Yes
capabilitiesFeature flags (inline buttons, reactions)Yes
securitySender verification, message trustNo
outboundReply delivery to platformNo
setupInitial channel setup flowNo
pairingAccount pairing flowNo
onboardingCLI onboarding wizardNo
groupsGroup chat managementNo
mentionsMention handlingNo
threadingThread supportNo
streamingReal-time streaming supportNo
messagingCross-session messagingNo
gatewayGateway HTTP/WS methodsNo
authOAuth/token authenticationNo
elevatedElevated permission handlingNo
commandsPlatform-specific commandsNo
agentPromptCustom agent prompt sectionsNo
directoryUser/group directoryNo
heartbeatHeartbeat customizationNo
agentToolsCustom tools for this channelNo

How it connects to other modules

  • Depends on: config/ (channel settings), plugin-sdk/ (stable API)
  • Depended by: auto-reply/ (inbound dispatch), gateway/ (webhook routing), routing/ (channel resolution)

My blind spots

  • Plugin loading order and conflict resolution
  • How configSchema enables UI-driven channel configuration
  • reload.configPrefixes — hot-reload behavior on config changes
  • agentTools — how channel-specific tools integrate with the tool policy pipeline

Change frequency

  • types.plugin.ts: Low — core contract is stable; new adapters are additive
  • types.adapters.ts: Medium — adapter interfaces evolve with platform features
  • Extension plugins: High — individual channels updated frequently