Skip to content

LeoYeAI/agent-master-skills / skills/bengii-gemini-fix

openclaw

Flagged

Comprehensive guide for installing, configuring, operating, and troubleshooting OpenClaw — a self-hosted, multi-channel AI agent gateway. Use when the user asks about OpenClaw setup, configuration, channel management (WhatsApp/Telegram/Discord/Slack/iMessage/etc.), model provider setup, Gateway operations, multi-agent routing, security hardening, troubleshooting, or any maintenance task related to their local OpenClaw installation. Also use when encountering errors from `openclaw` CLI commands or the Gateway daemon.

FileKindSize
README.mdmarkdown7.5 KB
README_CN.mdmarkdown7.3 KB
SKILL.mdskill md18.7 KB
_meta.jsonconfig286 B
references/acp_agents.mdmarkdown12.6 KB
references/agent_runtime.mdmarkdown5.6 KB
references/architecture.mdmarkdown3.8 KB
references/automation.mdmarkdown5.8 KB
references/bonjour.mdmarkdown3.3 KB
references/browser.mdmarkdown8.5 KB
references/channel_routing.mdmarkdown4.0 KB
references/channel_troubleshooting.mdmarkdown11.6 KB
references/channels.mdmarkdown6.2 KB
references/clawhub.mdmarkdown3.6 KB
references/config_reference.mdmarkdown11.2 KB
references/diffs_firecrawl.mdmarkdown3.3 KB
references/elevated.mdmarkdown2.8 KB
references/exec.mdmarkdown6.5 KB
references/exec_approvals.mdmarkdown3.1 KB
references/gateway_internals.mdmarkdown7.7 KB
references/gateway_ops.mdmarkdown9.6 KB
references/heartbeat.mdmarkdown4.9 KB
references/hooks.mdmarkdown14.6 KB
references/install.mdmarkdown4.1 KB
references/llm_task.mdmarkdown2.6 KB
references/lobster.mdmarkdown7.8 KB
references/media.mdmarkdown4.2 KB
references/memory.mdmarkdown11.9 KB
references/model_failover.mdmarkdown3.1 KB
references/multi_agent.mdmarkdown4.4 KB
references/nodes.mdmarkdown8.8 KB
references/openprose.mdmarkdown2.6 KB
references/pairing.mdmarkdown3.1 KB
references/pdf_tool.mdmarkdown3.5 KB
references/platforms.mdmarkdown2.7 KB
references/plugins.mdmarkdown6.9 KB
references/polls.mdmarkdown2.2 KB
references/presence_discovery.mdmarkdown2.2 KB
references/providers.mdmarkdown6.0 KB
references/queue.mdmarkdown2.1 KB
references/remote_access.mdmarkdown4.7 KB
references/sandboxing.mdmarkdown5.6 KB
references/secrets.mdmarkdown5.4 KB
references/security.mdmarkdown24.5 KB
references/sessions.mdmarkdown8.9 KB
references/skills.mdmarkdown4.4 KB
references/slash_commands.mdmarkdown5.1 KB
references/streaming.mdmarkdown1.8 KB
references/subagents.mdmarkdown12.3 KB
references/thinking.mdmarkdown2.8 KB
references/tools.mdmarkdown13.3 KB
references/tui.mdmarkdown4.0 KB
references/voice.mdmarkdown2.7 KB
references/web_tools.mdmarkdown2.7 KB
references/web_ui.mdmarkdown4.5 KB

references/multi_agent.md

View on GitHub
# OpenClaw Multi-Agent Routing Reference

## Table of Contents

