在单个 OpenClaw实例中配置多个飞书/Lark 机器人身份,每个 Agent 拥有自己的飞书应用、名称、头像和消息路由。使用...
One OpenClaw instance, multiple Feishu bot identities. Each Agent appears as an independent bot in Feishu — own name, own avatar, own group memberships. Users see separate assistants; behind the scenes, a single Gateway dispatches everything.
text
OpenClaw Gateway (single instance)
├── Agent: orchestrator ←→ Feishu App 1 (总调度 bot)
├── Agent: content-writer ←→ Feishu App 2 (写作 bot)
├── Agent: code-expert ←→ Feishu App 3 (开发 bot)
└── Agent: analyst ←→ Feishu App 4 (分析 bot)
Three configuration blocks must align:
BlockLocation in openclaw.jsonPurposechannels.feishu.accountsFeishu credentials per botMaps accountId → appId/appSecretbindingsMessage routing rulesMaps accountId → agentIdagents.listAgent definitionsMaps agentId → workspace/model/tools
The accountId is the key that ties them together. Get it wrong in any one place and routing breaks silently.
One enterprise app per Agent at open.feishu.cn/app. Enable "Bot" capability. Record each app's AppID and AppSecret.
bash
scripts/setup-feishu-bots.sh orchestrator:cli_xxx:secret1 writer:cli_yyy:secret2 coder:cli_zzz:secret3
Generates the three JSON blocks ready to paste into openclaw.json.
Add the generated config to openclaw.json, then:
bash
openclaw doctor && openclaw gateway restart
Send a message to each Feishu bot independently. Verify each responds with the correct Agent identity.
FileRead when...references/architecture.mdUnderstanding the three-block config model, accountId mechanism, and channel layer designreferences/build-guide.mdSetting up from scratch — Feishu developer console through gateway restart, step by stepreferences/routing-deep-dive.mdDebugging routing issues — accountId consistency checks, binding rules, group-based isolationreferences/troubleshooting.mdFixing specific problems — gateway won't start, bot not responding, wrong agent, spawn conflicts
1. accountId must match in 3 places: channels.feishu.accounts.{key}, bindings[].match.accountId, and the agent field inside the account config. One typo = silent routing failure.
2. Binding type must be "route": Using "delivery" or any other value causes gateway startup failure with no helpful error message.
3. Feishu apps must be published: Draft-state apps cannot receive messages. This is the #1 "bot not responding" cause.
4. allowAgents must be complete: If your orchestrator spawns sub-agents, every spawnable agent ID must be in allowAgents. New agent added but not listed = spawn permission error.
5. agentToAgent must stay OFF: Enabling agentToAgent.enabled: true breaks all sub-agent spawning (known bug #5813). Keep it false.
See references/troubleshooting.md for the full diagnostic flowchart.
ScriptUsagescripts/setup-feishu-bots.sh``./setup-feishu-bots.sh <agentId:appId:appSecret> ... — Generates channels, bindings, and agents.list JSON blocks