openclaw - ✅(Solved) Fix [Feature]: readable `nextAt` value for cron job [5 pull requests, 2 comments, 2 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#58574Fetched 2026-04-08 02:00:49
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×5commented ×2labeled ×1referenced ×1

21:43:29+00:00 debug cron {"module":"cron","storePath":"/root/.openclaw/cron/jobs.json"} {"nextAt":1774996829150,"d

The cron job's "nextAt" is a unix timestamp. Can we change it to a human readable timestamp or add a duplicate new field if backward compatibility is an issue.

Root Cause

21:43:29+00:00 debug cron {"module":"cron","storePath":"/root/.openclaw/cron/jobs.json"} {"nextAt":1774996829150,"d

The cron job's "nextAt" is a unix timestamp. Can we change it to a human readable timestamp or add a duplicate new field if backward compatibility is an issue.

PR fix notes

PR #58703: Fix: add human-readable ISO timestamps to cron logs and events (Resolves #58574)

Description (problem / solution / changelog)

Fixes #58574.

Adds human-readable ISO timestamp fields (nextRunAt, nextAtIso, nextWakeAt) alongside the existing raw millisecond timestamps in cron debug/info log output and CronEvent emissions.

Before: {"nextAt":1774996829150,"delayMs":60000,...} After: {"nextAt":1774996829150,"nextAtIso":"2026-04-01T12:00:29.150Z","delayMs":60000,...}

Changes

  • state.ts: add formatMsToIso() helper, add nextRunAt to CronEvent, add nextWakeAt to CronStatusSummary
  • timer.ts: add ISO timestamps to armTimer debug log, retry/backoff info logs, and emitJobFinished
  • ops.ts: add ISO timestamps to job added/updated/finished events, status summary, and cron started log

All 51 existing cron tests pass. No new dependencies. Backward compatible — raw ms fields are preserved.

Changed files

  • src/cron/service/ops.ts (modified, +11/-3)
  • src/cron/service/state.test.ts (modified, +24/-1)
  • src/cron/service/state.ts (modified, +15/-0)
  • src/cron/service/timer.ts (modified, +10/-2)

PR #58906: cron: add human-readable timestamps to nextAt/nextRunAtMs log fields

Description (problem / solution / changelog)

Summary

Adds human-readable ISO-8601 timestamp fields alongside raw epoch-ms values in cron log output and events, making debug logs much easier to read without manual conversion.

Closes #58574

Change type

  • Enhancement to an existing feature

Scope

  • Minor (1-2 files, <50 lines)

What changed

  • Added formatEpochMs() helper in src/cron/service/timer.ts that converts epoch-ms to ISO-8601 string (with undefined/NaN/Infinity guards)
  • Added nextAtHuman field to the "cron: timer armed" debug log
  • Added nextRunAt field to "cron: scheduling one-shot retry" and "cron: applying error backoff" info logs
  • Added nextRunAt field to the CronEvent type and emitJobFinished event payload
  • Added 4 unit tests for formatEpochMs

Before

debug cron {"nextAt":1774996829150,"delayMs":60000} "cron: timer armed"

After

debug cron {"nextAt":1774996829150,"nextAtHuman":"2026-04-01T12:00:29.150Z","delayMs":60000} "cron: timer armed"

Backward compatibility

  • The raw nextAt / nextRunAtMs fields are preserved unchanged
  • The new nextRunAt field on CronEvent is optional (string | undefined)
  • No config schema or stored data format changes

Test plan

  • pnpm test -- src/cron/service/timer.test.ts — 6/6 pass (including 4 new formatEpochMs tests)
  • pnpm check — all lint/type checks pass

Made with Cursor

Changed files

  • src/cron/service/state.ts (modified, +2/-0)
  • src/cron/service/timer.test.ts (modified, +20/-1)
  • src/cron/service/timer.ts (modified, +17/-1)

PR #58908: cron: add human-readable timestamps to nextAt/nextRunAtMs log fields

Description (problem / solution / changelog)

Summary

Adds human-readable ISO-8601 timestamp fields alongside raw epoch-ms values in cron log output and events, making debug logs much easier to read without manual conversion.

Closes #58574

Change type

  • Enhancement to an existing feature

Scope

  • Minor (1-2 files, <50 lines)

What changed

  • Added formatEpochMs() helper in src/cron/service/timer.ts that converts epoch-ms to ISO-8601 string (with undefined/NaN/Infinity guards)
  • Added nextAtHuman field to the "cron: timer armed" debug log
  • Added nextRunAt field to "cron: scheduling one-shot retry" and "cron: applying error backoff" info logs
  • Added nextRunAt field to the CronEvent type and emitJobFinished event payload
  • Added 4 unit tests for formatEpochMs

Before

debug cron {"nextAt":1774996829150,"delayMs":60000} "cron: timer armed"

After

debug cron {"nextAt":1774996829150,"nextAtHuman":"2026-04-01T12:00:29.150Z","delayMs":60000} "cron: timer armed"

Backward compatibility

  • The raw nextAt / nextRunAtMs fields are preserved unchanged
  • The new nextRunAt field on CronEvent is optional (string | undefined)
  • No config schema or stored data format changes

Test plan

  • pnpm test -- src/cron/service/timer.test.ts — 6/6 pass (including 4 new formatEpochMs tests)
  • pnpm check — all lint/type checks pass

Made with Cursor

Changed files

  • src/cron/service/state.ts (modified, +2/-0)
  • src/cron/service/timer.test.ts (modified, +20/-1)
  • src/cron/service/timer.ts (modified, +17/-1)

PR #58907: cron: add human-readable timestamps to nextAt/nextRunAtMs log fields

Description (problem / solution / changelog)

Summary

Adds human-readable ISO-8601 timestamp fields alongside raw epoch-ms values in cron log output and events, making debug logs much easier to read without manual conversion.

Closes #58574

Change type

  • Enhancement to an existing feature

Scope

  • Minor (1-2 files, <50 lines)

What changed

  • Added formatEpochMs() helper in src/cron/service/timer.ts that converts epoch-ms to ISO-8601 string (with undefined/NaN/Infinity guards)
  • Added nextAtHuman field to the "cron: timer armed" debug log
  • Added nextRunAt field to "cron: scheduling one-shot retry" and "cron: applying error backoff" info logs
  • Added nextRunAt field to the CronEvent type and emitJobFinished event payload
  • Added 4 unit tests for formatEpochMs

Before

debug cron {"nextAt":1774996829150,"delayMs":60000} "cron: timer armed"

After

debug cron {"nextAt":1774996829150,"nextAtHuman":"2026-04-01T12:00:29.150Z","delayMs":60000} "cron: timer armed"

Backward compatibility

  • The raw nextAt / nextRunAtMs fields are preserved unchanged
  • The new nextRunAt field on CronEvent is optional (string | undefined)
  • No config schema or stored data format changes

Test plan

  • pnpm test -- src/cron/service/timer.test.ts — 6/6 pass (including 4 new formatEpochMs tests)
  • pnpm check — all lint/type checks pass

Made with Cursor

Changed files

  • src/cron/service/state.ts (modified, +2/-0)
  • src/cron/service/timer.test.ts (modified, +20/-1)
  • src/cron/service/timer.ts (modified, +17/-1)

PR #59248: fix(cron): add readable nextAt companion field to timer logs

Description (problem / solution / changelog)

Summary

  • Problem: cron: timer armed debug logs expose nextAt only as a Unix ms timestamp.
  • Why it matters: operators have to manually convert it when debugging cron scheduling.
  • What changed: added nextAtReadable as an ISO-8601 companion field while preserving numeric nextAt.
  • What did NOT change: scheduler behavior, persisted state, CLI output, and existing nextAt semantics remain unchanged.

AI-assisted: yes; author reviewed and verified the final code, tests, and PR framing.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #58574
  • Related: none
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

  • Root cause: the timer-armed debug payload included only the numeric timestamp.
  • Missing detection / guardrail: no seam test asserted a human-readable companion field on that debug log payload.
  • Prior context (git blame, prior PR, issue, or refactor if known): N/A
  • Why this regressed now: N/A
  • If unknown, what was ruled out: persisted cron state and CLI output were inspected and are not part of the issue.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/cron/service/timer.test.ts
  • Scenario the test should lock in: when the timer is armed, the debug payload includes both numeric nextAt and ISO nextAtReadable.
  • Why this is the smallest reliable guardrail: the change is only in the timer-arm logging seam.
  • Existing test that already covers this (if any): existing timer seam test already asserted timer arming behavior and logger interaction.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Debug logs for cron: timer armed now include nextAtReadable in ISO-8601 format.

Diagram (if applicable)

N/A

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local clean clone
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): cron timer seam tests only

Steps

  1. Run pnpm test -- src/cron/service/timer.test.ts
  2. Inspect the logger assertion on the timer-armed debug payload.
  3. Optionally inspect a live debug log entry after arming a cron timer.

Expected

  • The debug payload contains both numeric nextAt and readable nextAtReadable.

Actual

  • Matches expected after the change.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: targeted timer seam test passes; logger payload includes both nextAt and nextAtReadable.
  • Edge cases checked: machine-readable nextAt remains present.
  • What you did not verify: full gateway manual log capture in a real cron deployment.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: consumers might start depending on nextAtReadable once it exists.
    • Mitigation: keep numeric nextAt unchanged and document nextAtReadable as an additive debug field.
  • Risk: accidental unrelated worktree noise in PR.
    • Mitigation: verify clean git status before posting and do not include unrelated lockfile changes.

Changed files

  • src/cron/service/timer.test.ts (modified, +8/-0)
  • src/cron/service/timer.ts (modified, +6/-1)
RAW_BUFFERClick to expand / collapse

Summary

21:43:29+00:00 debug cron {"module":"cron","storePath":"/root/.openclaw/cron/jobs.json"} {"nextAt":1774996829150,"d

The cron job's "nextAt" is a unix timestamp. Can we change it to a human readable timestamp or add a duplicate new field if backward compatibility is an issue.

Problem to solve

The cron job's "nextAt" is a unix timestamp. Can we change it to a human readable timestamp or add a duplicate new field if backward compatibility is an issue.

Proposed solution

The cron job's "nextAt" is a unix timestamp. Can we change it to a human readable timestamp or add a duplicate new field if backward compatibility is an issue.

Alternatives considered

No response

Impact

Affected users: all Severity: minor Frequency: intermittent Consequece: extra manual work

Evidence/examples

No response

Additional information

No response

extent analysis

TL;DR

Modify the cron job to include a human-readable timestamp field, either by replacing the existing "nextAt" field or adding a new field to maintain backward compatibility.

Guidance

  • Identify the cron job's implementation details to determine the best approach for modifying the "nextAt" field.
  • Consider adding a new field, such as "nextAtHumanReadable", to store the human-readable timestamp and maintain backward compatibility.
  • Evaluate the impact of changing the existing "nextAt" field on dependent systems or workflows.
  • Develop a plan to update any affected code or configurations to handle the new timestamp format.

Notes

The ideal solution depends on the specific requirements and constraints of the cron job and its dependencies, which are not fully detailed in the issue.

Recommendation

Apply workaround: Add a new field, such as "nextAtHumanReadable", to store the human-readable timestamp, as this approach maintains backward compatibility and minimizes potential disruptions to dependent systems.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature]: readable `nextAt` value for cron job [5 pull requests, 2 comments, 2 participants]