Multi Agents Orchestration
Skill by cchaojiejes
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cchaojiejes/multi-agents-orchestrationOpenClaw 多 Agent 编排方法论
本 skill 定义了 OpenClaw 多 Agent 团队的编排方法论:两种协作模式的本质区别、如何共存、配置落点、排障指南。主 Agent 在需要搭建或调整团队协作时加载此 skill。
一、两种协作模式
OpenClaw 多 Agent 协作有两条独立链路。理解它们的区别是搭建团队的前提。
模式 A:后台调度(Backend Spawn)—— 主链路
主 Agent 通过 sessions_spawn 在后台拉起子 Agent。用户只和主 Agent 对话。
用户 → 主Agent → sessions_spawn(agentId, task) → 专业Agent → 结果回传 → 主Agent汇总输出
调用示例:
sessions_spawn({
agentId: "finance",
task: "分析这份财报,给出结论、依据和风险提示",
mode: "run",
runtime: "subagent"
})
特征:
- 子任务后台完成,用户不可见
- 主 Agent 统一汇总、统一对外
- 不依赖任何 Discord 配置
- 适合研究、分析、复核、技术执行等编排型工作
模式 B:Discord @Mention —— 外显层
Agent 作为独立 Discord Bot 出现,用户或其他 Bot 通过 @ 直接触发。
Discord用户 → @某Bot → Discord Account → Gateway Binding → 对应Agent → 回复用户
特征:
- Agent 以独立身份在频道发言
- 需要额外维护 Discord token、binding、频道权限
- 适合公开协作、角色人格化、分频道值守
模式 C:Bot-Bot @Mention —— 增强层(第三优先级)
Bot 之间在 Discord 里互相 @。非主流程,仅在明确需要公开协作时启用。
要求 allowBots: true 且 bot ID 进入白名单。核心调度仍应走 spawn。
二、两种模式的本质区别
| 维度 | Backend Spawn | Discord @Mention |
|---|---|---|
| 本质 | 主Agent的内部编排能力 | 外部渠道的接入入口 |
| 触发方式 | 主Agent代码调用 sessions_spawn | 用户在Discord频道 @ Bot |
| 用户感知 | 只看到主Agent的汇总输出 | 看到独立Bot在频道发言 |
| 配置依赖 | agents.list + subagents.allowAgents | 额外需要 token + accounts + bindings |
| 是否必须 | 是(核心链路) | 否(可选增强) |
| Agent间协作 | 主Agent内部路由,用户无感 | Bot之间公开@,用户可见 |
| 适合场景 | 内部编排、复杂任务链、统一输出 | 角色外显、分频道值守、公开协作 |
三、两种模式如何同时运行
核心机制:同一个 Agent 可以同时被两种方式触发。
配置层面:
agents.list 注册 Agent 身份 → spawn 链路使用
discord accounts + bindings → @mention 链路使用
两套配置独立,互不冲突
运行层面:
主Agent后台 spawn finance → finance 在后台处理并返回结果
用户在Discord @finance Bot → finance 在频道直接回复
两条链路并行,互不干扰
共存配置示例
一个 Agent 同时支持两种模式,需要两块配置:
1) agents.list 中注册(spawn 用):
{
"id": "finance",
"name": "财务分析师",
"workspace": "/Users/{USER}/.openclaw/workspace-finance",
"identity": { "name": "财务分析师", "emoji": "📊" },
"model": "kimi-coding/k2p5",
"subagents": { "allowAgents": ["*"] }
}
2) Discord accounts + bindings 中配置(@mention 用):
// accounts 部分
"finance": {
"name": "财务分析师",
"token": "BOT_TOKEN",
"groupPolicy": "allowlist",
"guilds": { "GUILD_ID": {} }
}
// bindings 部分
{
"agentId": "finance",
"match": { "channel": "discord", "accountId": "finance" }
}
只要 spawn 不要 Discord? 只配 agents.list,不配 accounts/bindings。
只要 Discord 不要 spawn? 不推荐,但技术上可以只配 Discord 侧。
两个都要? 两块都配,各自生效。
四、三种部署模式选择
模式 A:后台编排优先(推荐默认)
- 用户只找 main
- main 后台 spawn 专业 Agent
- Discord 只保留 main + rescue
- 最干净、最少运维、最适合复杂任务
模式 B:后台编排 + Discord 外显并存
- main 负责后台调度
- 部分专业 Agent 也在 Discord 外显
- 用户既可以找 main,也可以在特定频道直连角色
- 代价:更多 token / binding / 权限维护
模式 C:全 Discord 可见协作
- 大量 Bot 在 Discord 互相可见协作
- 需要
allowBots: true+ bot ID 白名单 - 仅在需要「公开表演式协作」时启用
- 核心调度仍建议走 spawn
五、Agent vs Skill 判断
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cchaojiejes-multi-agents-orchestration": {
"enabled": true,
"auto_update": true
}
}
}