OA0
OA0 是一个探索 AI 的社区
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  arbiter:将决策推送到Arbiter Zebu进行异步人工审核

arbiter:将决策推送到Arbiter Zebu进行异步人工审核

 
  system ·  2026-02-01 22:16:16 · 20 次点击  · 0 条评论  

名称: arbiter
描述: 将决策推送给 Arbiter Zebu 进行异步人工审核。当您需要对计划、架构选择或执行前的批准进行人工输入时使用。
元数据: {"openclaw":{"requires":{"bins":["arbiter-push"]}}}


Arbiter 技能

将决策推送给 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

前置条件

  • 正在运行 Arbiter Zebu 机器人(或直接运行 bunx arbiter-zebu
  • 存在 ~/.arbiter/queue/ 目录(机器人会自动创建)

环境变量

在您的代理环境中设置以下变量以实现自动代理/会话检测:

变量 描述 示例
CLAWDBOT_AGENT 代理 ID ceo, swe1
CLAWDBOT_SESSION 会话密钥 agent:ceo:main

使用场景

  • 实施前的计划评审
  • 涉及权衡的架构决策
  • 任何需要人工判断的阻塞性问题
  • 将多个相关决策作为一批处理

不适用于:
- 无需解释的简单是/否问题
- 紧急的实时决策(请使用直接消息)
- 您可以自行研究的技术问题

工具

arbiter_push

创建供人工审核的决策计划。

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 lownormalhighurgent(默认: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"
}

arbiter_status

检查决策计划的状态。

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}
  }
}

arbiter_get

获取已完成计划的答案。

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

阻塞等待计划完成(可设置超时)。

arbiter-await abc12345 --timeout 3600

每 30 秒轮询一次,直到完成或超时。

返回: 完成时与 arbiter_get 相同。

使用示例

示例 1:计划评审

# 推送计划决策(单个 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 — 等待人工审核"

示例 2:检查并继续

# 检查决策是否就绪
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

示例 3:阻塞等待

# 等待决策,最多 1 小时
ANSWERS=$(arbiter-await abc12345 --timeout 3600)

if [ $? -eq 0 ]; then
  # 获得答案,继续执行
  echo "决策就绪: $ANSWERS"
else
  echo "等待决策超时"
fi

最佳实践

  1. 批量处理相关决策 — 不要一次推送一个
  2. 提供背景信息 — 人工需要理解权衡
  3. 使用标签 — 便于筛选(--tag project-name
  4. 设置通知 — 以便被阻塞的代理能被唤醒
  5. 谨慎使用优先级 — 将 urgent 保留给真正的阻塞性问题

文件位置

路径 用途
~/.arbiter/queue/pending/ 等待审核的计划
~/.arbiter/queue/completed/ 已回答的计划(存档)
~/.arbiter/queue/notify/ 代理通知

检查通知(代理心跳)

在您的 HEARTBEAT.md 中添加:

## 检查 Arbiter 通知

1.  检查 `~/.arbiter/queue/notify/` 中是否有针对我会话的文件
2.  如果有,读取答案并继续执行被阻塞的工作
3.  处理完成后删除通知文件

故障排除

问题 解决方案
计划未在 Arbiter 中显示 检查文件是否为有效的 YAML 前言
答案未出现 检查 arbiter_status,可能尚未完成
未收到通知 确保 --notify 设置正确

另请参阅

20 次点击  ∙  0 人收藏  
登录后收藏  
0 条回复
关于 ·  帮助 ·  PING ·  隐私 ·  条款   
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
耗时 58 ms
Developed with Cursor