Repository navigation
fix(ui): stop flagging running automations as overdue and show their state - #123745
Conversation
…state The gateway intentionally leaves nextRunAtMs past-due while a run executes (it advances only on the outcome), and agentTurn runs may take up to an hour — 12x the sidebar's 5-minute overdue grace. The overdue chip and the cron table therefore reported healthy in-flight jobs as 'overdue' / 'next run: X minutes ago'. runningAtMs is the recorded fact for an in-flight run (already public and used by the CLI's status), but no UI surface read it. Add the shared isCronJobRunning helper, exclude running jobs from the overdue filter, and render 'Running' in the next-run cell.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 14, 2026, 1:50 PM ET / 17:50 UTC. ClawSweeper reviewWhat this changesThe PR uses the public in-flight automation marker to suppress false overdue alerts and display Running instead of a past-due next-run time in the Control UI. Merge readinessThe state predicate is the right owner-boundary fix, but the new healthy Running label uses the red accent token that the UI explicitly reserves away from run state; correct that visual regression before merge. Priority: P2 Review scores
Verification
How this fits togetherThe cron scheduler publishes each automation’s execution state through Gateway cron responses and events. The Control UI consumes those snapshots for the sidebar health alert and the Automations table. flowchart LR
A[Cron scheduler] --> B[Public automation state]
B --> C[Gateway cron responses and events]
C --> D[Control UI status decision]
D --> E[Sidebar overdue alert]
D --> F[Automations table]
Decision needed
Why: The correction is mechanically clear, but the maintainer label requires an owner to handle the PR and approve its final head. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +22, Tests +33. Total +55 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use var(--run) for the new Running label, retain the shared running-state predicate, and refresh the Control UI proof on the corrected head before merge. Do we have a high-confidence way to reproduce the issue? Yes—current main exposes a finite runningAtMs alongside a past-due nextRunAtMs, while the sidebar and table ignore that marker; the source path is direct, though no test was run in this read-only review. Is this the best way to solve the issue? Mostly yes—the shared predicate consumes the scheduler’s recorded fact at both affected UI consumers, but the new visual state must use the established run token rather than the error-oriented accent token. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a8a986af1d6f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
ClawSweeper status: applying reviewed decision. I am applying the reviewed decision for this pull request: fix(ui): stop flagging running automations as overdue and show their state This is item 1/1 in the current shard. Shard 1/1. This transient lease prevents a newer review from overlapping label, comment, or close mutations. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged via squash.
|
…state (openclaw#123745) * fix(ui): stop flagging running automations as overdue and show their state The gateway intentionally leaves nextRunAtMs past-due while a run executes (it advances only on the outcome), and agentTurn runs may take up to an hour — 12x the sidebar's 5-minute overdue grace. The overdue chip and the cron table therefore reported healthy in-flight jobs as 'overdue' / 'next run: X minutes ago'. runningAtMs is the recorded fact for an in-flight run (already public and used by the CLI's status), but no UI surface read it. Add the shared isCronJobRunning helper, exclude running jobs from the overdue filter, and render 'Running' in the next-run cell. * test(cron): move running-state row test beside the capped view suite
What Problem This Solves
The sidebar "N automation(s) overdue" chip and the cron table falsely flag actively-running jobs. The gateway intentionally keeps
nextRunAtMspast-due while a run executes (only the outcome advances it — #16156/#13992), and anagentTurnjob may legitimately run up to 60 minutes — 12x the 5-minute overdue grace. So any automation running >5 minutes raised a warning chip and showed "next run: X minutes ago" while executing normally, training operators to ignore the chip.Why This Change Was Made
runningAtMsis the recorded fact for an in-flight run: it is public (toPublicCronJobkeeps it,ui/src/api/types.tsdeclares it) and the CLI already derives arunningdisplay status from it — but zero web UI code read it. Fix at the shared status owner (ui/src/lib/cron-status.ts): newisCronJobRunninghelper next toisCronJobActiveFailure, used to (a) exclude running jobs from the sidebar overdue filter and (b) render "Running" in the cron table's next-run cell instead of a misleading past-due timestamp.Accepted residual (noted in the helper comment):
queuedAtMsis stripped from the public shape, so brief queue waits still count toward overdue — those are seconds, not minutes, and stay under the grace window.User Impact
Operators no longer get warned about healthy in-flight automations; the cron page now shows a "Running" state, matching what the CLI reports.
Evidence
sidebar-attention.test.ts(14),view.test.ts(45), pluscron-page.test.ts— all green.pnpm tsgo:uiclean; oxfmt/oxlint clean.Production LOC delta: +18 incl. required invariant comments (8 helper, 1 filter condition, CSS + cell branch); tests +26.