- [Overview](#overview)
- [What Is One Agent](#what-is-one-agent)
- [CLI Commands](#cli-commands)
- [Quick Start](#quick-start)
- [Routing Rules](#routing-rules)
- [Bindings](#bindings)
- [Per-Agent Configuration](#per-agent-configuration)
- [Examples](#examples)

## Overview

Multi-agent routing lets one Gateway serve multiple isolated agent personalities, each with its own workspace, sessions, model config, and channel bindings.

## What Is One Agent

Each agent has:
- **Workspace**: files, AGENTS.md, SOUL.md, USER.md, persona rules
- **State directory** (`agentDir`): auth profiles, model registry, per-agent config at `~/.openclaw/agents/<agentId>/agent/`
- **Session store**: chat history + routing state at `~/.openclaw/agents/<agentId>/sessions`
- **Skills**: per-agent skills in `agentDir/skills/` or shared from `~/.openclaw/skills`

## CLI Commands

```bash
openclaw agents add <id>            # Create new agent
openclaw agents list                # List agents
openclaw agents list --bindings     # Show agent-channel bindings
openclaw agents delete <id>         # Remove agent
```

## Quick Start

1. Create agent workspaces:

```bash
openclaw agents add coding
openclaw agents add social
```

2. Create channel accounts (one bot per agent for Discord/Telegram):

```bash
openclaw channels login --channel whatsapp --account work
openclaw channels add --channel telegram --account social --token $TOKEN
```

3. Add agents, accounts, and bindings to config:

```json5
{
  agents: {
    list: [
      {
        id: "coding",
        workspace: "~/.openclaw/workspace-coding",
      },
      {
        id: "social",
        workspace: "~/.openclaw/workspace-social",
      },
    ],
  },
  bindings: [
    {
      agentId: "coding",
      match: { channel: "telegram", accountId: "coding" },
    },
    {
      agentId: "social",
      match: { channel: "telegram", accountId: "social" },
    },
  ],
}
```

4. Restart and verify:

```bash
openclaw gateway restart
openclaw agents list --bindings
openclaw channels status --probe
```

## Routing Rules

Messages pick an agent via bindings (matched first → wins):

- **channel** — match channel name
- **accountId** — match channel account
- **peer.kind** — `"direct"` (DM) or `"group"`
- **peer.id** — specific sender/group ID
- **Default**: unmatched messages → `agents.defaults` (single-agent fallback)

## Bindings

```json5
{
  bindings: [
    // All Telegram "alerts" account → alert agent
    { agentId: "alerts", match: { channel: "telegram", accountId: "alerts" } },
    // Specific WhatsApp DM → personal agent
    {
      agentId: "alex",
      match: {
        channel: "whatsapp",
        peer: { kind: "direct", id: "+15551230001" },
      },
    },
    // Specific WhatsApp group → family agent
    {
      agentId: "family",
      match: {
        channel: "whatsapp",
        peer: { kind: "group", id: "group-jid@g.us" },
      },
    },
  ],
}
```

## Per-Agent Configuration

Each agent can override:
- Model (primary + fallbacks)
- Tools (profile, allow, deny)
- Sandbox settings
- Group chat mention patterns
- Heartbeat settings

```json5
{
  agents: {
    list: [{
      id: "support",
      workspace: "~/.openclaw/workspace-support",
      model: { primary: "anthropic/claude-sonnet-4-5" },
      tools: {
        profile: "messaging",
        allow: ["slack"],
      },
      groupChat: {
        mentionPatterns: ["@support"],
      },
    }],
  },
}
```

## Examples

### WhatsApp Daily Chat + Telegram Deep Work

```json5
{
  agents: {
    list: [
      { id: "daily", workspace: "~/.openclaw/workspace-daily" },
      { id: "work", workspace: "~/.openclaw/workspace-work" },
    ],
  },
  bindings: [
    { agentId: "daily", match: { channel: "whatsapp" } },
    { agentId: "work", match: { channel: "telegram" } },
  ],
}
```

### Same Channel, Specific Peer Gets Different Model

```json5
{
  agents: {
    list: [
      { id: "main" },
      { id: "opus", model: { primary: "anthropic/claude-opus-4-6" } },
    ],
  },
  bindings: [
    {
      agentId: "opus",
      match: { channel: "whatsapp", peer: { kind: "direct", id: "+1555VIP" } },
    },
  ],
}
```

### Multiple Gateways on One Host

Each needs unique port, config, and state:

```bash
OPENCLAW_CONFIG_PATH=~/.openclaw/a.json OPENCLAW_STATE_DIR=~/.openclaw-a openclaw gateway --port 19001
OPENCLAW_CONFIG_PATH=~/.openclaw/b.json OPENCLAW_STATE_DIR=~/.openclaw-b openclaw gateway --port 19002
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall