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?
このページの内容

このページの内容