跳轉到主要內容
檢查持久背景工作與 Task Flow 狀態。若不帶子命令, openclaw tasks 等同於 openclaw tasks list 請參閱背景工作了解生命週期與傳遞 模型,並參閱其 tasks audit 章節取得完整的發現項描述。

用法

openclaw tasks
openclaw tasks list
openclaw tasks list --runtime acp
openclaw tasks list --status running
openclaw tasks show <lookup>
openclaw tasks notify <lookup> state_changes
openclaw tasks cancel <lookup>
openclaw tasks audit
openclaw tasks maintenance
openclaw tasks maintenance --apply
openclaw tasks flow list
openclaw tasks flow show <lookup>
openclaw tasks flow cancel <lookup>

根選項

旗標說明
--json輸出 JSON。
--runtime <name>依類型篩選:subagentacpcroncli
--status <name>依狀態篩選:queuedrunningsucceededfailedtimed_outcancelledlost

子命令

list

openclaw tasks list [--runtime <name>] [--status <name>] [--json]
列出追蹤中的背景工作,最新的在前。

show

openclaw tasks show <lookup> [--json]
依工作 ID、執行 ID 或工作階段鍵顯示一個工作。

notify

openclaw tasks notify <lookup> <done_only|state_changes|silent>
變更執行中工作的通知政策。

cancel

openclaw tasks cancel <lookup>
取消執行中的背景工作。

audit

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

openclaw tasks maintenance [--apply] [--json]
預覽或套用工作與 Task Flow 的協調、清理標記、 修剪,以及過期的 Cron 執行工作階段登錄清理。 對於 Cron 工作,協調會先使用持久化的執行記錄/作業狀態, 再將舊的作用中工作標記為 lost,因此已完成的 Cron 執行不會只因 記憶體中的閘道執行階段狀態消失,就變成錯誤的稽核錯誤。 離線命令列介面稽核並非閘道行程本機 Cron 作用中作業集合的權威來源。 具有執行 ID/來源 ID 的命令列介面工作,會在其即時閘道執行脈絡消失時 標記為 lost,即使仍有舊的子工作階段列存在。 套用後,維護也會修剪超過 7 天的 cron:<jobId>:run:<uuid> 工作階段 登錄列,同時保留目前執行中的 Cron 作業,並讓非 Cron 工作階段列保持不變。

flow

openclaw tasks flow list [--status <name>] [--json]
openclaw tasks flow show <lookup> [--json]
openclaw tasks flow cancel <lookup>
檢查或取消工作分類帳下的持久 Task Flow 狀態。 flow list --status 接受 queuedrunningwaitingblockedsucceededfailedcancelledlost

相關