概述
openclaw tasks 检查持久化后台任务和 Task Flow 状态。无子命令时等同于 tasks list。
openclaw tasks [--runtime <name>] [--status <name>] [--json]
openclaw tasks list
openclaw tasks show <lookup>
openclaw tasks notify <lookup> <policy>
openclaw tasks cancel <lookup>
openclaw tasks audit [--severity <warn|error>] [--code <name>] [--limit N] [--json]
openclaw tasks maintenance [--apply] [--json]
openclaw tasks flow list [--status <name>] [--json]
openclaw tasks flow show <lookup> [--json]
openclaw tasks flow cancel <lookup>过滤选项
| 选项 | 可选值 |
|---|---|
--runtime <name> | subagent、acp、cron、cli |
--status <name> | queued、running、succeeded、failed、timed_out、cancelled、lost |
子命令
list
列出后台任务,最新优先。
show <lookup>
按 task ID、run ID 或 session key 查看单个任务。
notify <lookup> <policy>
修改运行中任务的通知策略:done_only、state_changes、silent。
cancel <lookup>
取消运行中的后台任务。
audit
检查过期、丢失、投递失败或不一致的任务和 Task Flow 记录。
- 保留期内的 lost 任务为 warning;过期或无时间戳的 lost 任务为 error
maintenance
预览或应用任务和 Task Flow 的对账、清理、裁剪,以及过期 cron 运行 session 注册表清理。
- 不加
--apply时仅预览 - 应用时同时清理 7 天前的
cron:<jobId>:run:<uuid>session 注册表行(保留当前运行中的 cron 任务)
flow
检查或取消 task ledger 下的持久 Task Flow 状态。
任务来源与通知策略
| 来源 | 运行时类型 | 创建时机 | 默认通知策略 |
|---|---|---|---|
| Sub-agent 编排 | subagent | sessions_spawn 派生 sub-agent | done_only |
| ACP 后台运行 | acp | 派生子 ACP 会话 | done_only |
| Cron 任务 | cron | 每次 cron 执行 | silent |
| CLI 操作 | cli | openclaw agent 命令 | silent |
| Agent 媒体任务 | cli | music_generate/video_generate | silent |
相关页面
- concepts/tool-subagents — Sub-agents(任务的主要来源)
- concepts/tool-acp-agents — ACP agents
- concepts/cli-cron —
openclaw cron