






















@@ -25,8 +25,12 @@ Not every agent run creates a task. Heartbeat turns and normal interactive chat
2525- Tasks are **records**, not schedulers — cron and heartbeat decide _when_ work runs, tasks track _what happened_.
2626- ACP, subagents, all cron jobs, and CLI operations create tasks. Heartbeat turns do not.
2727- Each task moves through `queued → running → terminal` (succeeded, failed, timed_out, cancelled, or lost).
28-- Cron tasks stay live while the cron runtime still owns the job; chat-backed CLI tasks stay live only while their owning run context is still active.
29-- Completion is push-driven: detached work can notify directly or wake the requester session/heartbeat when it finishes, so status polling loops are usually the wrong shape.
28+- Cron tasks stay live while the cron runtime still owns the job; if the
29+ in-memory runtime state is gone, task maintenance first checks durable cron
30+ run history before marking a task lost.
31+- Completion is push-driven: detached work can notify directly or wake the
32+ requester session/heartbeat when it finishes, so status polling loops are
33+ usually the wrong shape.
3034- Isolated cron runs and subagent completions best-effort clean up tracked browser tabs/processes for their child session before final cleanup bookkeeping.
3135- Isolated cron delivery suppresses stale interim parent replies while descendant subagent work is still draining, and it prefers final descendant output when that arrives before delivery.
3236- Completion notifications are delivered directly to a channel or queued for the next heartbeat.
@@ -143,8 +147,14 @@ Agent run completion is authoritative for active task records. A successful deta
143147144148- ACP tasks: backing ACP child session metadata disappeared.
145149- Subagent tasks: backing child session disappeared from the target agent store.
146-- Cron tasks: the cron runtime no longer tracks the job as active.
147-- CLI tasks: isolated child-session tasks use the child session; chat-backed CLI tasks use the live run context instead, so lingering channel/group/direct session rows do not keep them alive. Gateway-backed `openclaw agent` runs also finalize from their run result, so completed runs do not sit active until the sweeper marks them `lost`.
150+- Cron tasks: the cron runtime no longer tracks the job as active and durable
151+ cron run history does not show a terminal result for that run. Offline CLI
152+ audit does not treat its own empty in-process cron runtime state as authority.
153+- CLI tasks: isolated child-session tasks use the child session; chat-backed
154+ CLI tasks use the live run context instead, so lingering
155+ channel/group/direct session rows do not keep them alive. Gateway-backed
156+`openclaw agent` runs also finalize from their run result, so completed runs
157+ do not sit active until the sweeper marks them `lost`.
148158149159## Delivery and notifications
150160@@ -236,7 +246,7 @@ openclaw tasks notify <lookup> state_changes
236246Reconciliation is runtime-aware:
237247238248- ACP/subagent tasks check their backing child session.
239-- Cron tasks check whether the cron runtime still owns the job.
249+- Cron tasks check whether the cron runtime still owns the job, then recover terminal status from persisted cron run logs/job state before falling back to `lost`. Only the Gateway process is authoritative for the in-memory cron active-job set; offline CLI audit uses durable history but does not mark a cron task lost solely because that local Set is empty.
240250- Chat-backed CLI tasks check the owning live run context, not just the chat session row.
241251242252Completion cleanup is also runtime-aware:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。