OpenClaw Feishu Multi-Agent
name: openclaw-feishu-multi-agent
by ccharlesmeng · published 2026-03-22
$ claw add gh:ccharlesmeng/ccharlesmeng-openclaw-feishu-multi-agent---
name: openclaw-feishu-multi-agent
description: Build and troubleshoot OpenClaw multi-agent workflows on Feishu. This skill teaches coordinator and specialist agents to combine visible `<at>` mentions with `sessions_send` so delegation, handoffs, and multi-hop discussions work reliably in group chats. Use it to scaffold new setups, audit existing configs, repair broken session metadata, and generate reusable role-based artifacts.
---
# OpenClaw Feishu Multi-Agent
Goal
让 OpenClaw 的多个独立 agent 在同一个飞书群里协作:
先判断是哪种场景
场景 A:用户已经有多 agent
优先检查并修复:
1. `~/.openclaw/openclaw.json`
2. `~/.openclaw/PROTOCOL.md`
3. 各 agent 的 `IDENTITY.md` / `SOUL.md`
4. 会话存储是否把 Feishu 群上下文写坏
5. gateway 重启后是否恢复
场景 B:用户还没有多 agent
先帮助用户定义角色表,再补齐:
1. agent roster
2. Feishu account bindings
3. 协调协议
4. 各 agent 身份文件
5. 验证话术
核心规则
规则 1
飞书里的 `<at>` 只是“给人看见谁被点名了”。
规则 2
OpenClaw 里的 `sessions_send` 才是“真正唤醒另一个 agent”。
规则 3
每一次委派都必须同时做两步:
1. 在飞书群里发可视化 `<at>`
2. 用 `sessions_send` 向目标 agent 投递任务
少一步都不算成功。
规则 4
`sessions_send` 默认使用 `sessionKey`:
agent:{targetAgentId}:feishu:group:oc_xxx不要给 `sessions_send` 传 `agentId`。
推荐实施顺序
1. 盘点角色、agentId、Feishu accountId、Open ID、职责和触发词
2. 标准化 `~/.openclaw/PROTOCOL.md`
3. 把协调者 agent 写成“默认总调度”
4. 把专业 agent 写成“收到 sessions_send 后直接回群”
5. 检查 `openclaw.json` 的 `agents.list`、`bindings`、`tools.agentToAgent.allow`
6. 检查群 session 是否保持 `channel=feishu`、`chatType=group`
7. 重启 gateway
8. 用真实飞书话术验证
角色设计要求
不要把方案写死成 Steve / Jonathan / Brendan / Seth。
始终把角色抽象成:
角色名、人设、职责、触发词都应该允许自定义。
你需要产出的东西
根据用户场景,通常会创建或更新:
修复时重点检查
1. 路由遗漏
如果协调者只叫了部分 agent:
2. sessions_send 超时
超时不等于没收到。继续检查:
3. 会话写坏
如果目标 agent “像是收到了,但没回群”,重点检查 session store:
参考文件
Utility Scripts
1. 统一入口
优先使用统一入口,避免记多个脚本名:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/manage_feishu_multi_agent.py" --help如果想一把跑完“生成 -> 落地 -> 审计”:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/manage_feishu_multi_agent.py" bootstrap \
--roles ".cursor/skills/openclaw-feishu-multi-agent/roles.example.json" \
--output-dir "/tmp/openclaw-feishu-artifacts" \
--apply-identities加上 `--write --backup` 才会真正写入 `~/.openclaw/`。
2. 生成可落地模板
当用户还没配好多 agent,或希望把角色表转换成可落地文档时,运行:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/render_feishu_multi_agent.py" \
--roles ".cursor/skills/openclaw-feishu-multi-agent/roles.example.json" \
--output-dir "/tmp/openclaw-feishu-artifacts"产出:
`openclaw.generated.json` 现在会同时带出:
3. 审计现有配置
当用户已经有多 agent,想快速检查 `openclaw.json` 是否与角色表一致时,运行:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/audit_feishu_multi_agent.py" \
--roles "/path/to/roles.json" \
--config "~/.openclaw/openclaw.json"重点检查:
4. 半自动落地到 `~/.openclaw/`
当用户希望把角色表直接应用到自己的 OpenClaw 环境时,先 dry-run:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/apply_feishu_multi_agent.py" \
--roles "/path/to/roles.json" \
--apply-identities确认无误后再写入:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/apply_feishu_multi_agent.py" \
--roles "/path/to/roles.json" \
--apply-identities \
--write --backup这个脚本会:
5. 修复 Feishu 群 session
当某个 agent “像是收到了,但没回群”,优先检查并按需修复 session metadata:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/repair_feishu_group_sessions.py" \
--roles "/path/to/roles.json" \
--group-id "oc_xxx"如需直接写回:
python ".cursor/skills/openclaw-feishu-multi-agent/scripts/repair_feishu_group_sessions.py" \
--roles "/path/to/roles.json" \
--group-id "oc_xxx" \
--fix --backup交付风格
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...