頻道與路由
- OpenClaw 會將回覆送回訊息來源的原頻道。 The model does not choose a channel; routing is deterministic and controlled by the host configuration.
關鍵術語
- Channel:
whatsapp、telegram、discord、slack、signal、imessage、webchat。 - AccountId:每個頻道的帳戶實例(若支援)。
- AgentId:隔離的工作區 + 工作階段儲存(「大腦」)。
- SessionKey:用於儲存脈絡並控制併發的桶鍵。
工作階段鍵的形狀(範例)
私訊會合併到代理程式的主要工作階段:agent:<agentId>:<mainKey>(預設:agent:main:main)
- 群組:
agent:<agentId>:<channel>:group:<id> - 頻道/房間:
agent:<agentId>:<channel>:channel:<id>
- Slack/Discord 的執行緒會在基礎鍵後附加
:thread:<threadId>。 - Telegram 論壇主題會將
:topic:<topicId>內嵌於群組鍵中。
agent:main:telegram:group:-1001234567890:topic:42agent:main:discord:channel:123456:thread:987654
路由規則(如何選擇代理程式)
Routing picks one agent for each inbound message:- 精確對等匹配(
bindings搭配peer.kind+peer.id)。 - 父層對等項目比對(執行緒繼承)。
- OpenClaw 會將回覆送回訊息來源的原頻道。 The model does not choose a channel; routing is deterministic and controlled by the host configuration.
- 公會匹配(Discord),透過
guildId。 - 團隊匹配(Slack),透過
teamId。 - 帳戶匹配(頻道上的
accountId)。 - 頻道匹配(該頻道上的任何帳戶)。
- 預設代理程式(
agents.list[].default;否則取清單第一個,最後回退到main)。
peer、guildId、teamId、roles)時,所有已提供的欄位都必須符合,該綁定才會生效。
The matched agent determines which workspace and session store are used.
廣播群組(執行多個代理程式)
廣播群組可讓你在 OpenClaw 通常會回覆 的情況下,為同一對等端點執行多個代理程式(例如:在 WhatsApp 群組中,於提及/啟用閘門之後)。 設定:設定概覽
agents.list:具名的代理程式定義(工作區、模型等)。bindings: map inbound channels/accounts/peers to agents.
Session storage
Session stores live under the state directory (default~/.openclaw):
~/.openclaw/agents/<agentId>/sessions/sessions.json- JSONL transcripts live alongside the store
session.store 與 {agentId} 的樣板化來覆寫儲存路徑。
WebChat 行為
WebChat attaches to the selected agent and defaults to the agent’s main session. Because of this, WebChat lets you see cross‑channel context for that agent in one place.Reply context
入站回覆包含:- 可用時包含
ReplyToId、ReplyToBody與ReplyToSender。 - 被引用的脈絡會以
[Replying to ...]區塊的形式附加到Body。