Skip to main content
Glama

Orca Cancel Task

orca_cancel_task
Destructive

Cancel a delegated Orca task and its descendant tasks/workers, including sub-runs, after safety preflight; use it to stop unwanted jobs without deleting worktrees or terminals.

Instructions

委譲ジョブをキャンセルする。内部では orca CLI の手順どおり、対象タスクの dispatch を worker-stop(または mode=abandon なら worker-abandon)で fence してから task-update --status failed --result cancelled を呼ぶ。既定 cascade: true で、Commander が分解した子孫タスクとその worker を子から順に止める(cascade の由来)。まず全対象の dispatch を読み切る preflight を行い、子孫 12 件超は cancel_scope_too_large、1 タスク 3 dispatch 超は cancel_dispatch_scope_too_large で何も変更する前に断る。Commander の fence に 1 件でも失敗すれば cancel_incomplete(state: partial / cancelled: false)で対象 task は更新しない。成功応答の fullyStopped は「全 dispatch が fence され、停止後に worker-list を読み直して生存 worker が 0 件」を意味する。mode=abandon の場合は worker-abandon がプロセス停止を主張しないコマンドなので、fullyStopped: true も OS のエージェントプロセス終了は保証しない(pane 上のプロセス確認は人間側)。完了済み・キャンセル済みのタスクには何もしない(冪等)。worktree やターミナルの削除は行わない。sub-run: Commander が sub-run を作っている場合、task ツリーだけ追う cascade はその worker を走りたままにする(実測)。既定 includeSubRuns: true は run-list の coordinatorHandle 照合で sub-run の部分木を cascade 対象に組み込み、呼び出し元 Run の Commander より先に止める(拾った Run は subRunsDiscovered / subRuns に載せる)。上限 12 件は sub-run 込みの件数で判定する。所有検証: auto-cancel は pane key / process incarnation まで一致した verified の sub-run だけ — 検証に失敗した sub-run が 1 件でもあれば preflight で cancel_ownership_unverified を返し、何も変更しない(probable を叩くと別 job の worker を止める事故になる)。sub-run を含めずに止める逃げ道は includeSubRuns: false / cascade: false。同一 dispatch は 1 回だけ叩く。停止後は worker-list を読み直し、残っている worker を residualWorkers に載せ、その 1 件でも fullyStopped: false(探索を打ち切った場合も false)。探索の完全性: run-list / worker-list は cursor でページングし、上限到達・hasMore に対して nextCursor 無し・同じ cursor の周回を打ち切りとして検出する(subRunScanComplete / subRunWorkerScanComplete)。worker-list のページングを打ち切ったら完全停止を保証しない(fullyStopped: false)。cascade + includeSubRuns の既定構成では、前提となる読み取り(呼び出し元 Run の worker-list / sub-run 探索の run-list / Commander の terminal handle)が揃わないときに preflight で cancel_discovery_incomplete を返し、何も変更しない(見落とした worker を走りたまま cancelled: true で返さないため)。読み取りの失敗だけでなく、探索コマンドが使えない場合(client に worker-list / run-list が無い、呼び出し元 Run が特定できない)も同じ語彙で断る。停止後に worker-list を読み直せる Run が無いときも fullyStopped: false。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "taskId": "<taskId>"
    },
    "name": "orca_cancel_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
runNo対象の orchestration Run ID
modeNostop: worker を fence して止める / abandon: 不確実なまま fence する(プロセスに触らない)stop
reasonNoキャンセル理由(task の result に 'cancelled: <reason>' として記録)
taskIdYesキャンセルするタスク ID
cascadeNotrue(既定)は子孫タスクとその worker まで**子から順**に止める(cascade)。false なら対象タスクだけ。worktree / ターミナルの削除はどちらも行わない
includeSubRunsNotrue(既定)は cascade 対象に Commander 自作の sub-run の部分木も含める(sub-run の worker を走りたままにしないため)。上限(子孫 12 件)は sub-run 込みの件数で判定する

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes well beyond the annotations by disclosing preflight limits, error codes such as cancel_scope_too_large and cancel_ownership_unverified, partial-failure behavior, idempotency, and the fact that worktrees and terminals are not deleted. It also explains what fullyStopped means and warns that mode=abandon does not guarantee OS process termination.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the description is extremely long and mixes agent-facing guidance with internal CLI mechanics and many edge-case error codes. Several implementation-detail sentences do not directly help an agent select or invoke the tool, making it verbose despite the bold structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, multi-step cancellation tool with no output schema, the description is highly complete. It covers preflight failures, partial success, return-field meaning, sub-run ownership verification, and pagination completeness, which are exactly the gaps an agent would otherwise need to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description still adds operational meaning for key parameters: the default cascade behavior, how includeSubRuns affects the 12-task limit, and the consequence of mode=abandon for process termination. Much of this overlaps with the schema, but the added caveats are useful.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description starts with a specific verb and resource: cancelling a delegated job. It elaborates scope with cascade and sub-run behavior, so the operation is clearly a cancellation rather than a release or status read. It does not explicitly compare itself to sibling tools such as orca_release_task, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains when cascade applies, how to avoid sub-runs with includeSubRuns: false or cascade: false, and that completed or cancelled tasks are idempotently ignored. It lacks an explicit statement of when to prefer this over other task-management siblings, but the operational context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.