Repository navigation
perf(workboard): paginate card and session board responses - #175349
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55ceefdbd8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (runtime.loadPromise !== loadPromise) { | ||
| return false; | ||
| } | ||
| normalized.cards.push(...page.cards); |
There was a problem hiding this comment.
Deduplicate pages while rebuilding the held window
When a refresh rebuilds a window larger than 100 cards, another client can move a card from the first page to a position after that page's cursor before the continuation request. The card then appears in both responses, and this branch appends it without the ID-based deduplication used by the more path below, producing duplicate cards and inflated counts in keyed UI lists. Deduplicate the accumulated refresh pages by card ID as well.
Useful? React with 👍 / 👎.
| const normalized = normalizeCardsPayload(payload); | ||
| setWorkboardCards(state, normalized.cards); | ||
| state.statuses = normalized.statuses; | ||
| state.nextCursor = normalized.nextCursor; |
There was a problem hiding this comment.
Preserve the loaded card window after dispatch
When a user has loaded more than the first 100 cards and runs Dispatch, the post-dispatch list request returns only the first page; the code replaces state.cards with that page and merely retains its cursor. All previously loaded later cards therefore disappear after every dispatch until the user loads them again, unlike the normal refresh path that restores the held window. Follow continuation pages up to the previously loaded window, or route this reconciliation through the existing refresh loader.
Useful? React with 👍 / 👎.
Keep the existing canonical session-key boundary around the projected inventory query, and cover pending offline repairs through usage discovery. Verify archive overview reads remain transcript-free after refresh descendants settle.
|
Two P2 follow-ups from the automated review remain under this campaign's two-round review limit:
Neither changes persisted card data. These visible paging limitations are disclosed rather than adding a consistency generation or cross-request handshake. |
|
Codex review: needs changes before merge. What this changesThis PR paginates card and Sessions board responses in batches of 100 and adds loading controls to bundled consumers. Example: Open a Workboard containing 205 cards.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: bounded Workboard responses address a real performance problem, but two paging regressions remain in this PR. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Workboard plugin serves persisted cards and caller-authorized Sessions projections through Gateway RPCs to board pages, dashboard widgets, session accessories, and the CLI. flowchart TD
A[Board pages and widgets] --> C[Workboard Gateway RPCs]
B[CLI and session accessories] --> C
C --> D[Card store and worker]
C --> E[Authorized Sessions projection]
D --> F[Bounded response pages]
E --> F
F --> G[Consumer loaded windows]
Technical reviewBest possible solution: Keep the plugin-owned pagination design and use one deduplicating loaded-window reconciliation path for refresh and dispatch. Do we have a high-confidence way to reproduce the issue? Source establishes both the unbounded current-main response path and the introduced refresh/dispatch failures; no target code or tests were executed during this read-only review. Is this the best way to solve the issue? Bounding selection and transport at the existing plugin owners is appropriate, while duplicated reconciliation logic leaves two consumer regressions. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da64d6bdc3e6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +353, Tests +231, Docs +35. Total +619 across 31 files. Added test files: 1. View PR surface stats
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 Reviewed October 17, 2026, 5:06 AM ET / 09:06 UTC. |
Bound default card and Sessions board responses to 100 items with a nextCursor. Add loaded-count notices and Load more to pages and dashboard widgets, label unloaded dependencies, and migrate CLI listing and session accessories to follow pages. Explicit export/tool full-list behavior remains available. Use the existing worker and write-receipt owners. Select cards with a dialect-neutral SQL keyset over position, creation time, and id; hydrate at most 101 records including lookahead. Slice the existing authorized Sessions projection. Its construction remains population-wide. No schema, SDK, update, Doctor, migration, plugin-loading or service-lifecycle change; area T1/T1-compat stay zero. At synthetic 10x scale (20,000 sessions, 2,000 cards), card response output falls from 2,000 items/829,237 bytes to 100/42,639; native output falls from 4,003 rows/575,937 bytes to 205/29,924, with SQL/requests unchanged at 15/3. Sessions response output falls from 20,000 items/11,249,703 bytes to 100/57,435, with unchanged 2/2 SQL/requests. Continuation returns 100 disjoint items; Sessions continuation needs no SQL/request. No controlled latency claim. All three frozen alternating shared-v3 pairs passed. Pooled warm raw median stays 68 SQL/18 requests/0 MAIN; causal warm stays 62/17/0. The alternative median of run medians is 68 to 68.5 raw SQL, entirely background; authored operations contribute no warm calls. The standard workload does not invoke Workboard. Later widget-only layout changes have exact-head desktop/mobile E2E proof; SQL owners remain unchanged from measured candidate. Final CI39026534833 passed selected Node/UI tests, all nine UI E2E shards, types, lint, source contracts, Madge, worker/T1/dialect ratchets, and PostgreSQL integrations. PostgreSQL infra timed out in the Git backup test and the following case hit owner contention. Both cases pass on integrated baseline42e84662 and candidate64581499 under isolated PG17.11/Node24.22.0; scheduled main passed the first case only194ms below its120s timeout. This remains an investigated, unreproduced CI failure, not a claimed fix or inherited-main failure. Land under the authorized relaxed policy. Final Knip production/full-export outputs match integrated baseline byte-for-byte (12/eight inherited diagnostics). Two Codex review rounds completed; inspected synthetic before/after proof is embedded in the PR. Remove the unbounded default response. Concurrent movement can repeat or skip a live page item until Refresh; Load more deduplicates. A removed Sessions cursor gives an explicit refresh instruction. Disclosed follow-ups: multi-page refresh can repeat a moved card, and dispatch resets the visible window to page one until Load more. Neither changes persisted data. Refs openclaw#175349.
Backport request: could this land in the 2026.10 line (for example 2026.10.10)? Or is it planned only for the first 2026.11 release? Either answer helps us plan. Why it matters to us. This PR fixes the Control UI freeze we measured on 2026.10.7. The full numbers are in #186096 (comment). In short:
Current status. Merged to Note for a backport. On Meanwhile we run a downstream workaround: hourly deletion of |
What Problem This Solves
Large Workboards send the entire card or Sessions board population in each default response, making the interface expensive to load and refresh.
User Impact
Cards and Sessions boards load up to 100 items per response with a visible loaded-count notice and Load more. Board pages and dashboard widgets disclose incomplete counts and filters. Unloaded dependencies/cards are labeled as not loaded. Reordering waits until all cards are loaded; ordinary status moves remain available. CLI listing and session accessories follow pages to preserve their complete-list behavior.
This changes the default RPC list contract to a bounded page with an optional nextCursor. Bundled consumers are migrated together. Clients that need all records must follow the cursor. Explicit internal export/tool listing retains its existing full-list contract.
Why This Change Was Made
Card selection uses a dialect-neutral SQL keyset over position, creation time, and id, hydrating at most 101 records including the lookahead. Existing receipt invalidation owns the first-page cache. Sessions board responses slice the existing authorized projection, so wire size is bounded while projection ownership and authorization remain unchanged.
The old unbounded default response is removed. Live pagination accepts duplicates or skipped items after concurrent movement until Refresh; clients deduplicate loaded rows. A removed Sessions cursor reports an explicit refresh instruction. No fencing, generation handshake, schema change, or second database owner is added.
Evidence
Synthetic 1×/10× comparisons completed without native execution errors. Default responses now contain a bounded first page; clients follow the cursor for the full population. The original source CI and static attribution are complete. A screenshot subsequently exposed a widget pagination layout regression; the narrow repair is pushed as
5b9b2216, with inspected red/green captures and successful Load more. Its CI exposed a test-only cursor property-order mismatch in the mock; the fixture was corrected in00bfa9f5aa2. Main is integrated at64581499369. Final CI completed with 48 successful jobs, 23 scope-skipped jobs, and a PostgreSQL infra failure (plus the dependent CI gate); its disposition is recorded below. The three-pair shared-harness series is complete; the detailed results are below.1× contains 2,000 sessions and 200 cards; 10× contains 20,000 sessions and 2,000 cards, including two/twenty 60,000-event sessions. Base
ab37bc6c, measured combined candidate13d2c71c. All listed RPCs execute 0 MAIN statements. At 10× the card query returns 205 native rows / 29,924 value bytes, down from 4,003 / 575,937. Native rows/bytes measure returned data, not scanned rows or physical I/O. The historical 11.25 MB response belongs to the Sessions board.Candidate continuation pages return 100 disjoint items: cards use 15 SQL / 3 requests; Sessions use 0 / 0. Repeated first pages and unchanged-revision responses use 0 / 0 on both arms. At 1×/10×, card continuation response sizes are 42,750/42,857 bytes and Sessions continuation sizes are 58,235/57,655 bytes.
Observed instrumented wall times (base→candidate ms): cards 22.9→18.8 at 1× and 77.2→22.7 at 10×; Sessions 85.8→80.6 and 545.2→494.2. These are busy-host observations, not controlled latency claims.
Regressions cover bounded/disjoint pages, refreshed data after writes, shared read-only widgets, CLI pagination, and loading more Sessions. Pre-integration CI 39018982066 passed on
13d2c71c7b1d6d5e57ab543dfc2472ac9bd970a3, including both PostgreSQL shards, selected Node/UI tests, production/test types, lint, contracts, Madge and ratchets. The four Workboard browser files passed 62 cases. No update/Doctor/migration/plugin-loading/service-lifecycle or SDK API changes.Both allowed independent Codex review rounds completed with no actionable P0–P2 finding established in their supplied scope. Later automated P2 findings are disclosed below under the campaign's review limit. Formatting, basic changed-file lint, and whitespace checks pass.
Canonical Knip 6.40.0 production and full-export scans were run on final stacked head
645814993691and integrated baseline42e846629a3d. Both outputs match byte-for-byte: 12 production diagnostics (two files, one dependency, nine exports) and eight full-export diagnostics. None is in an authored owner. This is an exact-baseline inherited exception, not a clean Knip run. These final scans supersede the earlier frozen-head 22/12 diagnostic counts.Final integrated CI 39026534833 passed selected Node/UI tests, all nine UI E2E shards, production/test types, lint, source contracts, Madge, worker/T1/dialect ratchets, and PostgreSQL integrations. PostgreSQL infra failed two cases in
src/infra/database-engine/git-backup.postgres.test.ts: a 120-second timeout followed by owner contention. Scheduled main run 39025102777 passed the first case in 119,806 ms, just 194 ms below that budget.The exact failing file then passed 2/2 cases on both integrated baseline
42e846629a3dand candidate645814993691with isolated PostgreSQL 17.11, Node 24.22.0, and the repository conformance wrapper. The first/second case times were 47,739/9,132 ms on baseline and 31,401/7,906 ms on candidate. Those are busy-host diagnostic observations, not a latency claim. The original CI failure remains unreproduced, not fixed or proven inherited; a timeout cascade is plausible but unproven. No timeout was raised, assertion weakened, or CI rerun requested. Landing uses the authorized relaxed policy for an investigated failure without a demonstrated product regression, and the PostgreSQL backup follow-up is recorded.The Sessions-board wire response is bounded, but constructing its authorized projection still visits the population. This PR does not claim page-proportional projection cost for Sessions boards.
LOC against the usage commit: production +412/−54 (net +358), tests +264/−2 (net +262), docs +51/−16 (net +35). New UI code provides paging controls and explicit incomplete-data states.
Review follow-ups
Two P2 follow-ups from the automated review remain under this campaign's two-round review limit:
nextCursor, so later loaded cards and their selection leave the visible window. Load more restores the cards. Follow-up: route post-dispatch reconciliation through the existing held-window refresh loader.Neither changes persisted card data. These visible paging limitations are disclosed rather than adding a consistency generation or cross-request handshake.
Visual proof
Synthetic 105-item boards, before and after. Cards and Sessions now show 100 loaded and an explicit Load more control. The widget keeps its cards visible below a compact pagination notice; Load more reaches all 105 cards and removes the control. Full frames were inspected for synthetic-only content. Historical fixture timestamps are cosmetic.
The pagination notice initially inherited a full-height empty-state style and hid the cards. The repair adds a pagination-specific sizing class, retaining existing loading/error-state sizing. The corrected screenshot mock separately fixes an invalid repeated cursor in the session accessory; that was a fixture issue. Plugin-only build, 23 widget runtime cases, changed-file lint/format and whitespace checks pass. The existing desktop/mobile layout E2E now exercises paging and checks the first card remains inside the widget; it passed on integrated head
64581499in CI job117378995958.Relative to the frozen measured candidate, the later production repair changes only the widget renderer and its CSS; SQL-owner files remain unchanged. Main integration preserved all authored production files byte-for-byte; its only conflict was in the Usage parent’s moved I/O-test helper. Frozen base/candidate measurements remain differential evidence rather than exact integrated-head workload measurements. All three alternating pairs are complete; causal warm results remain unchanged, as detailed below. All six embedded image sources were verified in GitHub’s server-rendered HTML, retrieved successfully, and matched the inspected synthetic captures exactly.
Completed three-pair turn measurement
The shared-v3 sequence M1,C1,M2,C2,M3,C3 completed on frozen base
ab37bc6cand candidate13d2c71c; all six workloads passed with zero native SQL errors. These remain differential measurements for the original authored change, not exact integrated-head workload measurements.The alternative median of three raw run medians is 68→68.5 SQL, 18→18 requests, 0→0 MAIN; causal run medians remain exactly 62/17/0. Touched-source warm SQL and requests are zero in every arm. Across the full workload, touched-source SQL is [28,28,25]→[20,20,22], with five requests in every arm. The raw background variation is disclosed; no warm-path or whole-workload request-saving claim is made. The standard workload does not exercise Workboard; its direct RPC evidence is above. Shared warm row-facts stay 1 SQL/1 request, and the other four tracked read families stay zero.