Repository navigation
perf(control-ui): bound cached transcript snapshots - #174593
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. |
f90c2d3 to
721591c
Compare
721591c to
8077cb8
Compare
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. |
8077cb8 to
c28ef19
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c28ef1914f
ℹ️ 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".
| pagination: { | ||
| hasMore: true, | ||
| nextOffset: 0, |
There was a problem hiding this comment.
Replace stale cached rows during the zero-offset refill
When a warm snapshot is truncated, the first upward scroll deliberately fetches offset 0, overlapping all 80 cached rows. prependUniqueNativeMessages only removes rows whose full projection identity is byte-equivalent, so a legitimate Gateway reprojection—such as createCurrentUserProfileMessageProjector refreshing senderProfileAvatarUrl after an avatar change—keeps both the fresh row and its stale cached counterpart, displaying the same transcript message twice. The refill path should treat the returned Gateway source groups as authoritative over overlapping cached groups while still preserving projected siblings.
AGENTS.md reference: ui/AGENTS.md:L19-L21
Useful? React with 👍 / 👎.
c28ef19 to
28b260e
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR caches an 80-row transcript tail and refills older history through the existing Gateway pagination and projection owners. Example: Reload a conversation containing 1,100 messages.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides a useful, owner-approved performance improvement with no actionable correctness findings; keep it open for the requested manual landing. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI snapshot store persists account-scoped display projections in IndexedDB; reload hydration consumes those projections, and authenticated Gateway history supplies authoritative reconciliation and older pages. flowchart LR
A[Gateway history] --> B[Session projection owner]
B --> C[Transcript view]
B --> D[Bounded snapshot writer]
D --> E[IndexedDB]
E --> F[Reload hydration]
F --> B
C --> A
Technical reviewBest possible solution: Land the bounded disposable projection and authoritative refill through the existing owners using the repository’s native landing gates. Do we have a high-confidence way to reproduce the issue? Current-main source serializes the retained transcript without this row bound, and the supplied paired production-browser measurements demonstrate the large-snapshot cost; no target code was executed during this review. Is this the best way to solve the issue? The change addresses persistence volume at its existing owner and reuses authoritative history reconciliation, avoiding a second cache or pagination policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 85082d969005. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +69, Tests +281, Docs +11, Other +21. Total +382 across 18 files. Added test files: 1. 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 (3 earlier review cycles)
Reviewed October 17, 2026, 12:16 AM ET / 04:16 UTC (Revision 4). |
28b260e to
f706206
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f706206484
ℹ️ 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".
| const retained = replaceOverlapping | ||
| ? current.filter( | ||
| (message) => !incomingSources.has(nativeHistoryMessageSourceIdentity(message) ?? ""), | ||
| ) |
There was a problem hiding this comment.
Drop cached rows outside the authoritative refill
When the zero-offset chat.history response is byte-limited to fewer rows than the 80-row snapshot, cached rows absent from incomingSources are older rows beyond the returned window, but this filter retains and appends them after the fresh page. For example, a refill containing rows 51–100 followed by cached rows 21–50 remains misordered even after the next page supplies rows 1–50, because normal deduplication removes the incoming copies of 21–50 without relocating the retained copies. Replace the cached window wholesale while preserving only rows proven newer than the refill, rather than every nonoverlapping cached source.
AGENTS.md reference: ui/AGENTS.md:L19-L21
Useful? React with 👍 / 👎.
6acdff2 to
8ad5a0c
Compare
Keep a resumable 80-row tail in the disposable browser cache instead of serializing every loaded history page. Preserve sequence groups, identities, conversation metadata, and the live delta cursor; older history remains available through the Gateway pagination owner. Retire the old transcript projection without reading it, retain the current sidebar cache, and remove the obsolete read-time pairing repair. Add a large warm-reload fixture and snapshot write measurements.
848fa5e to
890a1a7
Compare
|
@clawsweeper re-review Coordinator-requested verification is complete on The original skill-menu file ran three times on each revision: main PASS/FAIL/FAIL, head FAIL/FAIL/PASS. All four failures have the identical focus assertion and recorded stack location, so it is an inherited flake. The guest-slider file passed all three runs on both revisions (2/2 cases each); main commit 86a8249 supplies the missing wait for model selection to settle before opening the next control. No lane code or assertion changes were needed. Exact-head CI run 39002185119 is green (39 successful jobs, 23 skipped, zero failed), including the aggregate gate. The PR body records the comparison, all run times, and the distinction between current verification and previously accepted performance/full-suite evidence. AWS lease cbx_147d070608d7 is released with cleanup complete. Review only. The coordinator explicitly requires stopping before merge. |
|
🦞👀 Re-review progress:
|
…5171) #174593 bounded cached chat snapshots and marked trimmed windows with an offset-0 refill for the first upward scroll. The pane's viewport-fill autoload also treats that marker as older history, so every warm reload of a session whose cached tail fits the viewport (tool-heavy agent sessions collapse 80 raw messages into one visible row) paged through the whole history at boot. On Team r149 one 820-message session downloaded 1.05 MB + 1.05 MB + 498 KB in three sequential chat.history requests and grew the transcript in five visible steps; chat.history is already ~50% of Gateway response bytes. The offset-0 refill is now reserved for reader intent: automatic viewport fill no longer consumes it, while ordinary older pages and backscroll through all messages are unchanged. Eleven interleaved AWS c7a.4xlarge pairs, warm reload of a trimmed cache: boot chat.history 1 -> 0; LoAF blocking 880 -> 350 ms (-60%, every pair, non-overlapping IQR); message-delivery work 781 -> 225 ms; delivery forced layout 184 -> 2 ms. Runtime +2 LOC. New autofill regression test and warm-boot e2e assert no boot chat.history on a warm trimmed cache and a single offset-0 refill on reader intent. 73 unit + 20 native e2e tests pass; all 55 exact-head CI jobs green.
…penclaw#174593) Cached chat snapshots held whole transcripts: on Team the board reload restored 20 records totalling 11.2 MB (largest 3.19 MB, 1,096 messages), and that restore was the longest single task of the reload (IDB oncomplete 337-556 ms). Persisted snapshots now keep the newest 80 display rows (whole sequence groups) without provider replay payloads, and mark the window for an authoritative refill from offset 0 on the first upward scroll, so full backscroll still works. Snapshot DB version 8 clears the old unbounded records during upgrade without reading them onto the main thread; the read-time QR repair for pre-v8 writers is removed with them, and writes still strip pairing QR content. Display identity ignores provider replay data so cached and live rows still dedupe. Seven interleaved AWS c7a.4xlarge pairs: snapshot 2,951,644 -> 190,988 bytes; synchronous save 10.2 -> 0.7 ms; save flush 25.7 -> 2.4 ms; first cached row 686.5 -> 641.5 ms; restore/projection task 340 -> 295 ms (all non-overlapping IQR). Released-cache upgrade test: old record retired, preferences preserved, 80-row cache repopulated, all 1,100 rows reachable through native backscroll. Runtime +69 LOC. Exact-head CI green (39 passed, 0 failed); a skill-menu focus failure is an inherited flake (fails 2/3 on baseline main too).
…nclaw#175171) openclaw#174593 bounded cached chat snapshots and marked trimmed windows with an offset-0 refill for the first upward scroll. The pane's viewport-fill autoload also treats that marker as older history, so every warm reload of a session whose cached tail fits the viewport (tool-heavy agent sessions collapse 80 raw messages into one visible row) paged through the whole history at boot. On Team r149 one 820-message session downloaded 1.05 MB + 1.05 MB + 498 KB in three sequential chat.history requests and grew the transcript in five visible steps; chat.history is already ~50% of Gateway response bytes. The offset-0 refill is now reserved for reader intent: automatic viewport fill no longer consumes it, while ordinary older pages and backscroll through all messages are unchanged. Eleven interleaved AWS c7a.4xlarge pairs, warm reload of a trimmed cache: boot chat.history 1 -> 0; LoAF blocking 880 -> 350 ms (-60%, every pair, non-overlapping IQR); message-delivery work 781 -> 225 ms; delivery forced layout 184 -> 2 ms. Runtime +2 LOC. New autofill regression test and warm-boot e2e assert no boot chat.history on a warm trimmed cache and a single offset-0 refill on reader intent. 73 unit + 20 native e2e tests pass; all 55 exact-head CI jobs green.
Problem and behavior
A signed-in reload of a dashboard deep link originally crossed 14 visual states over roughly 15 seconds. Later cache evidence found a roughly 3.2 MB record containing 1,096 messages and a 337–556 ms restore task: the browser persisted the entire loaded transcript and serialized it again on every save.
This change persists the latest 80 transcript rows, extending the boundary to keep complete native sequence groups. Warm reload retains the title and first-screen rows; older history still loads on upward scroll. Live in-memory history remains complete.
The existing snapshot owner drops only top-level provider replay payloads, retaining identities, idempotency keys, tool IDs, activity, usage, rendering metadata, widget sizes, title, and the delta cursor. A truncated snapshot starts its authoritative refill at offset zero; the existing history/projection owners reconcile that window and use Gateway-returned offsets for subsequent pages, including imported histories. IndexedDB v8 retires old unbounded transcripts without deserializing them, preserves valid current sidebar records, and admits projection v3. The superseded read-time pairing-QR repair is removed; writer sanitization remains. No second store, Gateway schema, protocol, or product configuration change.
Current head and coordinator-requested classification
Head:
890a1a73a4e9e2afbf23ca541221ce05f2044be0.Pinned main baseline:
d6a0b103aadb070692d880d28f0dc1fe0079bed2.The rebase completed without conflicts. All 12 reviewed patches are unchanged in range-diff; main contains b652f39, 99f34f7, and 9285ef2. No new implementation fix was needed.
Each original failing file ran three times on each revision using the native runner on one AWS Crabbox
c7a.4xlarge, leasecbx_147d070608d7, run receipt. Runs were serial and baseline/head order alternated by round. The two test files have identical source hashes between these revisions; no instrumentation or changes to assertions, timeouts, focus, or scheduling were introduced.chat-skill-library.e2e.test.ts:195:104.guest-session-controls.e2e.test.tsThe guest test previously waited only for receipt of
sessions.patchbefore opening the thinking control; the model selection is asynchronous, so receipt did not establish settled UI state. Main 86a8249c7213 added waits for the model control to display the selected value and become enabled before continuing. Both compared revisions include this fix. The original skill-menu failure is now reproduced directly on main, resolving the earlier attribution gap without changing the cache patch or weakening the test.Wall times for the native single-file runs (seconds; test timing, not performance results):
All 12 outcomes, full logs, source hashes, machine details, and failure captures are retained. Proof archive SHA256:
ab82b4abc8107eac2f2d15f3bf542e95c33261b17e217cd12ec26e5dd549e58b.CI on this exact head is green: 39 jobs succeeded, 23 skipped, zero failed. The prior head's inherited mock-export guard failure does not recur. The aggregate gate is also green; superseded checks from the preceding head are excluded.
Measured improvement
The accepted performance comparison was on preceding head
848fa5e999e528f981fa1763bb2ca3d646a23656against base24e58b3e7271c48ef02e8716e0d30ac72526bb84; these timings were not rerun after the current rebase. Seven interleaved pairs ran on one quiet AWSc7a.4xlarge(16 CPUs, 32.9 GB RAM, 89% idle, 0% steal/I/O wait), using repository Chromium, production bundles, the Team-scale fixture extended to 1,100 messages, the supplied probes, and a fixed synthetic 250 ms inbound delay. Parentheses show IQR.All four observed cached row elements survive live catch-up in every run. Persisted bytes fall 93.5%, save latency 90.7%, and the completion task 13.2%. The remaining roughly 295 ms task includes sidebar completion and render microtasks; it is not pure IndexedDB deserialization.
Retained implementation proof
On preceding head
848fa5e, nine focused files passed 139 tests, changed-file lint and the four affected type graphs passed, and the full UI suite completed with 813 passed / 3 failed / 1 skipped files (3,532 passed / 3 failed / 1 skipped tests; 5,433.16 s wall). Warm boot and all seven history suites passed. The automation POSIX failure reproduced on that pinned baseline. The two previously unclassified failures are explained by the new comparison above. The sole skip was the opt-in desktop fixture. This full-suite result remains preceding-head evidence; the current follow-up ran the coordinator-requested 12 targeted executions plus exact-head CI.A separate released-v4 browser scenario passed 1/1 in 23.75 s on
848fa5e: actualv2026.10.4IndexedDB owner, valid synthetic 1,100-row envelope, current production UI, and synthetic Gateway. It verifies retirement before hello, preserved42rem/computed672pxbrowser preference, canonical IDs/content, bounded cache repopulation, cached paint on the next reload, and all 1,100 rows restored through offsets 0/50/1050 without mutation RPCs. The runnable compatibility scenario is retained; this is cache-boundary proof, not a complete old-app installation or durable Gateway migration.The cache-size, replay-identity, stale-metadata, and byte-limited refill regressions fail on the old implementation. Independent autoreview and the final preceding-head review found no actionable P0–P2 defect; the current rebase preserved all reviewed patches unchanged.
Size and release context
Runtime delta: +69 lines across five existing cache/history owners. Requested production stat: 220 insertions, 78 deletions (+142) across nine files, including benchmark/fixture support. Growth implements bounded projection, disposable-cache migration, and authoritative refill while reusing existing owners and deleting the old read-time repair.
Release-note context: warm reloads keep a small first-screen transcript cache and load older history on scroll; a one-time transcript-cache reset preserves the current sidebar cache.
AWS lease
cbx_147d070608d7is released with cleanup complete; no owned Gateway, browser, or test process remains.This PR remains open for coordinator review and manual landing. No merge is requested.