Skip to content

fix(cron): one-shot details omit seconds and milliseconds - #197791

Merged
obviyus merged 1 commit into
openclaw:mainfrom
Malpin07:fix/cron-show-at-precision
Nov 12, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
Malpin07:fix/cron-show-at-precision

Conversation

@Malpin07

Copy link
Copy Markdown
Contributor

Closes #197789

What Problem This Solves

Fixes one-shot schedule details losing their configured seconds and milliseconds in automations show and cron show.

User Impact

Users can distinguish one-shot jobs scheduled at different times within the same minute. Compact list output, stored schedules, JSON output, and execution behavior remain unchanged.

Why This Change Was Made

Use the existing schedule formatter's full UTC timestamp for the detail view while retaining minute precision for summaries.

Evidence

Reproduced through the built CLI and an isolated local Gateway at a41c7111, then checked the same workflow at 7a6226b2. Three jobs were disabled system-event jobs; scheduling and delivery were not exercised.

Stored schedule.at Before: detail schedule: After: detail schedule:
2030-02-15T12:34:12.321Z at 2030-02-15 12:34Z at 2030-02-15 12:34:12.321Z
2030-02-15T12:34:56.789Z at 2030-02-15 12:34Z at 2030-02-15 12:34:56.789Z
2030-02-15T12:34:00.000Z at 2030-02-15 12:34Z at 2030-02-15 12:34:00.000Z

Both command aliases agree. List rows retain at 2030-02-15 12:34Z; JSON retains each original timestamp. Each run completed 14 CLI calls with exit 0 and cleaned up the isolated Gateway and temporary state.

Reproduction and local checks

With an isolated Gateway and cron.enabled=false:

openclaw cron add --name precision-b --at '2030-02-15T12:34:56.789Z' \
  --system-event 'Disabled test automation' --session main --disabled --json
openclaw automations show <job-id>
openclaw cron show <job-id>
openclaw cron show <job-id> --json
openclaw automations list --all
  • Regression: old implementation fails the full-time detail assertion; fixed implementation passes all 46 tests in src/cli/cron-cli/shared.test.ts.
  • Three related CLI consumer files: 104 tests pass. Total: 150 tests across four files, using --maxWorkers=1.
  • Core and cron-test type checks, type-aware lint, formatting, test-line and maximum-line ratchets, changed-lane selection, and whitespace checks pass.
  • Existing table cases cover explicit UTC offset normalization, extended years, invalid timestamps, and the trigger suffix. Test lines added: 0 net.
  • Changed-file single-worker wall time: 119.829 seconds, including cold compiled-worker preparation; Vitest reports 98% transform time.
  • Fresh independent code review found no actionable issues. Repository commit hooks passed.
  • Full pnpm build passes on both the baseline (647.643 s) and final commit (543.037 s); final build metadata matches 7a6226b22099c27165c7610923b31b844d8eec9e.
  • Environment: WSL2 Ubuntu 26.04, Node 26.12.1, pnpm 12.15.0, repository-pinned Bun. Native Windows/macOS and the full repository test suite were not run.

Observed final-head stdout excerpt for job 3a23b5b4-7614-456e-b909-0a1031fbece0:

enabled: no
schedule: at 2030-02-15 12:34:56.789Z
policies: -
trigger: -
session: main

The corresponding JSON contains "schedule":{"kind":"at","at":"2030-02-15T12:34:56.789Z"}. Before the change, the same configured time produced schedule: at 2030-02-15 12:34Z.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Show seconds and milliseconds for one-shot schedules in CLI details while preserving compact schedule summaries.

Example: Inspect a job scheduled at 2030-02-15T12:34:56.789Z with openclaw cron show.

  • Before: schedule: at 2030-02-15 12:34Z
  • After: schedule: at 2030-02-15 12:34:56.789Z

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with production CLI proof, meaningful regression coverage, passing head gates, and no open findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The body and obviyus's recorded CLI output exercise the unchanged candidate through built cron show and automations show against isolated Gateways, demonstrating restored precision with unchanged list, JSON, and recurring-schedule controls.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users inspecting one-shot jobs cannot distinguish configured times within the same minute.
Reason: Restoring detail precision has clear inspection value and preserves compact output, stored schedules, JSON, and execution behavior.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current CLI display defect with a focused change, sufficient production CLI proof, passing head CI, and no actionable findings.

Priority: P3
Reviewed head: 7a6226b22099c27165c7610923b31b844d8eec9e

Before merge

None.

Findings

None.

Agent review details

How this fits together

The cron and automations command aliases read jobs from the Gateway and send human-readable details through a shared formatter; JSON output uses a separate branch.

flowchart TD
  A[Cron or automations CLI] --> B[Gateway job lookup]
  B --> C[Human details]
  B --> D[JSON output]
  C --> E[Shared schedule formatter]
  E --> F[Full UTC timestamp]
Loading

Technical review

Best possible solution:

