Skip to content

fix(ui): stop flagging running automations as overdue and show their state - #123745

Merged
steipete merged 3 commits into
mainfrom
codex/autoqa-cron-running-overdue
Aug 14, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/autoqa-cron-running-overdue

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The sidebar "N automation(s) overdue" chip and the cron table falsely flag actively-running jobs. The gateway intentionally keeps nextRunAtMs past-due while a run executes (only the outcome advances it — #16156/#13992), and an agentTurn job 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

runningAtMs is the recorded fact for an in-flight run: it is public (toPublicCronJob keeps it, ui/src/api/types.ts declares it) and the CLI already derives a running display status from it — but zero web UI code read it. Fix at the shared status owner (ui/src/lib/cron-status.ts): new isCronJobRunning helper next to isCronJobActiveFailure, 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): queuedAtMs is 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

  • 2 new regression tests fail pre-fix (running job flagged overdue; past-due time shown while running), pass post-fix: sidebar-attention.test.ts (14), view.test.ts (45), plus cron-page.test.ts — all green.
  • pnpm tsgo:ui clean; oxfmt/oxlint clean.
  • Autoreview (Codex, commit mode): clean, overall 0.99.

Production LOC delta: +18 incl. required invariant comments (8 helper, 1 filter condition, CSS + cell branch); tests +26.

…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.
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 14, 2026 16:34
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 14, 2026, 1:50 PM ET / 17:50 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Needs maintainer review before merge - 4 items remain

The 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
Reviewed head: e01c02a89f2374a00b4dc65785b6157cb5de08f3
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The state handling is well targeted, but one visible color-token defect remains before the patch is merge-ready.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The latest completed ClawSweeper cycle cleared the earlier proof blocker; this review could not re-open its filtered artifact after the local promisor remote became unreachable.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The latest completed ClawSweeper cycle cleared the earlier proof blocker; this review could not re-open its filtered artifact after the local promisor remote became unreachable.
Evidence reviewed 6 items Current scheduler contract: A scheduler regression test establishes that an actively running job intentionally retains its past-due next-run timestamp, so consumers must use the execution marker rather than infer overdue state from that timestamp.
Public state reaches the UI: The public projection strips queued-only scheduling state but retains runningAtMs, and Gateway returns that projection to cron clients.
Current UI failure path: Current main’s sidebar determines overdue state solely from nextRunAtMs, while the table renders that timestamp directly; both omit the public running marker.
Findings 1 actionable finding [P2] Use the run-state color token
Security None None.

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Should this protected maintainer PR use the existing --run token for its new Running label before it lands? Use the run-state token: Replace the new red accent color with var(--run), then recheck the corrected Control UI state.

Why: The correction is mechanically clear, but the maintainer label requires an owner to handle the PR and approve its final head.

Before merge

  • Use the run-state color token (P2) - The new Running label uses var(--accent), but base.css documents that token as red across shipped themes and introduces --run specifically so active runs do not read as failures. Use var(--run) here; otherwise a healthy in-flight automation remains visually error-like.
  • Resolve merge risk (P1) - Merging the current CSS makes a healthy Running state red, visually conflating active work with the error-oriented accent color.
  • Resolve merge risk (P1) - The local partial clone could not retrieve older PR/base objects because its promisor remote was unreachable, so exact three-way diff and deeper historical provenance could not be independently re-read.

Findings

  • [P2] Use the run-state color token — ui/src/styles/cron.css:362
Agent review details

Security

None.

PR surface

Source +22, Tests +33. Total +55 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 25 3 +22
Tests 2 33 0 +33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 58 3 +55

Review metrics

Metric Value Why it matters
Production versus test LOC production +25/-3 (net +22), tests +33/-0 (net +33) The positive production delta is concentrated in one shared predicate and its two UI consumers; avoid adding any parallel status path while correcting the color token.

Merge-risk options

Maintainer options:

  1. Use the established run-state color (recommended)
    Change the new Running label from var(--accent) to var(--run), preserving the theme’s active-versus-failed visual distinction.

Technical review

Best 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:

  • [P2] Use the run-state color token — ui/src/styles/cron.css:362
    The new Running label uses var(--accent), but base.css documents that token as red across shipped themes and introduces --run specifically so active runs do not read as failures. Use var(--run) here; otherwise a healthy in-flight automation remains visually error-like.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a8a986af1d6f.

Labels

Label justifications:

  • P2: This is a bounded Control UI correctness issue that can make healthy automations appear unhealthy.
  • merge-risk: 🚨 other: The new status label uses an existing failure-oriented color token, risking misleading operator interpretation after merge.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The latest completed ClawSweeper cycle cleared the earlier proof blocker; this review could not re-open its filtered artifact after the local promisor remote became unreachable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The latest completed ClawSweeper cycle cleared the earlier proof blocker; this review could not re-open its filtered artifact after the local promisor remote became unreachable.

Evidence

What I checked:

  • Current scheduler contract: A scheduler regression test establishes that an actively running job intentionally retains its past-due next-run timestamp, so consumers must use the execution marker rather than infer overdue state from that timestamp. (src/cron/service.overdue-scheduling.test.ts:82, a8a986af1d6f)
  • Public state reaches the UI: The public projection strips queued-only scheduling state but retains runningAtMs, and Gateway returns that projection to cron clients. (src/cron/public-job.ts:11, a8a986af1d6f)
  • Current UI failure path: Current main’s sidebar determines overdue state solely from nextRunAtMs, while the table renders that timestamp directly; both omit the public running marker. (ui/src/components/sidebar-attention-items.ts:89, a8a986af1d6f)
  • Existing CLI behavior agrees: The CLI already derives running from the same execution marker before evaluating the last run status, supporting the PR’s state interpretation. (src/cli/cron-cli/shared.ts:165, a8a986af1d6f)
  • Run-state visual contract: The shared theme defines --run specifically because --accent is red in shipped themes and would make an active run read as failed; the PR’s added CSS instead uses --accent. (ui/src/styles/base.css:152, a8a986af1d6f)
  • Recent area provenance: Current-main commit 5972b36 includes the sidebar, cron status, and cron view surfaces, making steipete a recent area contributor. Deeper blame/history retrieval was blocked when this partial clone could not reach its promisor remote. (ui/src/components/sidebar-attention-items.ts:89, 5972b36b141d)

Likely related people:

  • steipete: Commit 5972b36 on current main touched the sidebar attention, shared cron-status, and cron-view surfaces involved here. (role: recent area contributor; confidence: medium; commits: 5972b36b141d; files: ui/src/components/sidebar-attention-items.ts, ui/src/lib/cron-status.ts, ui/src/pages/cron/view.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Use var(--run) for the Running label and refresh the corresponding Control UI proof on the corrected head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-14T16:39:36.249Z sha f8ab9fd :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-14T17:10:30.797Z sha 42114fa :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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.

@steipete
steipete merged commit f9d9b9d into main Aug 14, 2026
164 checks passed
@steipete
steipete deleted the codex/autoqa-cron-running-overdue branch August 14, 2026 18:07
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant