Repository navigation
perf(ui): coalesce cron event refresh requests - #138065
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 4:18 AM ET / 08:18 UTC. ClawSweeper reviewWhat this changesThe Automations page combines overlapping event-driven status and run-history reads, retires queued refreshes when the page changes, and adds regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused performance fix: current main still issues redundant reads during cron event bursts. No blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Automations page receives scheduler events from the Gateway and requests current jobs, scheduler status, and run history. Its refresh owners decide which responses may update the displayed page. flowchart TD
A[Scheduler events] --> C[Automations refresh owner]
B[Manual refresh and actions] --> C
C --> D{Compatible read pending?}
D -->|Yes| E[Queue one trailing read]
D -->|No| F[Request Gateway data]
E --> F
F --> G[Update current page]
H[Page or connection changes] -->|Retire queued reads| C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +59, Tests +499. Total +558 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep refresh ownership in the existing cron loaders; distinct query identities and independent mutation completion justify the additional lifetime state. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold status and history responses while delivering repeated cron events to the Automations page; current main dispatches another pair per event. This review did not execute the reproduction. Is this the best way to solve the issue? Yes. Query-aware coalescing belongs at the read owners; transport-wide deduplication cannot distinguish event refreshes from explicit reads, and a page-wide debounce would delay unrelated progress. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 79e20aa5d1fd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…9-prep * commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits) perf(ui): coalesce automation event refreshes (#138065) fix: reject incomplete Skill Workshop directory reads (#138082) test(ui): decouple rendering checks from generated wording (#138283) perf: avoid temporary entries in bounded JSON traversal (#138017) fix(irc): render complete messages before splitting (#138328) perf: prepare worker trajectory payloads only for recorded events (#138086) fix(mcp): paginated listings no longer time out after a forward clock step (#137206) fix(codex): page native transcripts and bound UI previews (#136282) feat(gateway): apply more settings without restarting (#138112) fix(docs): preserve mirrored ClawHub maturity links (#138241) fix(test): own UI animation and legacy database setup (#138296) fix(tts): preserve literal directives in Markdown code (#138319) fix: load chat widgets behind authenticated gateways (#138074) chore(ui): cover native approval finalization (#137259) fix(cron): cancel conditions before main-session handoff (#138313) fix(backup): preserve text after embedded NUL characters (#138327) fix(android): align composer control sheets (#137442) fix(ci): wait for replacement PR runs instead of stale failures (#138307) fix(sessions): keep Gateway responsive with long transcripts (#138094) fix(computer): map window inputs to delivered image coordinates (#138271) ... # Conflicts: # scripts/release-check.ts # test/release-check.test.ts
What Problem This Solves
Fixes an issue where users viewing Automations would send another status and run-history request for every cron event while earlier reads were still pending. Busy automations could build up redundant Gateway work whose results were immediately discarded.
Why This Change Was Made
The existing cron request owners now combine compatible page refreshes into one pending read and one trailing reread. Successful responses remain visible during sustained events; changed filters, selected jobs, pagination, manual Refresh, and explicit mutation reads keep their existing supersession behavior. Page replacement retires refresh work without canceling an already accepted create-and-run action.
User Impact
Automations stays current during event bursts while issuing fewer redundant reads. Retired page responses cannot populate a replacement page. No configuration, protocol, or persistent-state changes are required.
Evidence
A real Chromium flow with a synthetic Gateway, on a baseline that includes the landed Sidebar refresh fix, held reads while delivering 20 cron events. The baseline grew from 1 to 21 run-history requests and from 2 to 22 total status requests. This change kept the pending counts at 1 and 2, then completed at 2 history and 4 total status requests after release; the completed synthetic run was visible. Status totals include the page and Sidebar owners. This measures request amplification, not deployed server latency.
303 focused owner and sibling tests pass, including sustained progress, first/last failure ordering, immediate manual Refresh, filter and pagination replacement, reconnect/unmount, retired results, and create-and-run completion through navigation. The production UI build and bundle budgets pass. The focused Chromium regression fails on the baseline and passes with the change.
The normal changed gate passed all 16 core test type graphs, UI types, global guards, and dead exports, then stopped on four lint findings. After a mechanical test split and redundant type-argument removal, fresh UI types, all 303 tests, type-aware lint, and styles pass. The production runtime is identical to the Chromium-tested candidate after type stripping. Independent P2 review found no actionable findings.
The exact tested baseline is 7297799. Main b456aa1 retains all four patch preimages and the relevant cron/page/deferred contracts; the three added files remain absent. This is source qualification of the same candidate, not a new runtime measurement. Production is +74/-15 (net +59) for active-read and trailing-refresh ownership; tests/support are +816/-317 including moved tests.
The following screenshots show the same held-read phase before and after the change. The visible state is intentionally unchanged; the recorded RPC counts above establish the reduction.
The captures are byte-identical, so both labels reuse the same uploaded image.
Before:
After: