Repository navigation
Conversation
…lock TeamReportsRunner seeded its 45-minute run deadline with Date.now() and reported the remaining response budget from the same wall clock, while WorkerTaskPool arms that budget from performance.now(). A forward wall-clock step collapsed the remaining budget to the 1 ms floor and cancelled a healthy worker response, so the report run failed with "worker task timed out". Stepping only Date.now() forward two hours during a report request makes main hand the pool 1 ms and reject; the monotonic deadline keeps 2,699,180 ms and the run resolves.
|
🦞👀 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 uses performance.now() for Team Reports worker response budgets and adds a clock-step regression to the existing lifecycle tests. Example: The Gateway wall clock advances two hours while a report worker awaits a model response.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current Team Reports timeout defect with a minimal repair and convincing Gateway evidence; no actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Team Reports scheduler submits generation to a worker through TeamReportsRunner, which handles host-side storage and model requests and supplies their remaining response budget. flowchart LR
A[Report generation request] --> B[Team Reports scheduler]
B --> C[TeamReportsRunner]
C --> D[WorkerTaskPool]
D --> E[Report worker]
E --> F[Host storage or model request]
F --> C
B --> G[Stored report outcome]
Technical reviewBest possible solution: Use the existing runner's monotonic clock for both response-budget calculations while retaining pool deadline enforcement and lifecycle coverage. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the clock mismatch, and supplied Gateway output demonstrates matching baseline failures and candidate successes; no target code was executed during this read-only review. Is this the best way to solve the issue? The two clock substitutions repair the duration producer directly, preserve the original worker architecture, and leave calendar scheduling and persisted timestamps with their existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7c87e3a892df. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests -1. Total -1 across 2 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 (1 earlier review cycle)
Reviewed October 28, 2026, 10:52 AM ET / 14:52 UTC (Revision 2). |
Built Gateway proof — real Team Reports generationCandidate Both revisions installed and built successfully in secretless GitHub acquisition uses an explicitly injected fetch fixture (empty repository list, healthy source status); the genuine summary-model HTTP request goes to a local streaming OpenAI-compatible provider. That provider arms a Gateway-only +2-hour Date.now offset before returning a valid summary. Performance.now and system/host clocks are unchanged; report-worker computation and SQLite transport remain real. No GitHub/Discord/provider credentials were used. Each run has fresh task-only profile, state, workspace and config; the built CLI confirms the config path before Gateway startup. Final differential, twice per row: All six successful runs returned stored report documents with Focused regression after consolidation into the existing lifecycle table: Completion and committed-SQLite cancellation/cleanup assertions remain. A native setImmediate promise replaces the hand-written MessageChannel turn-drain helper. The wall-step regression deliberately fakes only setTimeout/clearTimeout and spies Date.now; performance remains native to isolate the faulty wall-derived response duration. It does not pretend advancing fake timers also advances monotonic time. All mocks and real timers are restored after each case. Targeted Oxlint: 0 warnings/errors; Oxfmt applied. Simplification: production remains the contributor's minimal two clock substitutions (net0); tests net −1 against merge base (rather than +52). No public API, config, scheduling policy, storage, or 45-minute timeout change. #186534's scheduler retry is separate. Final proof Pueue11451 succeeded. Logs/wire frames/provider requests/config paths/stored reports: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 3e1e365. Thanks @SunnyShu0925. Team Reports workers no longer time out when the wall clock jumps. |
…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 #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: #186534 (comment). Thanks @SunnyShu0925. Co-authored-by: Ayaan Zaidi <[email protected]>
…lock (openclaw#186531) fix(team-reports): keep the report worker's reply budget on the monotonic clock The Team Reports runner measured the time left for a worker reply with Date.now, so a forward wall-clock step made a healthy report worker time out. The budget now uses performance.now, as the other extension budgets have since the openclaw#186484 sweep. Evidence: real built Gateway with the Team Reports plugin enabled, native report and SQLite workers, and a local HTTP summary provider. With Date.now stepped forward 2 hours inside the process only, main failed with "worker task timed out" (twice); with this change the reports succeeded (twice). No-step controls succeeded twice on each ref, and all successful runs stored valid summaries. Details: openclaw#186531 (comment). Thanks @SunnyShu0925. Co-authored-by: Ayaan Zaidi <[email protected]>
…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
A Team Reports generation can fail with
worker task timed outafter a forward wall-clock correction while a report worker awaits its host response. The runner computes a remaining elapsed budget from Date.now, while the existing worker pool measures it with performance.now. A +2-hour correction collapses the response budget to 1 ms despite a healthy model response.Fix
Thanks to @SunnyShu0925 for the original fix and report; the contributor commit is preserved. Both private runner deadline reads now use performance.now, matching WorkerTaskPool. The 45-minute ceiling, epoch reporting, scheduling, protocol, storage and configuration stay unchanged. No new helper or SDK export.
The new regression is consolidated into the existing completion/SQLite lifecycle table, preserving both cancellation/settlement cases. A native setImmediate promise replaces the manual MessageChannel turn-drain helper. Test mocks and timers are restored after each case. Whole-PR delta against merge base: production 0; tests −1 line.
Evidence
15b2d6594ed2292e139c7c65571f8fbb141c9009and candidate built in secretlessnode:24.22.1Docker.team-reports.generate,status, andgetoperations. Main +2-hour wall step fails with worker timeout twice; candidate succeeds twice. No-step controls succeed twice each. All six successful runs store valid model-source summaries. Deterministic local model HTTP provider and injected healthy GitHub response; no external credentials or system-clock changes.Merge Risk
Two clock substitutions at the duration producer; no persisted state or public contract changes. The separate deferred scheduler retry owner remains in #186534. Proof does not claim live external-provider reliability or a real host NTP adjustment.