Skip to content

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 process
  • bindings: route inbound messages by channel + accountId (+peer) to a target agentId
  • session.dmScope: DM isolation strategy
  • session.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.dmScope accepts only these 4 values:

ValueIsolation
mainAll DMs share one session
per-peerOne session per peer
per-channel-peerOne session per channel + peer
per-account-channel-peerFull isolation per account + channel + peer

Binding Match Semantics

bindings are processed in array order — first matching rule wins.

  • match.channel is required
  • match.accountId: omit = match default only, "*" = match all
  • match.peer: omit = match all peers
  • No match = falls back to default agent
  1. Keep main as the default fallback role
  2. Add specialist agents (engineer, ops, support)
  3. Route with bindings (channel/account/peer based)
  4. Use dmScope="per-account-channel-peer" for multi-account isolation
  5. Set maxPingPongTurns=0 first, increase only when needed

Released under the MIT License.