Skip to content

fix(control-ui): retain cached conversation titles on warm reload - #173266

Merged
steipete merged 4 commits into
mainfrom
steipete/coldload-warm-reload
Oct 16, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/coldload-warm-reload

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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 AWS c7a.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 base dbc41ff76ba1. Comparisons disable CDP tracing/CPU sampling; separate diagnostics supply screenshots. Values are median (IQR), milliseconds unless indicated.

Metric Baseline Candidate
FCP 584.0 (16.0) 600.0 (24.0)
First cached transcript row, DOM visibility 489.8 (20.5) 513.8 (28.7)
Live hello 231.3 (14.3) 253.1 (23.6)
Correct conversation header, DOM observation 1057.0 (140.6) 513.9 (28.7)
Live catch-up applied 1588.0 (135.4) 1634.1 (84.2)
Last layout shift 3258.1 (58.0) 3275.9 (96.9)
Last DOM mutation burst 3400.9 (66.7) 3433.5 (107.8)
Enabled input, DOM observation 489.9 (20.4) 513.8 (28.8)
Semantic phases 6.0 (0.0) 5.0 (0.0)
LoAF blocking 723.0 (53.0) 701.0 (74.5)
LoAF total duration 2038.0 (96.5) 2024.0 (124.0)
DOM mutation records 5574.0 (308.0) 5587.0 (25.0)
RPC count 87.0 (0.0) 87.0 (0.0)

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:

  • Exact-head CI is green. Isolated review is clean through P2.
  • Cache unit tests (31), terminal pane tests (9), native reload E2E (3), valid old-code negative control, script lint, and script types pass on this head. Native runner wall for 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.”
  • Complete final-head normal-mode UI E2E: 807 files: 805 passed, 1 failed, 1 skipped; 3,510 cases passed, 1 failed, 1 skipped. Wall time: 4485.04s (tests 94%, import 5%, transform 1%). No cases excluded. Native reload, both video-gallery variants, and update-run pass. The sole failure is QA automation setup: “Private mutation boundary is writable by another POSIX principal,” reproduced on main 631b5e86299 before product execution. Any cleanup stack belongs to that same failed case.
  • Prior source d45d77beda0f completed 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 main 631b5e86299. 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.
  • Released AWS lease cbx_fa79085e4acb, measurement/full-suite run: https://crabbox.openclaw.ai/portal/runs/run_ee8a15969b5cfbb9263f0b2c6fb055e8 . Current-main control (released lease cbx_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:

Before: cached transcript with a generic conversation header

After: cached transcript with its saved conversation title

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Every reload collects a Chrome trace and CPU profile without explicit transcript-persistence preparation.
  • After: Each reload follows a snapshot flush and records cache, transcript, and composer milestones without reload tracing.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The instrumentation is coherent on source review, with confidence limited by the experiment's preliminary validation.
Proof confidence 🦐 gold shrimp (3/6) This maintainer experiment is outside the ordinary contributor proof gate; its body reports a Chromium probe smoke, but supplies no inspectable output for the complete warm-reload measurement path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes
User problem: Reloading a previously visited dashboard conversation can expose several intermediate presentation states whose costs need attribution.
Reason: The existing benchmark owner is pursuing a bounded measurement experiment without claiming a runtime fix or committing to a production direction.

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
Reviewed head: 92a801d57061fbfa61ee5dfe23c7e4077e59a0a4

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not show complete traced and untraced warm-reload benchmark runs.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Benchmark tracing and artifact collection changes intended behavior with a stated reason (5559404: The merged benchmark added production-bundle traces, CPU profiles, RPC accounting, and filmstrip transitions for synthetic Team-scale comparisons.)
  • Synthetic Gateway instrumentation keeps the original intent (0e85fcf: The existing instrumentation models wire delivery and attributes sidebar response work; the added warm probe remains downstream of that same owner.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Explicit experimental scope: The complete current body marks this PR measurement-only and Do not merge, describes the intended warm-reload study, and says remote measurements remain pending; the head remains a draft. (92a801d57061)
  • Verified introduced scope: The pinned introduction diff changes only benchmark instrumentation; unrelated Codex changes in the endpoint comparison belong to base movement. (scripts/bench-control-ui-cold-load.ts:413, 92a801d57061)
  • Existing snapshot and readiness owners: The pane bridge exposes sessionSnapshotStore and transcriptReady, the snapshot store's flush awaits its write chain, and the existing database uses the snapshots store read by the benchmark. (ui/src/pages/chat/chat-pane.tsx:67, 92a801d57061)
  • Feature history: The merged benchmark introduction and subsequent live-event and row-delta work identify Peter Steinberger as the continuing area contributor; the original benchmark deliberately uses synthetic data and makes no real-Gateway CPU claim. (scripts/bench-control-ui-cold-load.ts:204, 3ab06f3597aa)
  • CI failure classification: The failing PR context check requests named body sections; it reports no code failure and is process paperwork under this review's rules. Skipped compilation and browser jobs provide no behavioral validation. (92a801d57061)
  • Applicable repository policy: The root, scripts, and Control UI guides were read completely; the UI guide specifically recommends several untraced benchmark runs. No scripts/lib AGENTS.md or maintainer-notes directory was present. (ui/AGENTS.md:40, 92a801d57061)

Likely related people:

  • Peter Steinberger: Raw commit 5559404 adds scripts/bench-control-ui-cold-load.ts:54 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5559404e2da9; files: scripts/bench-control-ui-cold-load.ts)

PR surface

Other +210. Total +210 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 227 17 +210
Total 2 227 17 +210

Review metrics

Metric Value Why it matters
Benchmark options 3 new CLI options --warm-reload, --untraced, and --probe-dir affect developer measurements only.

Labels

Label changes:

  • add P3: This is opt-in diagnostic tooling with no shipped UI behavior change or established urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is opt-in diagnostic tooling with no shipped UI behavior change or established urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Publish the traced and untraced measurement results before drawing a performance conclusion.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 15, 2026, 12:29 PM ET / 16:29 UTC.

@steipete
steipete force-pushed the steipete/coldload-warm-reload branch from 92a801d to 96646a1 Compare October 15, 2026 17:08
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui labels Oct 15, 2026
@steipete steipete changed the title experiment(control-ui): warm reload storyboard [do not merge] fix(control-ui): retain cached conversation titles on warm reload Oct 15, 2026
@steipete
steipete marked this pull request as ready for review October 15, 2026 17:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T23:24:20.660835Z bc4193b New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +30 to +32
| "label"
| "displayName"
| "derivedTitle"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-warm-reload branch from 96646a1 to aa3ea1c Compare October 15, 2026 17:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +30 to +32
| "label"
| "displayName"
| "derivedTitle"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-warm-reload branch from aa3ea1c to 64177c9 Compare October 15, 2026 19:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-warm-reload branch from 64177c9 to d45d77b Compare October 15, 2026 21:36
@steipete
steipete force-pushed the steipete/coldload-warm-reload branch from d45d77b to bc4193b Compare October 15, 2026 23:21
@steipete
steipete merged commit ffcb0a8 into main Oct 16, 2026
146 checks passed
@steipete
steipete deleted the steipete/coldload-warm-reload branch October 16, 2026 01:00
steipete added a commit that referenced this pull request Oct 16, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant