名称: arbiter
描述: 将决策推送给 Arbiter Zebu 进行异步人工审核。当您需要对计划、架构选择或执行前的批准进行人工输入时使用。
元数据: {"openclaw":{"requires":{"bins":["arbiter-push"]}}}
将决策推送给 Arbiter Zebu 进行异步人工审核。当您需要对计划、架构选择或执行前的批准进行人工输入时使用。
通过 ClawHub 快速安装:
clawhub install arbiter
或通过 bun 安装(使 CLI 命令全局可用):
bun add -g arbiter-skill
或手动安装:
git clone https://github.com/5hanth/arbiter-skill.git
cd arbiter-skill && npm install && npm run build
ln -s $(pwd) ~/.clawdbot/skills/arbiter
bunx arbiter-zebu)~/.arbiter/queue/ 目录(机器人会自动创建)在您的代理环境中设置以下变量以实现自动代理/会话检测:
| 变量 | 描述 | 示例 |
|---|---|---|
CLAWDBOT_AGENT |
代理 ID | ceo, swe1 |
CLAWDBOT_SESSION |
会话密钥 | agent:ceo:main |
不适用于:
- 无需解释的简单是/否问题
- 紧急的实时决策(请使用直接消息)
- 您可以自行研究的技术问题
创建供人工审核的决策计划。
CLI: arbiter-push '<json>' — 接受一个包含所有字段的 JSON 参数。
arbiter-push '{
"title": "API 设计决策",
"tag": "nft-marketplace",
"context": "SWE2 在 API 工作前需要确定这些",
"priority": "normal",
"notify": "agent:swe2:main",
"decisions": [
{
"id": "auth-strategy",
"title": "认证策略",
"context": "如何验证管理员用户",
"options": [
{"key": "jwt", "label": "JWT 令牌", "note": "无状态"},
{"key": "session", "label": "会话", "note": "更多控制权"},
{"key": "oauth", "label": "OAuth", "note": "外部提供商"}
]
},
{
"id": "database",
"title": "数据库选择",
"context": "主数据存储",
"options": [
{"key": "postgresql", "label": "PostgreSQL + JSONB"},
{"key": "mongodb", "label": "MongoDB"}
],
"allowCustom": true
}
]
}'
JSON 字段:
| 字段 | 必填 | 描述 |
|---|---|---|
title |
是 | 计划标题 |
tag |
否 | 用于筛选的标签(例如项目名称) |
context |
否 | 审核者的背景信息 |
priority |
否 | low、normal、high、urgent(默认:normal) |
notify |
否 | 完成后要通知的会话 |
agent |
否 | 代理 ID(从 CLAWDBOT_AGENT 环境变量自动检测) |
session |
否 | 会话密钥(从 CLAWDBOT_SESSION 环境变量自动检测) |
decisions |
是 | 决策数组 |
决策对象:
| 字段 | 必填 | 描述 |
|---|---|---|
id |
是 | 计划内唯一的 ID |
title |
是 | 决策标题 |
context |
否 | 给审核者的解释说明 |
options |
是 | {key, label, note?} 数组 |
allowCustom |
否 | 允许自由文本回答(默认:false) |
default |
否 | 建议的选项键 |
返回:
{
"planId": "abc123",
"file": "~/.arbiter/queue/pending/ceo-api-design-abc123.md",
"total": 2,
"status": "pending"
}
检查决策计划的状态。
CLI: arbiter-status <plan-id> 或 arbiter-status --tag <tag>
arbiter-status abc12345
# 或
arbiter-status --tag nft-marketplace
返回:
{
"planId": "abc123",
"title": "API 设计决策",
"status": "in_progress",
"total": 3,
"answered": 1,
"remaining": 2,
"decisions": {
"auth-strategy": {"status": "answered", "answer": "jwt"},
"database": {"status": "pending", "answer": null},
"caching": {"status": "pending", "answer": null}
}
}
获取已完成计划的答案。
CLI: arbiter-get <plan-id> 或 arbiter-get --tag <tag>
arbiter-get abc12345
# 或
arbiter-get --tag nft-marketplace
返回:
{
"planId": "abc123",
"status": "completed",
"completedAt": "2026-01-30T01:45:00Z",
"answers": {
"auth-strategy": "jwt",
"database": "postgresql",
"caching": "redis"
}
}
如果未完成则报错:
{
"error": "计划未完成",
"status": "in_progress",
"remaining": 2
}
阻塞等待计划完成(可设置超时)。
arbiter-await abc12345 --timeout 3600
每 30 秒轮询一次,直到完成或超时。
返回: 完成时与 arbiter_get 相同。
# 推送计划决策(单个 JSON 参数)
RESULT=$(arbiter-push '{"title":"Clean IT i18n 计划","tag":"clean-it","priority":"high","notify":"agent:swe3:main","decisions":[{"id":"library","title":"i18n 库","options":[{"key":"i18next","label":"i18next"},{"key":"formatjs","label":"FormatJS"}]},{"id":"keys","title":"键结构","options":[{"key":"flat","label":"扁平结构 (login.button)"},{"key":"nested","label":"嵌套结构 ({login:{button}})"}]}]}')
PLAN_ID=$(echo $RESULT | jq -r '.planId')
echo "已推送计划 $PLAN_ID — 等待人工审核"
# 检查决策是否就绪
STATUS=$(arbiter-status --tag nft-marketplace)
if [ "$(echo $STATUS | jq -r '.status')" == "completed" ]; then
ANSWERS=$(arbiter-get --tag nft-marketplace)
AUTH=$(echo $ANSWERS | jq -r '.answers["auth-strategy"]')
echo "使用认证策略: $AUTH"
# 继续实施
else
echo "仍在等待 $(echo $STATUS | jq -r '.remaining') 个决策"
fi
# 等待决策,最多 1 小时
ANSWERS=$(arbiter-await abc12345 --timeout 3600)
if [ $? -eq 0 ]; then
# 获得答案,继续执行
echo "决策就绪: $ANSWERS"
else
echo "等待决策超时"
fi
--tag project-name)urgent 保留给真正的阻塞性问题| 路径 | 用途 |
|---|---|
~/.arbiter/queue/pending/ |
等待审核的计划 |
~/.arbiter/queue/completed/ |
已回答的计划(存档) |
~/.arbiter/queue/notify/ |
代理通知 |
在您的 HEARTBEAT.md 中添加:
## 检查 Arbiter 通知
1. 检查 `~/.arbiter/queue/notify/` 中是否有针对我会话的文件
2. 如果有,读取答案并继续执行被阻塞的工作
3. 处理完成后删除通知文件
| 问题 | 解决方案 |
|---|---|
| 计划未在 Arbiter 中显示 | 检查文件是否为有效的 YAML 前言 |
| 答案未出现 | 检查 arbiter_status,可能尚未完成 |
| 未收到通知 | 确保 --notify 设置正确 |