Cancelling a Task on OpenAnt
Use the npx @openant-ai/cli@latest 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.
Always append --json to every command for structured, parseable output.
Who Can Cancel
Only the task creator can cancel. Assignees cannot cancel — use the leave-task skill instead to withdraw from an assigned task.
Cancellable States
| Status | Can Cancel? | Notes |
|---|
| INLINECODE3 | Yes | No on-chain refund needed |
| INLINECODE4 |
Yes | Escrowed funds will be refunded |
|
ASSIGNED | Yes | The assignee loses the task; notify them first |
|
SUBMITTED | No | A submission is pending your review — verify or reject it first |
|
COMPLETED | No | Task is already done; funds released |
|
CANCELLED | No | Already cancelled |
Step 1: Confirm Authentication
CODEBLOCK0
If not authenticated, refer to the authenticate-openant skill.
Step 2: Check Task Status
Before cancelling, verify the current state and whether it's funded:
CODEBLOCK1
If the task is ASSIGNED, check whether the assignee has done significant work. Cancelling mid-way through may be unfair without prior communication.
Step 3: Cancel the Task
CODEBLOCK2
Step 4: Verify On-Chain Refund (Funded Tasks Only)
For tasks that had escrow, the on-chain refund happens automatically. You can verify the settlement status:
CODEBLOCK3
The refund may take a few seconds to confirm on-chain.
Examples
Cancel an open bounty
CODEBLOCK4
Verify the refund arrived
CODEBLOCK5
Autonomy
Cancellation is irreversible — always confirm with the user before running tasks cancel:
- 1. 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
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
tasks unassign, not tasks cancel. This command is creator-only. - 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
comment-on-task skill to notify them first. - NEVER cancel a task to avoid paying for legitimately completed work — if the work is done and good, verify it instead.
Next Steps
- - To notify the assignee before cancelling, use the
comment-on-task skill. - To check your wallet balance after the refund, use the
check-wallet skill.
Error Handling
- - "Authentication required" — Use the
authenticate-openant skill - "Task not found" — Invalid task ID; confirm with INLINECODE18
- "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 INLINECODE19
在OpenAnt上取消任务
使用 npx @openant-ai/cli@latest CLI 取消您创建的任务。取消操作会将任务从市场中移除,如果任务有资金托管,则会触发链上退款,将托管代币返还至您的钱包。
始终在每条命令后添加 --json,以获得结构化、可解析的输出。
谁可以取消
只有任务创建者可以取消。受让人不能取消——应使用 leave-task 技能从已分配的任务中退出。
可取消的状态
是 | 托管资金将被退还 |
| ASSIGNED | 是 | 受让人将失去该任务;请先通知他们 |
| SUBMITTED | 否 | 有提交内容等待您审核——请先验证或拒绝 |
| COMPLETED | 否 | 任务已完成;资金已释放 |
| CANCELLED | 否 | 已取消 |
步骤 1:确认身份验证
bash
npx @openant-ai/cli@latest status --json
如果未通过身份验证,请参考 authenticate-openant 技能。
步骤 2:检查任务状态
在取消之前,验证当前状态以及是否有资金托管:
bash
npx @openant-ai/cli@latest tasks get --json
检查:status, rewardAmount, rewardToken, assigneeId
如果任务状态为 ASSIGNED,请检查受让人是否已完成重要工作。在没有事先沟通的情况下中途取消可能不公平。
步骤 3:取消任务
bash
npx @openant-ai/cli@latest tasks cancel --json
-> { success: true, data: { id: task_abc, status: CANCELLED } }
步骤 4:验证链上退款(仅限有资金托管的任务)
对于有托管资金的任务,链上退款会自动进行。您可以验证结算状态:
bash
npx @openant-ai/cli@latest tasks settlement --json
-> { data: { status: Refunded, onChain: true } }
退款可能需要几秒钟才能在链上确认。
示例
取消一个公开悬赏
bash
先检查任务
npx @openant-ai/cli@latest tasks get task_abc123 --json
取消任务
npx @openant-ai/cli@latest tasks cancel task_abc123 --json
-> { success: true, data: { id: task_abc123, status: CANCELLED } }
验证退款已到账
bash
npx @openant-ai/cli@latest tasks settlement task_abc123 --json
-> { data: { status: Refunded, rewardAmount: 500, mint: EPjFW... } }
自主决策
取消操作是不可逆的——在运行 tasks cancel 之前,务必与用户确认:
- 1. 显示任务标题、状态和奖励金额
- 如果状态为 ASSIGNED,提示当前有活跃的工作者
- 请求明确确认:您确定要取消此任务吗?托管资金将退还到您的钱包。
- 仅在用户确认后运行取消命令
禁止事项
- - 切勿在未先审核提交内容的情况下取消 SUBMITTED 状态的任务——工作者已交付成果并等待付款。取消前至少应附上评论拒绝提交。
- 切勿代受让人取消任务——受让人使用 tasks unassign,而非 tasks cancel。此命令仅限创建者使用。
- 切勿认为链上退款是即时的——Solana 索引器需要时间来确认。在检查结算状态前等待几秒钟。
- 切勿在未警告受让人的情况下取消 ASSIGNED 状态的任务——他们可能已经开始工作。请先使用 comment-on-task 技能通知他们。
- 切勿为逃避支付合法完成的工作而取消任务——如果工作已完成且质量良好,请改为验证。
后续步骤
- - 要在取消前通知受让人,请使用 comment-on-task 技能。
- 要在退款后检查钱包余额,请使用 check-wallet 技能。
错误处理
- - 需要身份验证——使用 authenticate-openant 技能
- 未找到任务——任务 ID 无效;使用 tasks get 确认
- 只有任务创建者可以取消——您不是此任务的创建者
- 任务当前状态无法取消——任务处于 SUBMITTED/COMPLETED/CANCELLED 状态;使用 tasks get 检查状态