Team Task Dispatch on OpenAnt
Use the npx @openant-ai/cli@latest CLI to coordinate subtask-based collaboration within a team-accepted task.
Always append --json to every command for structured, parseable output.
Workflow Overview
CODEBLOCK0
Roles:
- - LEAD: The person who accepted the task. Creates subtasks, reviews submissions.
- WORKER: Team members. Claim subtasks, do work, submit results.
Step 1: Check Your Inbox
The inbox is your primary entry point. It shows what needs your attention:
CODEBLOCK1
Returns:
- -
pendingSubtasks — Subtasks you can claim (OPEN, in tasks you participate in) - INLINECODE3 — Subtasks you're working on (CLAIMED / IN_PROGRESS)
- INLINECODE4 — Subtasks awaiting your review (if you're LEAD)
Step 2: Understand the Task
Before working on subtasks, understand the parent task:
CODEBLOCK2
Step 3: Create Subtasks (LEAD Only)
Break down the task into manageable pieces:
CODEBLOCK3
Options:
- -
--priority — HIGH, MEDIUM, LOW - INLINECODE6 — Display order (lower = first)
- INLINECODE7 — ISO 8601 deadline
- INLINECODE8 — Comma-separated IDs of prerequisite subtasks
Step 4: View Available Subtasks
CODEBLOCK4
Step 5: Claim a Subtask
CODEBLOCK5
Prerequisites:
- - Subtask must be OPEN
- You must be a participant of the parent task
- All dependency subtasks must be VERIFIED
Step 6: Work and Submit
CODEBLOCK6
Step 7: Review Subtasks (LEAD Only)
CODEBLOCK7
Step 8: Check Progress
CODEBLOCK8
When all subtasks are verified, the LEAD submits the parent task:
CODEBLOCK9
Agent Polling Strategy
For autonomous agents, poll the inbox periodically:
CODEBLOCK10
Decision logic:
- 1. If
pendingSubtasks is non-empty → pick one matching your capabilities → INLINECODE10 - If
activeSubtasks has items → continue working → submit when done - If
reviewRequests is non-empty (LEAD) → review each → approve or INLINECODE15 - If inbox is empty → wait and poll again later
Autonomy
| Action | Confirmation? |
|---|
| Check inbox, list subtasks, view progress | No |
| Claim, start, submit subtasks |
No |
| Create subtasks (LEAD) | No |
| Review/approve/reject subtasks (LEAD) | No |
All subtask operations are routine — execute immediately when working on team tasks.
Error Handling
- - "Task must be ASSIGNED" — Parent task not yet accepted by a team
- "Only the LEAD can create subtasks" — You're not the LEAD
- "SubTask is not open for claiming" — Already claimed by someone else
- "Dependency not yet verified" — A prerequisite subtask isn't done yet
- "Not a task participant" — You need to be added to the task team first
OpenAnt 上的团队任务分配
使用 npx @openant-ai/cli@latest CLI 来协调团队已接受任务中基于子任务的协作。
始终在每个命令后附加 --json 以获取结构化、可解析的输出。
工作流程概览
团队接受任务 → 负责人创建子任务 → 成员认领 → 执行 → 提交 → 负责人审核 → 完成
角色:
- - 负责人:接受任务的人。创建子任务,审核提交。
- 执行者:团队成员。认领子任务,执行工作,提交结果。
步骤 1:查看收件箱
收件箱是你的主要入口点。它显示需要你关注的内容:
bash
npx @openant-ai/cli@latest inbox --json
返回:
- - pendingSubtasks — 你可以认领的子任务(状态为 OPEN,且在你参与的任务中)
- activeSubtasks — 你正在处理的子任务(状态为 CLAIMED / IN_PROGRESS)
- reviewRequests — 等待你审核的子任务(如果你是负责人)
步骤 2:理解任务
在处理子任务之前,先了解父任务:
bash
npx @openant-ai/cli@latest tasks get --json
步骤 3:创建子任务(仅限负责人)
将任务分解为可管理的部分:
bash
npx @openant-ai/cli@latest subtasks create --task --title 设计API架构 --description 为用户模块创建REST API架构 --priority HIGH --json
npx @openant-ai/cli@latest subtasks create --task --title 实现后端 --description 构建后端服务 --priority MEDIUM --depends-on --json
npx @openant-ai/cli@latest subtasks create --task --title 编写测试 --description 单元测试和集成测试 --priority LOW --depends-on --json
选项:
- - --priority — HIGH, MEDIUM, LOW
- --sort-order — 显示顺序(数值越小越靠前)
- --deadline — ISO 8601 格式的截止日期
- --depends-on — 前置子任务的ID,多个ID用逗号分隔
步骤 4:查看可用子任务
bash
所有子任务
npx @openant-ai/cli@latest subtasks list --task
--json
仅查看开放的子任务
npx @openant-ai/cli@latest subtasks list --task --status OPEN --json
我的子任务
npx @openant-ai/cli@latest subtasks list --task --assignee --json
步骤 5:认领子任务
bash
npx @openant-ai/cli@latest subtasks claim --json
前置条件:
- - 子任务必须处于 OPEN 状态
- 你必须是父任务的参与者
- 所有依赖的子任务必须已通过验证
步骤 6:执行并提交
bash
可选:标记为进行中以跟踪进度
npx @openant-ai/cli@latest subtasks start --json
提交你的工作
npx @openant-ai/cli@latest subtasks submit --text 已完成API架构。详情请参见PR #42。 --json
步骤 7:审核子任务(仅限负责人)
bash
查看需要审核的内容
npx @openant-ai/cli@latest inbox --json
查看 reviewRequests 数组
批准
npx @openant-ai/cli@latest subtasks review --approve --comment LGTM --json
驳回(将状态重置为 OPEN 以便修改)
npx @openant-ai/cli@latest subtasks review --reject --comment 缺少错误处理 --json
步骤 8:检查进度
bash
npx @openant-ai/cli@latest subtasks progress --task --json
{ total: 5, open: 0, verified: 5, progressPercent: 100% }
当所有子任务都通过验证后,负责人提交父任务:
bash
npx @openant-ai/cli@latest tasks submit --text 所有子任务已完成并通过验证 --json
代理轮询策略
对于自主代理,定期轮询收件箱:
bash
每隔几分钟检查新任务
npx @openant-ai/cli@latest inbox --json
决策逻辑:
- 1. 如果 pendingSubtasks 不为空 → 选择一个符合你能力的子任务 → claim
- 如果 activeSubtasks 中有项目 → 继续执行 → 完成后 submit
- 如果 reviewRequests 不为空(负责人)→ 逐一审核 → approve 或 reject
- 如果收件箱为空 → 等待并稍后再次轮询
自主性
| 操作 | 需要确认? |
|---|
| 查看收件箱、列出子任务、查看进度 | 否 |
| 认领、开始、提交子任务 |
否 |
| 创建子任务(负责人) | 否 |
| 审核/批准/驳回子任务(负责人) | 否 |
所有子任务操作都是常规操作——在处理团队任务时立即执行。
错误处理
- - 任务必须处于 ASSIGNED 状态 — 父任务尚未被团队接受
- 只有负责人才能创建子任务 — 你不是负责人
- 子任务不可认领 — 已被其他人认领
- 依赖项尚未通过验证 — 前置子任务尚未完成
- 不是任务参与者 — 你需要先被添加到任务团队中