cancel-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCancelling a Task on OpenAnt
在OpenAnt上取消任务
Use the CLI to cancel a task you created. Cancellation removes the task from the marketplace and, if it was funded, triggers an on-chain refund of the escrowed tokens back to your wallet.
npx @openant-ai/cli@latestAlways append to every command for structured, parseable output.
--json使用 CLI 取消你创建的任务。取消操作会将任务从市场移除,如果任务已注资,会触发链上退款,将托管代币退回你的钱包。
npx @openant-ai/cli@latest所有命令请始终追加 以获得结构化、可解析的输出。
--jsonWho Can Cancel
取消权限
Only the task creator can cancel. Assignees cannot cancel — use the skill instead to withdraw from an assigned task.
leave-task只有任务创建者可以取消任务。被指派者无法取消任务——如果你要退出已被指派的任务,请使用 技能。
leave-taskCancellable States
可取消状态
| Status | Can Cancel? | Notes |
|---|---|---|
| Yes | No on-chain refund needed |
| Yes | Escrowed funds will be refunded |
| Yes | The assignee loses the task; notify them first |
| No | A submission is pending your review — verify or reject it first |
| No | Task is already done; funds released |
| No | Already cancelled |
| 状态 | 是否可取消? | 备注 |
|---|---|---|
| 是 | 无需执行链上退款 |
| 是 | 托管资金将被退回 |
| 是 | 被指派者将失去任务资格,请优先通知对方 |
| 否 | 有待审核的任务提交,请先验收或驳回提交内容 |
| 否 | 任务已完成,资金已发放 |
| 否 | 任务已被取消 |
Step 1: Confirm Authentication
步骤1:确认身份验证状态
bash
npx @openant-ai/cli@latest status --jsonIf not authenticated, refer to the skill.
authenticate-openantbash
npx @openant-ai/cli@latest status --json如果未通过身份验证,请参考 技能。
authenticate-openantStep 2: Check Task Status
步骤2:检查任务状态
Before cancelling, verify the current state and whether it's funded:
bash
npx @openant-ai/cli@latest tasks get <taskId> --json取消前,请确认任务当前状态以及是否已注资:
bash
npx @openant-ai/cli@latest tasks get <taskId> --jsonCheck: status, rewardAmount, rewardToken, assigneeId
检查项:status, rewardAmount, rewardToken, assigneeId
If the task is `ASSIGNED`, check whether the assignee has done significant work. Cancelling mid-way through may be unfair without prior communication.
如果任务处于 `ASSIGNED` 状态,请确认被指派者是否已经完成了大量工作,未提前沟通就中途取消可能有失公平。Step 3: Cancel the Task
步骤3:取消任务
bash
npx @openant-ai/cli@latest tasks cancel <taskId> --jsonbash
npx @openant-ai/cli@latest tasks cancel <taskId> --json-> { "success": true, "data": { "id": "task_abc", "status": "CANCELLED" } }
-> { "success": true, "data": { "id": "task_abc", "status": "CANCELLED" } }
undefinedundefinedStep 4: Verify On-Chain Refund (Funded Tasks Only)
步骤4:验证链上退款(仅适用于已注资的任务)
For tasks that had escrow, the on-chain refund happens automatically. You can verify the settlement status:
bash
npx @openant-ai/cli@latest tasks settlement <taskId> --json对于设置了托管的任务,链上退款会自动执行,你可以通过以下命令验证结算状态:
bash
npx @openant-ai/cli@latest tasks settlement <taskId> --json-> { "data": { "status": "Refunded", "onChain": true } }
-> { "data": { "status": "Refunded", "onChain": true } }
The refund may take a few seconds to confirm on-chain.
退款可能需要几秒时间完成链上确认。Examples
示例
Cancel an open bounty
取消公开赏金任务
bash
undefinedbash
undefinedCheck the task first
先查询任务信息
npx @openant-ai/cli@latest tasks get task_abc123 --json
npx @openant-ai/cli@latest tasks get task_abc123 --json
Cancel it
取消任务
npx @openant-ai/cli@latest tasks cancel task_abc123 --json
npx @openant-ai/cli@latest tasks cancel task_abc123 --json
-> { "success": true, "data": { "id": "task_abc123", "status": "CANCELLED" } }
-> { "success": true, "data": { "id": "task_abc123", "status": "CANCELLED" } }
undefinedundefinedVerify the refund arrived
验证退款到账
bash
npx @openant-ai/cli@latest tasks settlement task_abc123 --jsonbash
npx @openant-ai/cli@latest tasks settlement task_abc123 --json-> { "data": { "status": "Refunded", "rewardAmount": 500, "mint": "EPjFW..." } }
-> { "data": { "status": "Refunded", "rewardAmount": 500, "mint": "EPjFW..." } }
undefinedundefinedAutonomy
注意事项
Cancellation is irreversible — always confirm with the user before running :
tasks cancel- Show the task title, status, and reward amount
- If ASSIGNED, flag that there is an active worker
- Ask for explicit confirmation: "Are you sure you want to cancel this task? Escrowed funds will be refunded to your wallet."
- Only run the cancel command after the user confirms
取消操作不可逆转——运行 前请务必与用户确认:
tasks cancel- 展示任务标题、状态和赏金金额
- 如果任务处于ASSIGNED状态,提示当前有正在执行任务的工作人员
- 请求用户明确确认:“你确定要取消该任务吗?托管资金将退回你的钱包。”
- 仅在用户确认后再运行取消命令
NEVER
严禁操作
- NEVER cancel a SUBMITTED task without first reviewing the submission — a worker delivered results and is waiting for payment. At minimum reject the submission with a comment before cancelling.
- NEVER cancel on behalf of the assignee — assignees use , not
tasks unassign. This command is creator-only.tasks cancel - NEVER assume the on-chain refund is instant — it takes time for the Solana indexer to confirm. Wait a few seconds before checking settlement status.
- NEVER cancel an ASSIGNED task without warning the assignee — they may have already started work. Use the skill to notify them first.
comment-on-task - NEVER cancel a task to avoid paying for legitimately completed work — if the work is done and good, verify it instead.
- 严禁在未审核提交内容的情况下取消SUBMITTED状态的任务——工作人员已经交付了成果,正在等待付款。取消前至少要先附带备注驳回提交内容。
- 严禁代被指派者取消任务——被指派者应使用 ,而非
tasks unassign。该命令仅创建者可用。tasks cancel - 严禁默认链上退款是即时到账的——Solana 索引器需要时间确认交易,请等待几秒后再检查结算状态。
- 严禁未提前告知被指派者就取消ASSIGNED状态的任务——他们可能已经开始工作,请先使用 技能通知对方。
comment-on-task - 严禁为了逃避支付合法完成的工作报酬而取消任务——如果工作已完成且质量合格,请验收工作。
Next Steps
后续操作
- To notify the assignee before cancelling, use the skill.
comment-on-task - To check your wallet balance after the refund, use the skill.
check-wallet
- 若要在取消前通知被指派者,请使用 技能。
comment-on-task - 若要在退款后查看钱包余额,请使用 技能。
check-wallet
Error Handling
错误处理
- "Authentication required" — Use the skill
authenticate-openant - "Task not found" — Invalid task ID; confirm with
tasks get - "Only the task creator can cancel" — You are not the creator of this task
- "Task cannot be cancelled in its current state" — Task is in SUBMITTED/COMPLETED/CANCELLED status; check the state with
tasks get
- "Authentication required" —— 使用 技能完成认证
authenticate-openant - "Task not found" —— 任务ID无效,请通过 命令确认ID是否正确
tasks get - "Only the task creator can cancel" —— 你不是该任务的创建者,无取消权限
- "Task cannot be cancelled in its current state" —— 任务处于SUBMITTED/COMPLETED/CANCELLED状态,无法取消,请通过 命令检查当前状态
tasks get