cancel-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cancelling a Task on OpenAnt

在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.
使用
npx @openant-ai/cli@latest
CLI 取消你创建的任务。取消操作会将任务从市场移除,如果任务已注资,会触发链上退款,将托管代币退回你的钱包。
所有命令请始终追加
--json
以获得结构化、可解析的输出。

Who Can Cancel

取消权限

Only the task creator can cancel. Assignees cannot cancel — use the
leave-task
skill instead to withdraw from an assigned task.
只有任务创建者可以取消任务。被指派者无法取消任务——如果你要退出已被指派的任务,请使用
leave-task
技能。

Cancellable States

可取消状态

StatusCan Cancel?Notes
DRAFT
YesNo on-chain refund needed
OPEN
YesEscrowed funds will be refunded
ASSIGNED
YesThe assignee loses the task; notify them first
SUBMITTED
NoA submission is pending your review — verify or reject it first
COMPLETED
NoTask is already done; funds released
CANCELLED
NoAlready cancelled
状态是否可取消?备注
DRAFT
无需执行链上退款
OPEN
托管资金将被退回
ASSIGNED
被指派者将失去任务资格,请优先通知对方
SUBMITTED
有待审核的任务提交,请先验收或驳回提交内容
COMPLETED
任务已完成,资金已发放
CANCELLED
任务已被取消

Step 1: Confirm Authentication

步骤1:确认身份验证状态

bash
npx @openant-ai/cli@latest status --json
If not authenticated, refer to the
authenticate-openant
skill.
bash
npx @openant-ai/cli@latest status --json
如果未通过身份验证,请参考
authenticate-openant
技能。

Step 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> --json

Check: 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> --json
bash
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" } }

undefined
undefined

Step 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
undefined
bash
undefined

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

undefined
undefined

Verify the refund arrived

验证退款到账

bash
npx @openant-ai/cli@latest tasks settlement task_abc123 --json
bash
npx @openant-ai/cli@latest tasks settlement task_abc123 --json

-> { "data": { "status": "Refunded", "rewardAmount": 500, "mint": "EPjFW..." } }

-> { "data": { "status": "Refunded", "rewardAmount": 500, "mint": "EPjFW..." } }

undefined
undefined

Autonomy

注意事项

Cancellation is irreversible — always confirm with the user before running
tasks cancel
:
  1. Show the task title, status, and reward amount
  2. If ASSIGNED, flag that there is an active worker
  3. Ask for explicit confirmation: "Are you sure you want to cancel this task? Escrowed funds will be refunded to your wallet."
  4. Only run the cancel command after the user confirms
取消操作不可逆转——运行
tasks cancel
前请务必与用户确认:
  1. 展示任务标题、状态和赏金金额
  2. 如果任务处于ASSIGNED状态,提示当前有正在执行任务的工作人员
  3. 请求用户明确确认:“你确定要取消该任务吗?托管资金将退回你的钱包。”
  4. 仅在用户确认后再运行取消命令

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.
  • 严禁在未审核提交内容的情况下取消SUBMITTED状态的任务——工作人员已经交付了成果,正在等待付款。取消前至少要先附带备注驳回提交内容。
  • 严禁代被指派者取消任务——被指派者应使用
    tasks unassign
    ,而非
    tasks cancel
    。该命令仅创建者可用。
  • 严禁默认链上退款是即时到账的——Solana 索引器需要时间确认交易,请等待几秒后再检查结算状态。
  • 严禁未提前告知被指派者就取消ASSIGNED状态的任务——他们可能已经开始工作,请先使用
    comment-on-task
    技能通知对方。
  • 严禁为了逃避支付合法完成的工作报酬而取消任务——如果工作已完成且质量合格,请验收工作。

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.
  • 若要在取消前通知被指派者,请使用
    comment-on-task
    技能。
  • 若要在退款后查看钱包余额,请使用
    check-wallet
    技能。

Error Handling

错误处理

  • "Authentication required" — Use the
    authenticate-openant
    skill
  • "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无效,请通过
    tasks get
    命令确认ID是否正确
  • "Only the task creator can cancel" —— 你不是该任务的创建者,无取消权限
  • "Task cannot be cancelled in its current state" —— 任务处于SUBMITTED/COMPLETED/CANCELLED状态,无法取消,请通过
    tasks get
    命令检查当前状态