Repository navigation
improve: load 800 chat messages with less layout work - #133734
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 30, 2026, 10:59 PM ET / August 31, 2026, 02:59 UTC. ClawSweeper reviewWhat this changesThis PR raises the Control UI’s initial chat-history window from 400 to 800 messages and avoids measuring redundant tooltip triggers until the tooltip is open. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the performance change is not on current main, but the new lazy tooltip guard leaves redundant closed tooltips with a duplicate accessible description, a P2 regression to fix before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI requests a bounded transcript tail from the Gateway and virtualizes it in the browser. Its shared tooltip component updates alongside transcript rendering and manages both popup visibility and accessible descriptions. flowchart LR
A[Gateway transcript] --> B[History request window]
B --> C[Control UI chat state]
C --> D[Virtualized transcript]
D --> E[Shared tooltip update]
E --> F[Popup and accessible description]
Decision needed
Why: The server accepts the bound, but this changes the default browser/network cost for existing users and the supplied measurements do not include Gateway or network time. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +9, Docs 0. Total +15 across 16 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the bounded 800-message path if maintainers accept its startup tradeoff, and restore the redundant-tooltip accessibility cleanup without reintroducing geometry reads for every closed tooltip update. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: render a tooltip whose content repeats a fully visible trigger, await its first update, and inspect aria-describedby. The branch retains it, while the parent update calls close() and removes it. Is this the best way to solve the issue? No. The layout optimization is sound in principle, but deferring every closed-state redundancy check also changes accessible-description cleanup; separate that cleanup from the costly geometry path and add a regression assertion. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 237f23b45897. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* perf: load more chat history with less layout work * chore: leave history release notes to release generation
What Problem This Solves
Opening a long conversation shows only 400 messages before another history fetch is needed. Rendering and prepending history also repeatedly measures closed tooltip triggers, forcing avoidable layout work.
Related: #133680.
Why This Change Was Made
Raise the shared initial history window to 800 for startup, refresh, prefetch and task previews. Older pages remain 1,000, within the existing Gateway limit and response/cache byte budgets.
The shared tooltip component now checks text redundancy during updates only while open. Opening still checks the current trigger, and changing an open tooltip to redundant content still dismisses it. This removes unnecessary computed-style and geometry reads at their lifecycle owner without adding a cache or changing Web Awesome popup ownership.
User Impact
Twice as much initial history is available before loading another page. On the synthetic rich-history fixture, the new 800-message default paints in 248.6 ms versus 217.3 ms for the previous 400-message default: about 31 ms additional browser time, excluding Gateway/network. Payload doubles from 1.05 to 2.10 MiB; median resident JS heap rises from 18.04 to 19.42 MiB.
Evidence
Same prepared Linux Testbox, Chromium 144.0.7559.0, shipped UI bundle, 1280×800 viewport. Five fresh browser contexts per cell, rotated initial-size order; normal CPU and CDP 4× throttling. Actual startup request limits, returned message counts, virtualization and prepend anchors are asserted. Timings begin at synthetic Gateway response serialization/release and end at the first painted transcript frame; network and Gateway execution are excluded.
These are observed medians from five samples per cell, not statistical significance claims. The profiled
updated → isRedundantsubtree disappears: 127.8 → 0 ms for initial 800 and 140.5 → 0 ms for prepend at 4× CPU. Continuous scrolling shows no reliable speedup. Initial rendering stays at seven rows, the maximum observed set is 15, and maximum prepend-anchor drift stays 1.875 px.Fresh Node inspector measurements use real isolated SQLite, 3,000-message fixtures, five warmups and 30 rotated iterations per scenario. Preparing 800 messages takes 16.6 ms for short text, 34.3 ms for rich text, 60.9 ms with metadata and 38.8–40.3 ms for retained reset history. This quantifies the larger request; no Gateway source changes or additional server speedup are claimed.
tslogdeclarations; local DOM/browser runs encountered incompletelit-html/CSS dependencies. The prepared Testbox successfully ran the affected checks without changing the shared install.Prepared Testbox run: per-command wrapper exit codes were zero; the task-owned lease was stopped afterward.
Production LOC: +8/-2 (net +6), entirely the formatted open-state guard and invariant comment. Tests: +45/-36 (net +9). The shared default changes one existing constant; no new dependency, configuration, protocol, schema or persistence surface.
Before and after
Synthetic-only captures. Visible fixture code is identical (including its sample
limit: 400); the benchmark separately asserts actual startup requests of 400 before and 800 after. The viewport stays visually identical because history is virtualized.Before, initial 400:
After, initial 800:
Latest review disposition
The maintainer explicitly requested the 800-message default after discussing the larger startup payload, then requested this PR be landed. The measured browser, Gateway and payload tradeoffs above are accepted for this bounded default; no network speedup is claimed.
The latest ClawSweeper accessibility finding and associated Rank-up move are not an introduced regression:
close()in both parent5de1376b7f62and head952ca186ff4eleaves descriptions intact. It never callsrestoreDescription(); restoration is owned bydetachTrigger()anddescribe=false, unchanged by this PR.syncDescription()also remains unchanged. The review's claimed previous cleanup path does not exist. Any desire to suppress repeated accessible descriptions is a separate pre-existing behavior follow-up.The Web Awesome dependency contract was inspected directly in the installed package: its tooltip constructor initializes
open = false; the adapter already reads and writes that property inscheduleOpen(),show(),close()and click handling. The new guard uses the same supported property.Full exact-head CI passed at
952ca186ff4e3cbbfd4e61ad045532fdc818ac69, includingopenclaw/ci-gate.