69 lines
1.6 KiB
Markdown
Executable File
69 lines
1.6 KiB
Markdown
Executable File
# 团队任务队列协作协议(A01 ↔ A06)
|
||
|
||
> 建立于 2026-05-10,小雪 (A01) 与 小唯 (A06) 跨系统协作机制
|
||
|
||
## 背景
|
||
|
||
两个不同体系的 AI Agent(小雪 = 主控 Agent A01 / 小唯 = 全能副手 A06)无直接 API 通信管道,通过共享文件队列传递任务。
|
||
|
||
## 队列文件
|
||
|
||
```
|
||
~/.openclaw/workspace/shared/team_task_queue.json
|
||
```
|
||
|
||
## 任务格式
|
||
|
||
### 发送方(小雪)写入
|
||
```json
|
||
{
|
||
"id": "hermes-xxx",
|
||
"title": "任务标题",
|
||
"assigned_to": "A06",
|
||
"status": "pending",
|
||
"created_by": "A01",
|
||
"created_at": "2026-05-10T19:31:00+08:00",
|
||
"deadline": "尽快",
|
||
"details": {
|
||
"description": "任务描述",
|
||
"command": "可选,具体命令"
|
||
}
|
||
}
|
||
```
|
||
|
||
### 接收方(小唯)回写
|
||
```json
|
||
{
|
||
"id": "hermes-xxx",
|
||
"status": "completed",
|
||
"completed_at": "2026-05-10T19:32:00+08:00",
|
||
"result": {
|
||
"status": "ok",
|
||
"output": "执行结果",
|
||
"note": "备注"
|
||
}
|
||
}
|
||
```
|
||
|
||
## 处理脚本
|
||
|
||
```
|
||
~/.hermes/scripts/task-queue-processor.py
|
||
```
|
||
|
||
- 每5分钟 cron 执行(job_id: c82a7c04c09f)
|
||
- 过滤 `assigned_to` in `["A06", "小唯"]` 且 `status == "pending"` 的任务
|
||
- 执行后回写 `result` + `status: "completed"`
|
||
|
||
## 过滤逻辑
|
||
|
||
```python
|
||
if assigned not in ("A06", "小唯") or status != "pending":
|
||
continue
|
||
```
|
||
|
||
## 注意事项
|
||
|
||
1. **两个 bot 身份隔离**:小唯飞书走 Hermes Gateway,小雪飞书走独立 daemon 脚本,绝不能混淆
|
||
2. **备份机制**:更新队列前自动备份到 `team_task_queue.json.bak`
|
||
3. **command 字段**:有 command 则执行 shell 命令,无 command 则只返回 received(待扩展) |