Merge the existing formatter change to preserve exact one-shot times in details while retaining compact summaries.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically truncates the timestamp, and supplied baseline CLI output demonstrates the same failure through both aliases; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is the smallest complete fix using the existing formatter, preserves normalization and sanitization, and strengthens existing rendering cases without adding scaffolding.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b46197029a3a.

Provenance checked

  • One-shot timestamp normalization and summary formatting keeps the original intent (5170c24: Repair expanded-year and timezone handling while retaining compact UTC summaries.)
  • ISO schedule representation keeps the original intent (3f82dae: Migrate one-shot schedule timestamps to ISO strings across storage and clients.)
  • Trigger suffix keeps the original intent (a6768d9: Expose condition-watcher triggers alongside their schedules.)
  • Terminal output boundary keeps the original intent (36c440a: Prevent stored strings from injecting terminal controls into human-readable output.)
  • Consolidated rendering tests keeps the original intent (e003183: Reduce redundant test layers while retaining distinct observable contracts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 36c440a adds src/cli/cron-cli/shared.ts:543 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 36c440aa2b1e; files: src/cli/cron-cli/shared.ts)
  • Ayaan Zaidi: Raw commit 0b25a73 adds src/cli/cron-cli/shared.ts:356 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0b25a7328880; files: src/cli/cron-cli/shared.ts)

PR surface

Source +2, Tests 0. Total +2 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 11 9 +2
Tests 1 2 2 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 13 11 +2

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #197789
Summary: This PR repairs the detail-precision defect documented by the paired open issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a low-severity display correction with a JSON workaround and no scheduling or stored-data failure.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-12T15:17:38.947Z sha 7a6226b :: needs maintainer review before merge. :: none

Reviewed November 12, 2026, 11:08 AM ET / 16:08 UTC (Revision 2).

@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Proof on the built CLI (node openclaw.mjs, pnpm build), secretless node:24.22.1 container, no network. Each run starts its own Gateway with cron.enabled: false, so nothing fires, then adds disabled jobs with openclaw cron add --disabled --system-event ping. Main 7b75336b789c, candidate 7a6226b22099 (Malpin07's commit, unchanged). Two rounds each, fresh state every round.

Main, both rounds: two jobs at different seconds look the same in cron show and automations show:

$ openclaw cron show <at-12>          schedule: at 2030-02-15 12:34Z
$ openclaw automations show <at-45>   schedule: at 2030-02-15 12:34Z
$ openclaw automations show <at-12>   schedule: at 2030-02-15 12:34Z
$ openclaw cron show <at-45>          schedule: at 2030-02-15 12:34Z

Candidate, both rounds: the full stored time shows:

$ openclaw cron show <at-12>          schedule: at 2030-02-15 12:34:12.321Z
$ openclaw automations show <at-45>   schedule: at 2030-02-15 12:34:45.678Z
$ openclaw automations show <at-12>   schedule: at 2030-02-15 12:34:12.321Z
$ openclaw cron show <at-45>          schedule: at 2030-02-15 12:34:45.678Z

Controls

  • cron list --all rows stay at the minute on both: at 2030-02-15 12:34Z for all three one-shot jobs.
  • cron show --json is the same on both (apart from ids and timestamps), and the stored schedules match: {"kind":"at","at":"2030-02-15T12:34:12.321Z"}, …12:34:45.678Z.
  • Cron expression and repeating jobs show the same on both: cron 5 7 * * * @ UTC (exact) and every 10m.
  • A whole-minute job (--at 2030-02-15T12:34:00Z): main shows at 2030-02-15 12:34Z, candidate shows at 2030-02-15 12:34:00.000Z (the same form as the stored ISO time).

Candidate checks: src/cli/cron-cli/shared.test.ts 46/46. Net test lines 0.

@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 12, 2026
@obviyus
obviyus merged commit ec789a4 into openclaw:main Nov 12, 2026
124 of 125 checks passed
@obviyus

obviyus commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Landed in ec789a4. Thanks @Malpin07.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…97791)

fix(cron): show the full one-shot time in cron and automations details

openclaw cron show and automations show formatted a one-shot job's at time to the minute, so jobs at different seconds in the same minute looked identical. The detail view now shows the configured time with seconds and milliseconds. The compact cron list row, --json output, stored schedules, and cron-expression and repeating schedules are unchanged. No new text.

Evidence: the built CLI against an isolated Gateway with cron disabled, two disabled one-shot jobs at 12:34:12.321Z and 12:34:45.678Z, main twice and candidate twice. On main both details show 12:34Z; with this change they show 12:34:12.321Z and 12:34:45.678Z. The list row, --json, stored schedules and repeating jobs are the same on both; a whole-minute job shows 12:34:00.000Z. Net test lines 0. Details: openclaw#197791 (comment).

Closes openclaw#197789. Thanks @Malpin07.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: one-shot automation details omit configured seconds and milliseconds

2 participants