Agent Communication

v1.0.0

标准化跨 Agent 通信协议。当需要向另一个 Agent 询问、协作或委托任务时,使用本技能。

0· 88·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for auberghan/openclaw-agent-comm.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Agent Communication" (auberghan/openclaw-agent-comm) from ClawHub.
Skill page: https://clawhub.ai/auberghan/openclaw-agent-comm
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install openclaw-agent-comm

ClawHub CLI

Package manager switcher

npx clawhub@latest install openclaw-agent-comm
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the content: the document standardizes use of sessions_list, sessions_send, and sessions_spawn for cross-agent queries, notifications, and background tasks. It does not request unrelated resources (no env vars, binaries, or config paths).
Instruction Scope
SKILL.md contains explicit, bounded runtime instructions and message templates that stay on-topic (how to obtain sessionKey, which API call to use, timeouts, error handling). It does not instruct reading files, scanning system state, or sending data to external endpoints beyond the described sessions_* primitives.
Install Mechanism
No install spec and no code files — instruction-only — so nothing is written to disk or downloaded during install.
Credentials
The skill declares and requires no environment variables, credentials, or config paths. All runtime inputs are explicit parameters (sessionKey, message, task) consistent with cross-agent communication.
Persistence & Privilege
always:false and no requests to modify other skills or system-wide settings. The skill relies on normal autonomous invocation behavior but does not demand elevated persistence or privileges.
Assessment
This skill is an on-topic, instruction-only protocol for agent-to-agent messaging and appears coherent. Before installing, confirm that your platform actually exposes the sessions_list / sessions_send / sessions_spawn primitives referenced here; ensure you trust the other agents you will message because user content and task payloads will be sent to them; avoid delegating sensitive secrets or credentials via these messages; and if you require auditability, plan to log or review cross-agent messages and results (timeouts and control directives like REPLY_SKIP/ANNOUNCE_SKIP are provided by the spec).

Like a lobster shell, security has layers — review code before you run it.

latestvk979vcev3qg3xkrptxvfbb9bqn8436bz
88downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

Agent 间通信协议

核心原则

  1. 先查 sessionKey:用 sessions_list 获取实时 sessionKey,禁止使用记忆中的硬编码值
  2. 按需选择模式:阻塞 / 非阻塞 / 即发即走,根据任务性质选择
  3. 减少目标开销:请求中带上必要信息,让目标快速理解
  4. 统一回复归属:主 Agent 统一处理引用回复,下游 Agent 只返回结果

通信工具

工具用途等待方式
sessions_send点对点通信可配置超时
sessions_spawn后台任务委托非阻塞,结果自动推送
sessions_list获取实时 sessionKey

通信模式

模式 A:阻塞等待(查询、学习)

sessions_send({ sessionKey, message, timeoutSeconds: 120 })
→ 等待目标回复(最多 5 轮 ping-pong)
→ 返回结果

模式 B:即发即走(通知、传达)

sessions_send({ sessionKey, message, timeoutSeconds: 0 })
→ 立即返回,不等待结果

模式 C:后台委托(任务执行)

sessions_spawn({ task, label?, agentId?, runTimeoutSeconds?, cleanup? })
→ 立即返回 { status: "accepted", runId, childSessionKey }
→ 任务完成后自动推送结果到请求方

请求消息模板

所有 sessions_send 请求统一使用以下格式:

【Agent 间通信】
发件方: <我的名字> (<我的agentId>)
收件方: <目标agent>
source sessionKey: <当前session的key>
通信目的: <场景类型>
期望响应: <阻塞等待/即发即走/非阻塞>
timeout: <秒数>

---
用户需求: <用户原话>

<具体请求内容>

---
上下文摘要: <补充说明>

场景类型

场景 1:知识获取(阻塞)

意图:问、学、查询、确认 工具sessions_send,timeoutSeconds: 120

sessions_send({ sessionKey, message, timeoutSeconds: 120 })

场景 2:任务委托(非阻塞)

意图:让做、研究、处理、分析 工具sessions_spawn

sessions_spawn({ task: "...", label?: "...", agentId?: "...", runTimeoutSeconds?: 0 })

场景 3:单向通知(即发即走)

意图:通知、传达、转发(不关心结果) 工具sessions_send,timeoutSeconds: 0

sessions_send({ sessionKey, message, timeoutSeconds: 0 })

场景 4:顺序协作

多个 sessions_spawn 串联,前一个完成后再启动下一个:

用户: "先让A分析,再让B基于结果写报告"
→ sessions_spawn A
→ 等待 A 完成(通告回我)
→ sessions_spawn B,附上 A 的结果
→ 汇总后汇报用户

场景 5:多 Agent 并行汇总

用户: "收集多个 Agent 的状态并汇总"
→ 并行 sessions_spawn 多个目标
→ 等待所有完成(收集所有通告)
→ 汇总结果 → 汇报用户

结果交付方式

推荐:下游 Agent 只返回结果,由主 Agent统一回复用户。

  • sessions_spawn 的结果自动推送到发起方的绑定渠道
  • 如果需要结果直接发给用户,在 task 中说明即可,不需要用 message 工具发

超时配置

模式timeoutSeconds说明
阻塞等待120等待目标处理和回复
即发即走0发完即返回
后台委托0(默认无超时)结果自动推送

控制指令

在消息正文中精确包含以下内容可控制流程:

指令效果
REPLY_SKIP停止 ping-pong 回复循环
ANNOUNCE_SKIP不发布任何结果通告

错误处理

目标 Agent 不存在

❌ 目标 Agent "<name>" 不存在或不可用

可用 Agent(从 sessions_list 获取):
- <list>

请确认目标名称,或选择其他 Agent。

通信超时

⚠️ 与目标 Agent 通信超时(120秒未响应)

可能原因:
1. 目标正在处理其他任务
2. 任务较复杂需要更长时间

建议:
1. 稍后重试
2. 改用 sessions_spawn 后台执行

未知错误

⚠️ 与目标 Agent 通信失败

错误: <error message>

建议:
1. 检查 sessionKey 是否正确
2. 尝试 sessions_spawn 后台执行

快速参考

需求工具timeout
问/学/查询sessions_send120s(阻塞)
让做/研究/处理sessions_spawn非阻塞
通知/传达sessions_send0(即发即走)
顺序协作sessions_spawn × n非阻塞
多 Agent 汇总并行 sessions_spawn非阻塞

Comments

Loading comments...