Skip to content

Task audit: inconsistent_timestamps (startedAt < createdAt) on cron-spawned tasks #65987

@AutonomIQ-Labs

Description

@AutonomIQ-Labs

Description

Cron-spawned tasks consistently have startedAt timestamps earlier than createdAt timestamps. This causes the tasks audit to report hundreds of inconsistent_timestamps warnings that are purely cosmetic — all tasks complete normally.

Environment

  • OpenClaw version: 2026.4.11 (769908e)
  • OS: macOS 26.4 (arm64)
  • Node: v25.9.0

Steps to Reproduce

  1. Have several cron jobs running (we have 13 active crons)
  2. Wait for tasks to accumulate over a few days
  3. Run openclaw tasks audit

Observed Behavior

Tasks audit: 461 findings · 1 errors · 460 warnings
Task  warn  inconsistent_timestamps  389335a0-…  succeeded  fresh  startedAt is earlier than createdAt
Task  warn  inconsistent_timestamps  c07a581b-…  succeeded  fresh  startedAt is earlier than createdAt
[... 460 identical warnings]

Every cron-spawned task shows this warning. The tasks themselves all succeed — the timestamps are just recorded in the wrong order.

Expected Behavior

startedAt should be ≥ createdAt, or the audit should not flag this as a warning when the delta is negligible (likely sub-millisecond event ordering issue in the cron scheduler).

Impact

  • Functional: Zero — all tasks run and complete normally
  • Operational: The audit count grows linearly with cron runs, making it impossible to spot real issues in the noise. Our deployment went from 108 → 283 → 348 → 509 → 635 tracked findings in 5 days, almost entirely from this single warning type.
  • Maintenance: openclaw tasks maintenance --apply does not clear these warnings since the tasks are valid completed records, not stale/broken entries.

Suggested Fix

Either:

  1. Set startedAt = max(startedAt, createdAt) when recording the task start event
  2. Suppress the inconsistent_timestamps audit warning when the delta is < 1 second
  3. Allow openclaw tasks maintenance to clear cosmetic timestamp warnings on terminal tasks

Additional Context

The affected crons include various types: recurring (every 45min token refresh), nightly (git backup, PII scan, doc-drift), and frequent (every 5min calendar reminders). All exhibit the same pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions