Documentation Index
Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
channels.* 下的每频道配置键。涵盖 DM 和群组访问、
多账号设置、提及门控,以及 Slack、Discord、
Telegram、WhatsApp、Matrix、iMessage 和其他捆绑频道插件的每频道密钥。
关于 agent、工具、gateway runtime 以及其他顶层键,请参见
配置参考。
Channels
只要某个频道的配置段存在,每个频道就会自动启动(除非enabled: false)。
DM 和群组访问
所有频道都支持 DM 策略和群组策略:| DM policy | 行为 |
|---|---|
pairing (default) | 未知发送者会得到一次性配对码;所有者必须批准 |
allowlist | 仅允许 allowFrom(或已配对的 allow store)中的发送者 |
open | 允许所有入站 DM(需要 allowFrom: ["*"]) |
disabled | 忽略所有入站 DM |
| Group policy | 行为 |
|---|---|
allowlist (default) | 仅允许与已配置 allowlist 匹配的群组 |
open | 绕过群组 allowlist(但仍适用提及门控) |
disabled | 阻止所有群组/房间消息 |
channels.defaults.groupPolicy 会在 provider 的 groupPolicy 未设置时设定默认值。
配对码在 1 小时后过期。待处理的 DM 配对请求上限为每个频道 3 个。
如果 provider 块完全缺失(channels.<provider> 不存在),运行时 group policy 会回退到 allowlist(fail-closed),并在启动时给出警告。Channel model overrides
使用channels.modelByChannel 将特定频道 ID 固定到某个模型。值可以是 provider/model 或已配置的模型别名。当会话已经没有模型覆盖时(例如通过 /model 设置),会应用频道映射。
Channel defaults and heartbeat
使用channels.defaults 为跨 provider 的共享 group-policy 和 heartbeat 行为进行设置:
channels.defaults.groupPolicy:当 provider 级groupPolicy未设置时的回退群组策略。channels.defaults.contextVisibility:所有频道的默认补充上下文可见性模式。取值:all(默认,包含所有引用/线程/历史上下文)、allowlist(仅包含来自 allowlist 中发送者的上下文)、allowlist_quote(同 allowlist,但保留显式引用/回复上下文)。每频道覆盖:channels.<channel>.contextVisibility。channels.defaults.heartbeat.showOk:在 heartbeat 输出中包含健康的频道状态。channels.defaults.heartbeat.showAlerts:在 heartbeat 输出中包含降级/错误状态。channels.defaults.heartbeat.useIndicator:渲染紧凑的指示器风格 heartbeat 输出。
多账号 WhatsApp
多账号 WhatsApp
- 出站命令默认使用
default账号(如果存在);否则使用排序后的第一个已配置账号 id。 - 可选的
channels.whatsapp.defaultAccount会在其与已配置账号 id 匹配时覆盖该回退默认账号选择。 - 旧的单账号 Baileys auth dir 会由
openclaw doctor迁移到whatsapp/default。 - 每账号覆盖:
channels.whatsapp.accounts.<id>.sendReadReceipts、channels.whatsapp.accounts.<id>.dmPolicy、channels.whatsapp.accounts.<id>.allowFrom。
Telegram
- Bot token:
channels.telegram.botTokenorchannels.telegram.tokenFile(regular file only; symlinks rejected), withTELEGRAM_BOT_TOKENas fallback for the default account. apiRootis the Telegram Bot API root only. Usehttps://api.telegram.orgor your self-hosted/proxy root, nothttps://api.telegram.org/bot<TOKEN>;openclaw doctor --fixremoves an accidental trailing/bot<TOKEN>suffix.- Optional
channels.telegram.defaultAccountoverrides default account selection when it matches a configured account id. - In multi-account setups (2+ account ids), set an explicit default (
channels.telegram.defaultAccountorchannels.telegram.accounts.default) to avoid fallback routing;openclaw doctorwarns when this is missing or invalid. configWrites: falseblocks Telegram-initiated config writes (supergroup ID migrations,/config set|unset).- Top-level
bindings[]entries withtype: "acp"configure persistent ACP bindings for forum topics (use canonicalchatId:topic:topicIdinmatch.peer.id). Field semantics are shared in ACP Agents. - Telegram stream previews use
sendMessage+editMessageText(works in direct and group chats). - Retry policy: see Retry policy.
Discord
- Token:
channels.discord.token, withDISCORD_BOT_TOKENas fallback for the default account. - Direct outbound calls that provide an explicit Discord
tokenuse that token for the call; account retry/policy settings still come from the selected account in the active runtime snapshot. - Optional
channels.discord.defaultAccountoverrides default account selection when it matches a configured account id. - Use
user:<id>(DM) orchannel:<id>(guild channel) for delivery targets; bare numeric IDs are rejected. - Guild slugs are lowercase with spaces replaced by
-; channel keys use the slugged name (no#). Prefer guild IDs. - Bot-authored messages are ignored by default.
allowBots: trueenables them; useallowBots: "mentions"to only accept bot messages that mention the bot (own messages still filtered). channels.discord.guilds.<id>.ignoreOtherMentions(and channel overrides) drops messages that mention another user or role but not the bot (excluding @everyone/@here).channels.discord.mentionAliasesmaps stable outbound@handletext to Discord user IDs before sending, so known teammates can be mentioned deterministically even when the transient directory cache is empty. Per-account overrides live underchannels.discord.accounts.<accountId>.mentionAliases.maxLinesPerMessage(default 17) splits tall messages even when under 2000 chars.channels.discord.threadBindingscontrols Discord thread-bound routing:enabled: Discord override for thread-bound session features (/focus,/unfocus,/agents,/session idle,/session max-age, and bound delivery/routing)idleHours: Discord override for inactivity auto-unfocus in hours (0disables)maxAgeHours: Discord override for hard max age in hours (0disables)spawnSessions: switch forsessions_spawn({ thread: true })and ACP thread-spawn auto thread creation/binding (default:true)defaultSpawnContext: native subagent context for thread-bound spawns ("fork"by default)
- Top-level
bindings[]entries withtype: "acp"configure persistent ACP bindings for channels and threads (use channel/thread id inmatch.peer.id). Field semantics are shared in ACP Agents. channels.discord.ui.components.accentColorsets the accent color for Discord components v2 containers.channels.discord.voiceenables Discord voice channel conversations and optional auto-join + LLM + TTS overrides. Text-only Discord configs leave voice off by default; setchannels.discord.voice.enabled=trueto opt in.channels.discord.voice.modeloptionally overrides the LLM model used for Discord voice channel responses.channels.discord.voice.daveEncryptionandchannels.discord.voice.decryptionFailureTolerancepass through to@discordjs/voiceDAVE options (trueand24by default).channels.discord.voice.connectTimeoutMscontrols the initial@discordjs/voiceReady wait for/vc joinand auto-join attempts (30000by default).channels.discord.voice.reconnectGraceMscontrols how long a disconnected voice session may take to enter reconnect signalling before OpenClaw destroys it (15000by default).- OpenClaw additionally attempts voice receive recovery by leaving/rejoining a voice session after repeated decrypt failures.
channels.discord.streamingis the canonical stream mode key. LegacystreamModeand booleanstreamingvalues are auto-migrated.channels.discord.autoPresencemaps runtime availability to bot presence (healthy => online, degraded => idle, exhausted => dnd) and allows optional status text overrides.channels.discord.dangerouslyAllowNameMatchingre-enables mutable name/tag matching (break-glass compatibility mode).channels.discord.execApprovals: Discord-native exec approval delivery and approver authorization.enabled:true,false, or"auto"(default). In auto mode, exec approvals activate when approvers can be resolved fromapproversorcommands.ownerAllowFrom.approvers: Discord user IDs allowed to approve exec requests. Falls back tocommands.ownerAllowFromwhen omitted.agentFilter: optional agent ID allowlist. Omit to forward approvals for all agents.sessionFilter: optional session key patterns (substring or regex).target: where to send approval prompts."dm"(default) sends to approver DMs,"channel"sends to the originating channel,"both"sends to both. When target includes"channel", buttons are only usable by resolved approvers.cleanupAfterResolve: whentrue, deletes approval DMs after approval, denial, or timeout.
off(无)、own(机器人的消息,默认)、all(所有消息)、allowlist(来自 guilds.<id>.users 的所有消息)。
Google Chat
- Service account JSON:可内联(
serviceAccount)或基于文件(serviceAccountFile)。 - 也支持 Service account SecretRef(
serviceAccountRef)。 - 环境变量回退:
GOOGLE_CHAT_SERVICE_ACCOUNT或GOOGLE_CHAT_SERVICE_ACCOUNT_FILE。 - 投递目标使用
spaces/<spaceId>或users/<userId>。 channels.googlechat.dangerouslyAllowNameMatching重新启用可变 email principal 匹配(break-glass 兼容模式)。
Slack
- Socket mode 需要同时提供
botToken和appToken(默认账号环境变量回退使用SLACK_BOT_TOKEN+SLACK_APP_TOKEN)。 - HTTP mode 需要
botToken加signingSecret(在根级或每账号级)。 socketMode将 Slack SDK Socket Mode 的传输调优透传给公开的 Bolt receiver API。仅在排查 ping/pong 超时或 websocket 陈旧行为时使用。botToken、appToken、signingSecret和userToken可接受明文字符串或 SecretRef 对象。- Slack 账号快照会暴露每个凭证的 source/status 字段,例如
botTokenSource、botTokenStatus、appTokenStatus,以及在 HTTP mode 下的signingSecretStatus。configured_unavailable表示该账号已通过 SecretRef 配置,但当前命令/runtime 路径无法解析出 secret 值。 configWrites: false会阻止 Slack 触发的配置写入。- 可选的
channels.slack.defaultAccount会在其与已配置账号 id 匹配时覆盖默认账号选择。 channels.slack.streaming.mode是规范的 Slack 流模式键。channels.slack.streaming.nativeTransport控制 Slack 的原生流式传输。旧的streamMode、布尔型streaming和nativeStreaming值会自动迁移。- 使用
user:<id>(DM)或channel:<id>作为投递目标。
off、own(默认)、all、allowlist(来自 reactionAllowlist)。
Thread session isolation: thread.historyScope 可以是 per-thread(默认)或 shared across channel。thread.inheritParent 会把父 channel 的会话记录复制到新线程。
- Slack native streaming plus the Slack assistant-style “is typing…” thread status require a reply thread target. Top-level DMs stay off-thread by default, so they can still stream through Slack draft post-and-edit previews instead of showing the thread-style native stream/status preview.
typingReactionadds a temporary reaction to the inbound Slack message while a reply is running, then removes it on completion. Use a Slack emoji shortcode such as"hourglass_flowing_sand".channels.slack.execApprovals: Slack-native exec approval delivery and approver authorization. Same schema as Discord:enabled(true/false/"auto"),approvers(Slack user IDs),agentFilter,sessionFilter, andtarget("dm","channel", or"both").
| Action group | 默认 | 说明 |
|---|---|---|
| reactions | enabled | React + 列出 reactions |
| messages | enabled | 读/发/编辑/删除 |
| pins | enabled | 置顶/取消置顶/列出 |
| memberInfo | enabled | 成员信息 |
| emojiList | enabled | 自定义 emoji 列表 |
Mattermost
Mattermost ships as a bundled plugin in current OpenClaw releases. Older or custom builds can install a current npm package withopenclaw plugins install @openclaw/mattermost. Check
npmjs.com/package/@openclaw/mattermost
for the current dist-tags before pinning a version.
oncall(在 @-mention 时响应,默认)、onmessage(每条消息)、onchar(以触发前缀开头的消息)。
启用 Mattermost 原生命令时:
commands.callbackPath必须是路径(例如/api/channels/mattermost/command),不能是完整 URL。commands.callbackUrl必须解析到 OpenClaw gateway 端点,并且 Mattermost 服务器可以访问。- 原生 slash 回调使用 Mattermost 在 slash command 注册期间返回的每命令 token 进行认证。如果注册失败或没有激活任何命令,OpenClaw 会以
Unauthorized: invalid command token.拒绝回调。 - 对于私有/tailnet/internal 回调主机,Mattermost 可能要求
ServiceSettings.AllowedUntrustedInternalConnections包含回调主机/域名。 请使用主机/域名值,不要使用完整 URL。 channels.mattermost.configWrites:允许或拒绝 Mattermost 触发的配置写入。channels.mattermost.requireMention:在频道中回复前是否需要@mention。channels.mattermost.groups.<channelId>.requireMention:每频道 mention 门控覆盖(默认使用"*")。- 可选的
channels.mattermost.defaultAccount会在其与已配置账号 id 匹配时覆盖默认账号选择。
Signal
off、own(默认)、all、allowlist(来自 reactionAllowlist)。
channels.signal.account:将频道启动固定到特定的 Signal 账号身份。channels.signal.configWrites:允许或拒绝 Signal 触发的配置写入。- 可选的
channels.signal.defaultAccount会在其与已配置账号 id 匹配时覆盖默认账号选择。
BlueBubbles
BlueBubbles 是推荐的 iMessage 路径(由插件支持,在channels.bbluebubbles 下配置)。
- Core key paths covered here:
channels.bluebubbles,channels.bluebubbles.dmPolicy. - Optional
channels.bluebubbles.defaultAccountoverrides default account selection when it matches a configured account id. - Top-level
bindings[]entries withtype: "acp"can bind BlueBubbles conversations to persistent ACP sessions. Use a BlueBubbles handle or target string (chat_id:*,chat_guid:*,chat_identifier:*) inmatch.peer.id. Shared field semantics: ACP Agents. - Full BlueBubbles channel configuration is documented in BlueBubbles.
iMessage
OpenClaw 会启动imsg rpc(通过 stdio 的 JSON-RPC)。不需要 daemon 或端口。
-
可选的
channels.imessage.defaultAccount会在其与已配置账号 id 匹配时覆盖默认账号选择。 - Requires Full Disk Access to the Messages DB.
-
Prefer
chat_id:<id>targets. Useimsg chats --limit 20to list chats. -
cliPathcan point to an SSH wrapper; setremoteHost(hostoruser@host) for SCP attachment fetching. -
attachmentRootsandremoteAttachmentRootsrestrict inbound attachment paths (default:/Users/*/Library/Messages/Attachments). -
SCP uses strict host-key checking, so ensure the relay host key already exists in
~/.ssh/known_hosts. -
channels.imessage.configWrites: allow or deny iMessage-initiated config writes. -
Top-level
bindings[]entries withtype: "acp"can bind iMessage conversations to persistent ACP sessions. Use a normalized handle or explicit chat target (chat_id:*,chat_guid:*,chat_identifier:*) inmatch.peer.id. Shared field semantics: ACP Agents.
iMessage SSH wrapper example
iMessage SSH wrapper example
Matrix
Matrix 由插件支持,并在channels.matrix 下配置。
- Token 认证使用
accessToken;密码认证使用userId+password。 channels.matrix.proxy会通过显式 HTTP(S) 代理路由 Matrix HTTP 流量。命名账号可通过channels.matrix.accounts.<id>.proxy覆盖它。channels.matrix.network.dangerouslyAllowPrivateNetwork允许私有/内部 homeserver。proxy和该网络显式启用是彼此独立的控制项。channels.matrix.defaultAccount会在多账号设置中选择首选账号。channels.matrix.autoJoin默认为off,因此被邀请的 room 和新的 DM 风格邀请会被忽略,直到你将autoJoin: "allowlist"搭配autoJoinAllowlist,或将其设为autoJoin: "always"。channels.matrix.execApprovals:Matrix 原生执行审批的投递与审批者授权。enabled:true、false或"auto"(默认)。在 auto 模式下,当可以从approvers或commands.ownerAllowFrom解析审批者时,exec approvals 会激活。approvers:允许批准 exec 请求的 Matrix 用户 ID(例如@owner:example.org)。agentFilter:可选的 agent ID allowlist。省略则转发所有 agent 的审批。sessionFilter:可选的 session key 模式(子串或正则)。target:审批提示的发送位置。"dm"(默认)、"channel"(来源 room)或"both"。- 每账号覆盖:
channels.matrix.accounts.<id>.execApprovals。
channels.matrix.dm.sessionScope控制 Matrix DM 如何分组为会话:per-user(默认)按路由 peer 共享,而per-room会隔离每个 DM room。- Matrix 状态探测和实时目录查询使用与运行时流量相同的代理策略。
- 完整的 Matrix 配置、投递目标规则和设置示例见 Matrix。
Microsoft Teams
Microsoft Teams 由插件支持,并在channels.msteams 下配置。
- 此处涵盖的核心键路径:
channels.msteams、channels.msteams.configWrites。 - 完整的 Teams 配置(凭证、webhook、DM/group policy、每团队/每频道覆盖)见 Microsoft Teams。
IRC
IRC 由插件支持,并在channels.irc 下配置。
- 此处涵盖的核心键路径:
channels.irc、channels.irc.dmPolicy、channels.irc.configWrites、channels.irc.nickserv.*。 - 可选的
channels.irc.defaultAccount会在其与已配置账号 id 匹配时覆盖默认账号选择。 - 完整的 IRC 频道配置(host/port/TLS/channels/allowlists/mention gating)见 IRC。
Multi-account (all channels)
每个频道可运行多个账号(每个都有自己的accountId):
- 当省略
accountId时使用default(CLI + 路由)。 - 环境变量 token 仅适用于默认账号。
- 基础频道设置适用于所有账号,除非按账号覆盖。
- 使用
bindings[].match.accountId将每个账号路由到不同的 agent。 - 如果你在仍处于单账号顶层频道配置时,通过
openclaw channels add(或 channel onboarding)添加非默认账号,OpenClaw 会先把账号作用域的顶层单账号值提升到频道账号映射中,这样原始账号仍可继续工作。大多数频道会将它们移动到channels.<channel>.accounts.default;Matrix 也可以改为保留现有匹配的 named/default 目标。 - 现有的仅频道绑定(没有
accountId)会继续匹配默认账号;账号作用域绑定仍然是可选的。 openclaw doctor --fix也会通过把账号作用域的顶层单账号值移动到该频道选定的提升账号来修复混合结构。大多数频道使用accounts.default;Matrix 也可以保留现有匹配的 named/default 目标。
Other plugin channels
许多插件频道配置为channels.<id>,并在各自专门的频道页面中记录(例如 Feishu、Matrix、LINE、Nostr、Zalo、Nextcloud Talk、Synology Chat 和 Twitch)。
查看完整频道索引:Channels。
Group chat mention gating
群组消息默认需要提及(元数据提及或安全正则模式)。适用于 WhatsApp、Telegram、Discord、Google Chat 和 iMessage 群聊。 Visible replies are controlled separately. Group/channel rooms default tomessages.groupChat.visibleReplies: "message_tool": OpenClaw still processes the turn, but normal final replies stay private and visible room output requires message(action=send). Set "automatic" only when you want the legacy behavior where normal replies are posted back to the room. To apply the same tool-only visible-reply behavior to direct chats too, set messages.visibleReplies: "message_tool"; the Codex harness also uses that tool-only behavior as its unset direct-chat default.
If the message tool is unavailable under the active tool policy, OpenClaw falls back to automatic visible replies instead of silently suppressing the response. openclaw doctor warns about this mismatch.
The gateway hot-reloads messages config after the file is saved. Restart only when file watching or config reload is disabled in the deployment.
Mention types:
- Metadata mentions:原生平台 @-mentions。在 WhatsApp self-chat mode 中会被忽略。
- Text patterns:
agents.list[].groupChat.mentionPatterns中的安全正则模式。无效模式和不安全的嵌套重复会被忽略。 - 只有在能够检测到时才会强制提及门控(原生 mentions 或至少一个模式)。
messages.groupChat.historyLimit 设置全局默认值。频道可以通过 channels.<channel>.historyLimit(或每账号)覆盖。设为 0 可禁用。
messages.visibleReplies 是全局 source-turn 默认值;messages.groupChat.visibleReplies 会为 group/channel source turns 覆盖它。若未设置 messages.visibleReplies,harness 可以提供自己的 direct/source 默认值;Codex harness 默认为 message_tool。频道 allowlist 和提及门控仍会决定是否处理该轮消息。
DM history limits
telegram、whatsapp、discord、slack、signal、imessage、msteams。
Self-chat mode
在allowFrom 中包含你自己的号码以启用 self-chat mode(忽略原生 @-mentions,只响应文本模式):
Commands (chat command handling)
命令详情
命令详情