Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR schedules deferred Team Reports retries as relative delays so backward wall-clock corrections cannot postpone them. Example: A scheduled report defers behind manual collection, then the wall clock moves backward one hour.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current-main scheduling defect with a focused change; no actionable correctness or security findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTeam Reports converts calendar slots and deferred collection requests into host-owned scheduled jobs, then records report outcomes through its existing workers and store. flowchart TD
A[Calendar slot] --> B[Team Reports scheduler]
C[Active manual report] --> B
B --> D[Relative deferred retry]
D --> E[Host service scheduler]
E --> F[Report worker]
F --> G[Report store]
Technical reviewBest possible solution: Use the existing host scheduler’s delayMs contract for deferred retries while retaining absolute calendar scheduling and service-owned cancellation. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the absolute-deadline failure path, and the supplied built-Gateway differential confirms it; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete fix: correct the retry producer’s timing shape and reuse the existing clock and lifecycle owners without new machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd0403b40c98. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests 0. Total +4 across 2 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 28, 2026, 11:59 AM ET / 15:59 UTC (Revision 6). |
93da87c to
8909848
Compare
|
🦞👀 Re-review progress:
|
8909848 to
ad3c99b
Compare
|
🦞👀 Re-review progress:
|
A scheduled tick that arrives while another run is collecting defers its retry
to `Date.now() + 60_000`, which the host scheduler treats as an absolute
wall-clock instant with no elapsed anchor, so a backward wall-clock correction
postpones the retry by the size of the correction. Pass `{ delayMs }` instead:
the scheduler that owns the calculation anchors relative jobs on the elapsed
clock. Calendar slots (closed day, intraday, startup grace) stay on `atMs`.
ad3c99b to
4fadb65
Compare
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Built Gateway scheduler differentialCandidate Both revisions built in secretless The harness leaves the real five-minute startup grace and real calendar timer intact. Through public Elapsed times from the independent driver performance clock: The candidate dispatches the retry ~60 seconds after the tick despite the wall correction; main leaves it parked. Both ordinary-clock controls dispatch at the normal ~60-second interval and persist successful scheduled reports. GitHub responses are fixtures, summaries are disabled, and there are no external credentials. This proves scheduling/worker/store behavior, not live external-source reliability. Regression consolidated into the pre-existing concurrent-manual/deferred-intraday lifecycle case. Its existing no-overlap, manual outcome, scheduled report and next-calendar-slot assertions remain; the only behavioral addition is a backward wall correction after the manual run completes. The existing test service scheduler uses separate Date.now/performance.now clocks; Vitest fakes both by default, and setSystemTime changes wall time without advancing performance. This removes the added standalone test, duplicate blocked-collection scaffolding, clock fixture imports and now-unused scheduler injection option. The small production growth is the existing schedule helper accepting/forwarding either absolute or relative time, a named retry duration, and a clock-domain comment. Calendar slots and startup grace remain absolute; retries reuse the host scheduler's existing relative/elapsed deadline owner. No new clock helper, scheduler policy, schema, public API or configuration. Forward-correction behavior remains the host scheduler's existing minimum-of-wall-and-elapsed contract; this repair specifically prevents backward correction from postponing retries. Retained evidence |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in c3aa6e1. Thanks @SunnyShu0925. Deferred Team Reports retries now run on time after a wall-clock change. |
…penclaw#186534) fix(team-reports): keep the scheduler's deferred retry on the monotonic clock When a scheduled Team Report was deferred behind a manual collection, the scheduler timed the retry with Date.now. If the wall clock moved back, the retry stayed parked far past its 60 s delay. The retry now uses performance.now, as the runner's reply budget does since openclaw#186531. Evidence: real built Gateway with the Team Reports plugin, the host scheduler and native report and SQLite workers. After a real calendar tick was deferred behind a manual collection, Date.now was rewound one hour inside the process only. Main's retry stayed parked beyond 75 s; with this change it dispatched after 59.95 s and stored a successful scheduled report. No-step controls dispatched at about 60 s and succeeded on both refs. Details: openclaw#186534 (comment). Thanks @SunnyShu0925. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
When a scheduled Team Reports tick defers behind an active run, its 60-second retry is a duration. Main submits it as
atMs: Date.now() + 60_000, so a backward wall-clock correction can postpone it by the size of that correction. Calendar slots correctly remain wall-clock instants; only the deferred retry has the wrong shape.Fix
Thanks to @SunnyShu0925 for the original report, fix and proof. Contributor commits are retained. The existing plugin schedule helper forwards
{ atMs } | { delayMs }; deferred retries pass the 60-second delay and inherit the real host scheduler's elapsed anchor. Closed-day/intraday calendar slots and startup grace remain absolute. No new clock helper, policy, schema, configuration or public API.Forward-step behavior is still the host scheduler's existing minimum-of-wall-and-elapsed policy. This fix prevents backward corrections from postponing the retry; it does not promise a new forward-step policy.
Evidence
Both unpatched main
3e1e3652ff2599345668754cec60f0a4fdd8fd15and candidate built in secretlessnode:24.22.1Docker. Real built Gateways loaded the actual plugin, native report and SQLite workers, and host service scheduler. The harness retained real startup grace and calendar timers, started manual generation through the public RPC, held fixture GitHub acquisition across the calendar slot, then released it and stepped only process-local Date.now backward one hour.The regression now extends the existing concurrency/deferred-tick case with one wall correction instead of adding a duplicate scenario. Existing lifecycle and next-calendar-slot assertions remain. Removed standalone clock scaffolding and unused scheduler fixture injection. Whole-PR delta against merge base: tests 0; production +4 lines, necessary to forward the existing two scheduler shapes and document the retry clock domain.
Full runtime proof. Acquisition is a deterministic injected healthy GitHub response; summaries are disabled. No external credentials or host/system clock changes. Proof covers real scheduling, native workers and persisted outcomes, not live GitHub reliability.
Merge Risk
Small change at the deferred-duration producer. Existing scheduler owner and service cancellation remain authoritative. No state migration; #186531's worker response-budget owner is separate.