Multi-Agent Routing
You can configure OpenClaw-style multi-agent runtime behavior in the UI (Routing & Runtime) or in config.json.
Key Settings
agents.list: run multiple resident agent roles in one gateway processbindings: route inbound messages bychannel + accountId (+peer)to a targetagentIdsession.dmScope: DM isolation strategysession.agentToAgent.maxPingPongTurns: cap cross-agent ping-pong loops
Example Config
json
{
"agents": {
"defaults": { "model": "openai/gpt-5.2-codex" },
"list": [
{ "id": "main", "default": true },
{ "id": "engineer", "workspace": "~/workspace-engineer", "model": "openai/gpt-5.2-codex" }
]
},
"bindings": [
{
"agentId": "engineer",
"match": {
"channel": "discord",
"accountId": "default",
"peer": { "kind": "channel", "id": "dev-room" }
}
}
],
"session": {
"dmScope": "per-account-channel-peer",
"agentToAgent": { "maxPingPongTurns": 0 }
}
}DM Scope Values
⚠️
session.dmScopeaccepts only these 4 values:
| Value | Isolation |
|---|---|
main | All DMs share one session |
per-peer | One session per peer |
per-channel-peer | One session per channel + peer |
per-account-channel-peer | Full isolation per account + channel + peer |
Binding Match Semantics
bindings are processed in array order — first matching rule wins.
match.channelis requiredmatch.accountId: omit = matchdefaultonly,"*"= match allmatch.peer: omit = match all peers- No match = falls back to default agent
Recommended Setup
- Keep
mainas the default fallback role - Add specialist agents (
engineer,ops,support) - Route with
bindings(channel/account/peer based) - Use
dmScope="per-account-channel-peer"for multi-account isolation - Set
maxPingPongTurns=0first, increase only when needed