CLI commands

`openclaw tasks`

永続的なバックグラウンドタスクと Task Flow の状態を調査します。サブコマンドを指定しない場合、 openclaw tasksopenclaw tasks list と同等です。

ライフサイクルと配信モデルについては バックグラウンドタスクを、すべての検出項目の説明については、その tasks audit セクションを参照してください。

使用方法

bash
openclaw tasksopenclaw tasks listopenclaw tasks list --runtime acpopenclaw tasks list --status runningopenclaw tasks show <lookup>openclaw tasks notify <lookup> state_changesopenclaw tasks cancel <lookup>openclaw tasks auditopenclaw tasks maintenanceopenclaw tasks maintenance --applyopenclaw tasks flow listopenclaw tasks flow show <lookup>openclaw tasks flow cancel <lookup>

ルートオプション

フラグ 説明
--json JSON を出力します。
--runtime <name> 種別で絞り込みます: subagentacpcron、または cli
--status <name> 状態で絞り込みます: queuedrunningsucceededfailedtimed_outcancelled、または lost

サブコマンド

list

bash
openclaw tasks list [--runtime <name>] [--status <name>] [--json]

追跡中のバックグラウンドタスクを新しい順に一覧表示します。

show

bash
openclaw tasks show <lookup> [--json]

タスク ID、実行 ID、またはセッションキーを使用して、1 件のタスクを表示します。

notify

bash
openclaw tasks notify <lookup> <done_only|state_changes|silent>

実行中のタスクの通知ポリシーを変更します。

cancel

bash
openclaw tasks cancel <lookup>

実行中のバックグラウンドタスクをキャンセルします。

audit

bash
openclaw tasks audit [--severity <warn|error>] [--code <name>] [--limit <n>] [--json]

古くなった、消失した、配信に失敗した、またはその他の不整合があるタスクと Task Flow のレコードを明示します。cleanupAfter まで保持される消失タスクは警告であり、 期限切れまたはタイムスタンプが付与されていない消失タスクはエラーです。

--code には、タスクコード(stale_queuedstale_runninglostdelivery_failedmissing_cleanupinconsistent_timestamps)および Task Flow コード(restore_failedstale_waitingstale_blockedcancel_stuckmissing_linked_tasksblocked_task_missing)を指定できます。 コードごとの重大度とトリガーの詳細については、バックグラウンドタスクを参照してください。

maintenance

bash
openclaw tasks maintenance [--apply] [--json]

タスクと Task Flow の照合、クリーンアップ用タイムスタンプの付与、 刈り込み、および古くなった cron 実行セッションレジストリのクリーンアップをプレビューまたは適用します。

cron タスクでは、古いアクティブタスクを lost としてマークする前に、永続化された実行ログとジョブ状態を照合に使用します。これにより、メモリ内の Gateway ランタイム状態がなくなったという理由だけで、完了済みの cron 実行が誤った監査エラーになることを防ぎます。 オフライン CLI 監査は、Gateway のプロセスローカルなアクティブ cron ジョブセットに対する信頼できる情報源ではありません。実行 ID またはソース ID を持つ CLI タスクは、古い子セッション行が残っていても、ライブ Gateway 実行コンテキストがなくなると lost としてマークされます。

適用時には、現在実行中の cron ジョブを保持し、cron 以外のセッション行には変更を加えずに、7 日より古い cron:<jobId>:run:<uuid> セッションレジストリ行も刈り込みます。

flow

bash
openclaw tasks flow list [--status <name>] [--json]openclaw tasks flow show <lookup> [--json]openclaw tasks flow cancel <lookup>

タスク台帳にある永続的な Task Flow の状態を調査またはキャンセルします。 flow list --status には、queuedrunningwaitingblockedsucceededfailedcancelled、または lost を指定できます。

関連項目

Was this useful?
On this page

On this page