Repository navigation
fix(control-ui): retain cached conversation titles on warm reload - #173266
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: needs maintainer review before merge. What this changesThis PR adds persisted-transcript warm-reload instrumentation and optional untraced measurements to the Control UI benchmark. Example: Measure three dashboard reloads with --warm-reload --untraced.
Review scores
ProductKind: Test only · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this PR open as an explicitly paused maintainer experiment; its benchmark-only scope is coherent, and source review found no definite introduced bug. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe developer benchmark serves production Control UI assets against a synthetic Gateway, reloads a seeded dashboard, and exports browser measurements and diagnostic artifacts. flowchart LR
A[Benchmark options] --> B[Production UI assets]
C[Synthetic Gateway] --> D[Chromium dashboard]
B --> D
E[Persisted transcript] --> D
D --> F[Reload probes]
F --> G[Metrics and diagnostic artifacts]
Technical reviewBest possible solution: Complete the warm-reload attribution study and use the measured bottleneck to scope any separate runtime change. Do we have a high-confidence way to reproduce the issue? This PR proposes measurement tooling rather than a bug fix; source inspection confirms the intended path, but no target code was executed during this read-only review. Is this the best way to solve the issue? Extending the maintained benchmark and flushing through the existing snapshot owner is appropriate for attribution, while any performance conclusion must remain limited to the synthetic workload. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3ab06f3597aa. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceOther +210. Total +210 across 2 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 15, 2026, 12:29 PM ET / 16:29 UTC. |
92a801d to
96646a1
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96646a157f
ℹ️ 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".
| | "label" | ||
| | "displayName" | ||
| | "derivedTitle" |
There was a problem hiding this comment.
Preserve every input used to derive the cached title
When an off-page session has no explicit label, displayName, or derivedTitle, its visible title can come from worktree, repository, device-folder, or account data in resolveSessionDisplayName. This reduced metadata omits those inputs, so a warm reload renders the key-derived fallback instead of the previously displayed title until live metadata arrives. Cache the resolved presentation title or include all fields consumed by the display-name owner.
Useful? React with 👍 / 👎.
96646a1 to
aa3ea1c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa3ea1c756
ℹ️ 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".
| | "label" | ||
| | "displayName" | ||
| | "derivedTitle" |
There was a problem hiding this comment.
Refresh cached titles when session metadata changes
When a conversation is renamed or receives its asynchronous derivedTitle after the initial history response, these newly persisted fields remain stale because projectChatTranscriptMetadata is only called from history/prefetch paths; the session-list mutation paths never update the transcript snapshot. For an off-page conversation, the next warm reload therefore paints the old title—or New session—until live metadata arrives, despite the current page having displayed the updated title before reload. Reconcile the cached projection whenever the authoritative session title changes.
AGENTS.md reference: ui/AGENTS.md:L17-L19
Useful? React with 👍 / 👎.
aa3ea1c to
64177c9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64177c9be8
ℹ️ 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".
| milestones, | ||
| reads, | ||
| shifts, | ||
| cls: shifts.reduce((sum, shift) => sum + shift.value, 0), |
There was a problem hiding this comment.
Calculate CLS using layout-shift session windows
When a reload has multiple layout-shift clusters separated by more than one second, summing every shift over the entire run overstates CLS. CLS is the maximum score among session windows, each capped at five seconds and ended by a one-second gap; as written, this benchmark can report misleading A/B results. Compute those windows before assigning cls, or rename this field if total layout shift is the intended metric.
Useful? React with 👍 / 👎.
64177c9 to
d45d77b
Compare
d45d77b to
bc4193b
Compare
The benchmark probe added in ffcb0a8 (#173266) captured the native IndexedDB get method under an unbound-method suppression, growing the production suppression inventory. Give the captured method and its wrapper explicit IDBObjectStore receivers. Keep prototype-wide interception and get.apply(this, args), so every store retains its own request and result. The allowlist and existing assertions are unchanged. No application or update behavior changes. pnpm test test/scripts/lint-suppressions.test.ts --maxWorkers=1: 3 passed, 14.14s command wall (12.02s file). Reused the prior failing proof because both the probe and ratchet source blobs are identical on this base. The only importer is bench-control-ui-cold-load.ts; no importing tests. Its actual serialized probe passed isolated jsdom/fake-indexeddb proof of two stores, four reads, hits/misses, key ranges, request sources and results, and captured cache-read records. Full browser benchmark was not run. Scripts types, erasability, type-aware/boundary lint, format, and independent P2 review passed. check-changed passed its other gates; scripts Knip was clean, while production/full scans retain two unrelated lazy-view-error exports (renderLazyElementState and renderLazyViewError). No export/import or baseline exceptions changed.
…penclaw#173266) The session message cache now keeps the conversation's label, display name and derived title with its cached transcript rows, and the chat header falls back to that cached metadata until the live session row arrives. Warm reloads no longer show a temporary "New session" header before the real title. Seven interleaved AWS pairs (warm reload of a visited session, Team-scale fixture): correct-header DOM readiness 1,057 -> 514 ms (IQR 141 -> 29), semantic visual states 6 -> 5 in every pair; FCP 584 -> 600 ms (within spread). Runtime +16 LOC; the rest is the warm-reload bench probe and docs. Full UI e2e passed apart from one inherited QA setup failure reproduced on main; exact-head CI green.
…3680) The benchmark probe added in 2cb93f0 (openclaw#173266) captured the native IndexedDB get method under an unbound-method suppression, growing the production suppression inventory. Give the captured method and its wrapper explicit IDBObjectStore receivers. Keep prototype-wide interception and get.apply(this, args), so every store retains its own request and result. The allowlist and existing assertions are unchanged. No application or update behavior changes. pnpm test test/scripts/lint-suppressions.test.ts --maxWorkers=1: 3 passed, 14.14s command wall (12.02s file). Reused the prior failing proof because both the probe and ratchet source blobs are identical on this base. The only importer is bench-control-ui-cold-load.ts; no importing tests. Its actual serialized probe passed isolated jsdom/fake-indexeddb proof of two stores, four reads, hits/misses, key ranges, request sources and results, and captured cache-read records. Full browser benchmark was not run. Scripts types, erasability, type-aware/boundary lint, format, and independent P2 review passed. check-changed passed its other gates; scripts Knip was clean, while production/full scans retain two unrelated lazy-view-error exports (renderLazyElementState and renderLazyViewError). No export/import or baseline exceptions changed.
What Problem This Solves
A warm reload could paint a cached conversation under “New session” until its live descriptor arrived, especially for a pinned conversation outside the saved sidebar page. The campaign’s seed evidence counted fourteen intermediate states for a signed-in dashboard deep-link reload; the maintained synthetic warm-reload fixture still exposed this generic-header phase.
The transcript snapshot now retains its existing label, display name, and derived title fields. The header consumes them through the pane’s existing scoped display-projection owner. Current rows retain title precedence and remain the source for session actions. The benchmark explicitly persists the selected transcript before reload and records the warm storyboard, row retention, LoAF, mutations, and RPC census.
Evidence
Final source:
bc4193bef2ca1049e29da79e601bce7e3d15a564. One quiet AWSc7a.4xlarge(16 CPUs, approximately 31 GiB), repository Playwright Chromium 153, seven interleaved AB/BA pairs, 35 ms inbound delay / 4 ms delivery spacing. Both production bundles share build identity; baseline changes only the three runtime files to merge basedbc41ff76ba1. Comparisons disable CDP tracing/CPU sampling; separate diagnostics supply screenshots. Values are median (IQR), milliseconds unless indicated.The correct header arrives with cached rows in all seven candidate runs, earlier in every matched pair (paired median gain 560.3 ms; difference of group medians 543.1 ms). All fourteen runs retain all ten cached row elements at catch-up, with zero removals. Observed tradeoff: FCP median is 16 ms later (584 → 600 ms), with IQR 16 → 24 ms. Cached-row/input DOM observations are about 24 ms later; five pairs delay early milestones and two improve them. Last layout-shift and mutation-burst medians are slightly later. CLS is approximately 0.00175 → 0.00143. This is a consistent title-state improvement, not a general startup, CPU, or network speedup; a small startup cost is not ruled out.
The six-to-five count uses the predeclared semantic vector: shell, sidebar, header, visible rows, enabled input, and board. It removes the generic-title phase. DOM milestones can precede paint; FCP and the inspected filmstrip are separate evidence. Large-pixel transition groups are six before and five after in this final traced pair; prior pairs had five/six and six/six. They vary with profiling/coalescing and do not establish uniformly fewer painted changes. This renderer fixture does not measure production authentication, redirects, real plugin cost, or service-worker behavior.
The largest IDBTransaction completion script in each untraced run has median duration 62 → 64 ms; its containing frame starts after cached rows are detected in the DOM in all fourteen runs. Those frames overlap FCP in 2/7 baseline and 4/7 candidate runs, so they can still delay paint. DOM readiness is not painted readiness. This does not assign the entire frame to initial transcript disk restore; native IDB/structured-clone and callback-induced UI work remain unseparated.
Proof:
pnpm test ui/src/e2e/chat-cold-load-anchor.e2e.test.ts --maxWorkers=1: 28.27 s. Old code fails with expected “Synthetic cold-load conversation,” received “New session.”631b5e86299before product execution. Any cleanup stack belongs to that same failed case.d45d77beda0fcompleted 806 files: 804 passed, one failed, one skipped; 3,506 cases passed, one failed, one skipped. Its only failure is QA private-mutation-boundary setup before product execution, reproduced on main631b5e86299. Corrected update-run, native reload and both video-gallery variants pass. Main’s streaming benchmark perf(control-ui): avoid reparsing completed code while replies stream #173264 landed during that long proof, requiring this rebase; both init/result paths and validators are retained, and the streaming benchmark with an extra init-script ordering assertion passes. Runtime/UI regression/fixture/docs remain byte-identical.cbx_fa79085e4acb, measurement/full-suite run: https://crabbox.openclaw.ai/portal/runs/run_ee8a15969b5cfbb9263f0b2c6fb055e8 . Current-main control (released leasecbx_1704bb181dca): https://crabbox.openclaw.ai/portal/runs/run_0a02ed1e93d00351c456ff3beebae727 .All seven lane leases are released with cleanup complete. No host Gateway was started.
Runtime LOC: +17 / -1, net +16. Requested production-stat command: +307 / -18, net +289, including +290 / -17 (net +273) lines of opt-in measurement tooling and guide. The growth carries missing display facts through the existing bounded cache and adds the requested scenario. Live descriptors remain necessary for current metadata/actions; genuine new or uncached conversations keep their existing title resolution. No server schema/config/protocol change or CHANGELOG edit. Release-note context: preserve a cached conversation’s header title during warm reloads, including off-page pinned sessions.
Inspected synthetic pre-hello captures from the final-head bounded-roster regression: