openclaw - 💡(How to fix) Fix [Bug]: cron run history can say finished ok while task audit still reports lost backing session missing [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63196Fetched 2026-04-09 07:57:09
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

openclaw tasks audit can report a cron task as lost with backing session missing even when the cron run history shows that same job run finished successfully.

In this state:

  • openclaw status shows a task audit error
  • openclaw tasks maintenance --apply does not clear it
  • the cron job itself continues to run successfully afterward

So task registry state and cron run history disagree, and maintenance cannot reconcile the stale lost row.

Error Message

  • openclaw status shows a task audit error Tasks: 0 active · 0 queued · 0 running · 11 issues · audit 1 error · 219 warn · 330 tracked Task error lost 55aad356-… lost 1h12m backing session missing If cron run history records the run as finished + ok, task audit should not still surface a lost task error for the same logical run. Task error lost 55aad356-… lost 1h12m backing session missing
  • operators see a real audit error even though the cron job is actually succeeding

Root Cause

openclaw tasks audit can report a cron task as lost with backing session missing even when the cron run history shows that same job run finished successfully.

In this state:

  • openclaw status shows a task audit error
  • openclaw tasks maintenance --apply does not clear it
  • the cron job itself continues to run successfully afterward

So task registry state and cron run history disagree, and maintenance cannot reconcile the stale lost row.

Code Example

openclaw status --deep

---

Tasks: 0 active · 0 queued · 0 running · 11 issues · audit 1 error · 219 warn · 330 tracked

---

openclaw tasks audit

---

Tasks audit: 222 findings · 1 errors · 221 warnings
Task findings: 220 · TaskFlow findings: 2
Task     error    lost  55aad356-…  lost  1h12m  backing session missing

---

sqlite3 ~/.openclaw/tasks/runs.sqlite \
  ".headers on" \
  ".mode column" \
  "select task_id,runtime,source_id,label,status,delivery_status,datetime(created_at/1000,'unixepoch','localtime') as created_local,datetime(started_at/1000,'unixepoch','localtime') as started_local,datetime(last_event_at/1000,'unixepoch','localtime') as last_event_local,datetime(ended_at/1000,'unixepoch','localtime') as ended_local,child_session_key from task_runs where status='lost' order by created_at desc limit 5;"

---

task_id                               runtime  source_id                             label                        status  delivery_status  created_local        started_local        last_event_local     ended_local          child_session_key
55aad356-acb8-47bf-8798-44c12796fdcd  cron     049dcc9c-a957-4ed8-94d2-a44ce08b36b1  hourly-memory-summarizer-v2  lost    not_applicable   2026-04-08 21:08:06  2026-04-08 21:08:06  2026-04-08 21:19:59  2026-04-08 21:19:59

---

# source_id from the lost row above
openclaw cron runs 049dcc9c-a957-4ed8-94d2-a44ce08b36b1

---

{
  "jobId": "049dcc9c-a957-4ed8-94d2-a44ce08b36b1",
  "action": "finished",
  "status": "ok",
  "runAtMs": 1775657101113,
  "durationMs": 59341,
  "sessionId": "5cea71a5-f2c8-45c1-a3b1-cbe779df3cb3",
  "sessionKey": "agent:summarizer-agent:cron:049dcc9c-a957-4ed8-94d2-a44ce08b36b1:run:5cea71a5-f2c8-45c1-a3b1-cbe779df3cb3"
}

---

openclaw tasks maintenance --apply

---

Tasks maintenance (applied): tasks 0 reconcile · 0 cleanup stamp · 0 prune; task-flows 0 reconcile · 0 prune
Tasks health after apply: 0 queued · 0 running · 1 audit errors · 221 audit warnings
Tasks health before apply: 1 audit errors · 221 audit warnings

---

# audit
Tasks audit: 222 findings · 1 errors · 221 warnings
Task findings: 220 · TaskFlow findings: 2
Task     error    lost  55aad356-…  lost  1h12m  backing session missing

# lost row in sqlite
task_id                               runtime  source_id                             label                        status  delivery_status  created_local        started_local        last_event_local     ended_local          child_session_key
55aad356-acb8-47bf-8798-44c12796fdcd  cron     049dcc9c-a957-4ed8-94d2-a44ce08b36b1  hourly-memory-summarizer-v2  lost    not_applicable   2026-04-08 21:08:06  2026-04-08 21:08:06  2026-04-08 21:19:59  2026-04-08 21:19:59

# maintenance cannot clear it
Tasks maintenance (applied): tasks 0 reconcile · 0 cleanup stamp · 0 prune; task-flows 0 reconcile · 0 prune
Tasks health after apply: 0 queued · 0 running · 1 audit errors · 221 audit warnings
Tasks health before apply: 1 audit errors · 221 audit warnings
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

openclaw tasks audit can report a cron task as lost with backing session missing even when the cron run history shows that same job run finished successfully.

In this state:

  • openclaw status shows a task audit error
  • openclaw tasks maintenance --apply does not clear it
  • the cron job itself continues to run successfully afterward

So task registry state and cron run history disagree, and maintenance cannot reconcile the stale lost row.

Steps to reproduce

I hit this live on OpenClaw 2026.4.8 on Linux arm64 (Raspberry Pi, systemd gateway).

  1. Run:
openclaw status --deep

Observed task health summary included:

Tasks: 0 active · 0 queued · 0 running · 11 issues · audit 1 error · 219 warn · 330 tracked
  1. Run:
openclaw tasks audit

Observed:

Tasks audit: 222 findings · 1 errors · 221 warnings
Task findings: 220 · TaskFlow findings: 2
Task     error    lost  55aad356-…  lost  1h12m  backing session missing
  1. Check the task store directly:
sqlite3 ~/.openclaw/tasks/runs.sqlite \
  ".headers on" \
  ".mode column" \
  "select task_id,runtime,source_id,label,status,delivery_status,datetime(created_at/1000,'unixepoch','localtime') as created_local,datetime(started_at/1000,'unixepoch','localtime') as started_local,datetime(last_event_at/1000,'unixepoch','localtime') as last_event_local,datetime(ended_at/1000,'unixepoch','localtime') as ended_local,child_session_key from task_runs where status='lost' order by created_at desc limit 5;"

Observed row:

task_id                               runtime  source_id                             label                        status  delivery_status  created_local        started_local        last_event_local     ended_local          child_session_key
55aad356-acb8-47bf-8798-44c12796fdcd  cron     049dcc9c-a957-4ed8-94d2-a44ce08b36b1  hourly-memory-summarizer-v2  lost    not_applicable   2026-04-08 21:08:06  2026-04-08 21:08:06  2026-04-08 21:19:59  2026-04-08 21:19:59
  1. Check cron run history for that source_id job:
# source_id from the lost row above
openclaw cron runs 049dcc9c-a957-4ed8-94d2-a44ce08b36b1

Observed most recent run:

{
  "jobId": "049dcc9c-a957-4ed8-94d2-a44ce08b36b1",
  "action": "finished",
  "status": "ok",
  "runAtMs": 1775657101113,
  "durationMs": 59341,
  "sessionId": "5cea71a5-f2c8-45c1-a3b1-cbe779df3cb3",
  "sessionKey": "agent:summarizer-agent:cron:049dcc9c-a957-4ed8-94d2-a44ce08b36b1:run:5cea71a5-f2c8-45c1-a3b1-cbe779df3cb3"
}
  1. Try built-in repair:
openclaw tasks maintenance --apply

Observed:

Tasks maintenance (applied): tasks 0 reconcile · 0 cleanup stamp · 0 prune; task-flows 0 reconcile · 0 prune
Tasks health after apply: 0 queued · 0 running · 1 audit errors · 221 audit warnings
Tasks health before apply: 1 audit errors · 221 audit warnings

Expected behavior

If cron run history records the run as finished + ok, task audit should not still surface a lost task error for the same logical run.

At minimum, openclaw tasks maintenance --apply should reconcile or prune this stale lost row so audit returns 0 errors.

Actual behavior

A lost task row remains in ~/.openclaw/tasks/runs.sqlite and continues to trigger:

  • task/lost
  • backing session missing

This happens even though cron run history shows successful completion for the same job, and maintenance does not clear it.

OpenClaw version

2026.4.8

Operating system

Linux 6.12.62+rpt-rpi-2712 (arm64)

Install method

pnpm

Model

openai-codex/gpt-5.4

Provider / routing chain

openclaw -> openai-codex

Additional provider/model setup details

Gateway service via systemd on Raspberry Pi.

Logs, screenshots, and evidence

# audit
Tasks audit: 222 findings · 1 errors · 221 warnings
Task findings: 220 · TaskFlow findings: 2
Task     error    lost  55aad356-…  lost  1h12m  backing session missing

# lost row in sqlite
task_id                               runtime  source_id                             label                        status  delivery_status  created_local        started_local        last_event_local     ended_local          child_session_key
55aad356-acb8-47bf-8798-44c12796fdcd  cron     049dcc9c-a957-4ed8-94d2-a44ce08b36b1  hourly-memory-summarizer-v2  lost    not_applicable   2026-04-08 21:08:06  2026-04-08 21:08:06  2026-04-08 21:19:59  2026-04-08 21:19:59

# maintenance cannot clear it
Tasks maintenance (applied): tasks 0 reconcile · 0 cleanup stamp · 0 prune; task-flows 0 reconcile · 0 prune
Tasks health after apply: 0 queued · 0 running · 1 audit errors · 221 audit warnings
Tasks health before apply: 1 audit errors · 221 audit warnings

Impact and severity

Severity: Low to Medium

The system still works, but status/audit become noisy and misleading:

  • operators see a real audit error even though the cron job is actually succeeding
  • built-in maintenance cannot repair it
  • stale rows may accumulate and hide real task-health problems

Additional information

This seems related to the broader task-registry/task-maintenance bookkeeping issues around cron/CLI rows, but this specific symptom is different from stale running rows.

Here the row is already terminal (lost) with timestamps populated, while cron history independently says the run finished ok.

So either:

  1. task-run creation/finalization is producing duplicate/conflicting rows for one cron run, or
  2. task audit/maintenance is matching the wrong backing-session expectations for cron runs after completion, or
  3. cron run completion and task-registry cleanup are not using the same source of truth.

extent analysis

TL;DR

The most likely fix for the issue where openclaw tasks audit reports a cron task as lost with backing session missing despite successful completion is to manually remove the stale lost row from the task registry.

Guidance

  1. Verify the issue: Run openclaw tasks audit and openclaw cron runs <source_id> to confirm the discrepancy between the task registry and cron run history.
  2. Manually remove the stale row: Use the provided SQLite query to identify the stale lost row and manually remove it from the ~/.openclaw/tasks/runs.sqlite database.
  3. Run maintenance again: After removing the stale row, run openclaw tasks maintenance --apply to ensure the task registry is consistent.
  4. Monitor the issue: Continue to monitor the task registry and cron run history to ensure the issue does not recur.

Example

To manually remove the stale lost row, you can use the following SQLite query:

DELETE FROM task_runs WHERE task_id = '55aad356-acb8-47bf-8798-44c12796fdcd';

Replace the task_id with the actual ID of the stale lost row.

Notes

This workaround assumes that the stale lost row is the cause of the issue and that manually removing it will resolve the discrepancy between the task registry and cron run history. However, the root cause of the issue may still need to be investigated to prevent similar problems in the future.

Recommendation

Apply the workaround by manually removing the stale lost row and running maintenance again. This should resolve the immediate issue, but further investigation may be needed to prevent similar problems in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If cron run history records the run as finished + ok, task audit should not still surface a lost task error for the same logical run.

At minimum, openclaw tasks maintenance --apply should reconcile or prune this stale lost row so audit returns 0 errors.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING