Skip to content

perf(control-ui): warm-start dashboard widgets from scoped snapshots - #178113

Merged
steipete merged 22 commits into
mainfrom
steipete/coldload-dashboard-widget-warm-start
Oct 20, 2026
Merged

steipete merged 22 commits into
mainfrom
steipete/coldload-dashboard-widget-warm-start

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A signed-in reload of a dashboard deep link waits through connect → hello → board.get → discover before its primary content appears. The reported live reload inserted the sandbox iframe only after 1,016–1,161 ms. This change restores the dashboard from the last scoped conversation snapshot while live authority catches up.

The existing account/host/agent/session-scoped conversation cache retains board metadata and its original ticket receipt. Unchanged content keeps its iframe; changed, removed, expired, or forbidden content replaces or clears it. Unconfirmed apps cannot auto-start from cache. No new store, Gateway schema, configuration option, or sandbox security-model change.

Board restoration and validation remain outside startup. Packaged Settings loading and widget-only English copy load with their consumers. The final AWS build measures 325,075 B gzip, down from 325,890 B on baseline, with seven startup requests unchanged. The cap stays 325,166 B, leaving 91 B headroom. Source-map inspection confirms the board restore helper, generated board validator, Settings loader, and widget catalog are absent from startup.

Evidence

Head: db4ac4b7e54436fffdfe4f22b627e596a3e56b24. Baseline: 8fe652f7cef3ea1901eb6b916ec002bef90d9598. AWS Crabbox cbx_f35cc07b0ab5, fixed c7a.4xlarge, 16 vCPUs / approximately 32 GiB, repository Playwright Chromium. Eleven interleaved baseline/candidate pairs for each route, separate from the six CPU-profile captures. Connect floor 400 ms, connect response delay 230 ms, board.get 150 ms, discover 100 ms. Dashboard connect sends were 442.8–486.2 ms on baseline and 439.6–468.8 ms on candidate, within the declared live-like range.

The measured fixture is a synthetic HTML-backed dashboard widget through the cross-origin sandbox/board-HTTP path, with its own font. Native MCP app-view mode has a separate passing smoke check; the timing claim is for the HTML-backed path. App-ready is the host receiving the synthetic app's readiness message after its font and two animation frames, not a compositor-paint timestamp. Hello-handled is the microtask after connected-state publication. Request timestamps are main-thread dispatch observations, not network arrival times.

Dashboard-ready improves 1,497.2 → 1,033.9 ms, paired median −417.5 ms, 11/11 faster, with separated IQRs. Every dashboard ends with the same five chat rows, one iframe, and one board HTML fetch; chat-route controls retain six rows. The fixture does not reproduce the reported duplicate HTML fetch, so this PR does not claim a duplicate-fetch fix.

All gates pass under the declared rule: the primary needs separated lower IQRs or at least 9/11 faster pairs with negative median delta. A secondary regresses only with separated higher IQRs, or at least 9/11 slower pairs plus a median rise greater than max(10 ms, 3%).

Dashboard

Metric Baseline median [Q1, Q3] Candidate median [Q1, Q3] Paired median delta Better / worse
Dashboard app ready 1497.2 [1454.2, 1505.2] 1033.9 [1027.6, 1095.3] -417.5 11 / 0
Hello handled 715.4 [712.9, 725.7] 715.1 [710.1, 724.0] -2.3 8 / 3
FCP 236.0 [236.0, 240.0] 240.0 [234.0, 244.0] +0.0 3 / 5
LoAF blocking 191.0 [188.5, 207.5] 192.0 [182.5, 193.5] -8.0 8 / 3
Chat catch-up applied 1115.7 [1093.7, 1138.0] 1153.0 [1130.8, 1159.7] +29.0 3 / 8
Last observed transcript paint 460.0 [456.0, 470.0] 456.0 [452.0, 466.0] -4.0 6 / 3
Pair Dashboard app ready Hello handled FCP LoAF blocking Chat catch-up applied Last observed transcript paint
1 -496.2 +7.3 +8.0 +5.0 -13.1 +12.0
2 -335.9 -15.6 -4.0 -6.0 +32.4 -24.0
3 -335.0 +7.2 +0.0 +13.0 +67.8 +0.0
4 -530.3 -2.3 +12.0 -20.0 +29.0 +0.0
5 -457.3 -0.8 +0.0 -9.0 -1.5 -16.0
6 -345.7 +19.7 +8.0 +16.0 +66.3 +8.0
7 -364.2 -16.6 -24.0 -13.0 -19.8 -8.0
8 -483.5 -1.8 +12.0 -10.0 +8.8 -4.0
9 -463.6 -4.8 +0.0 -8.0 +28.1 +4.0
10 -417.5 -21.9 +232.0 -6.0 +31.4 -20.0
11 -391.8 -7.0 -8.0 -27.0 +78.2 -8.0
Stage Baseline median Candidate median
connectSentMs 453.8 449.0
helloHandledMs 715.4 715.1
boardGetResponseMs 934.5 970.6
discoverResponseMs 939.4 986.4
iframeInsertedMs 952.4 524.6
sandboxDocLoadedMs 1296.7 757.5
boardFetchStartMs 952.9 701.4
boardFetchEndMs 1032.4 719.0
resourceLoadedMs 1418.1 1015.0
dashboardAppReadyMs 1497.2 1033.9

Chat

Metric Baseline median [Q1, Q3] Candidate median [Q1, Q3] Paired median delta Better / worse
Hello handled 699.6 [695.9, 703.4] 704.6 [695.8, 705.5] +1.8 5 / 6
FCP 240.0 [236.0, 244.0] 240.0 [236.0, 246.0] +0.0 3 / 4
LoAF blocking 169.0 [166.5, 179.5] 174.0 [167.5, 177.0] -5.0 7 / 4
Chat catch-up applied 1061.5 [1052.2, 1096.3] 1051.8 [1038.7, 1087.2] -6.2 7 / 4
Last observed transcript paint 476.0 [472.0, 480.0] 476.0 [472.0, 480.0] -4.0 6 / 4
Pair Hello handled FCP LoAF blocking Chat catch-up applied Last observed transcript paint
1 +8.7 +4.0 -9.0 -26.4 +20.0
2 -10.7 +0.0 +19.0 -3.0 -16.0
3 +8.7 -4.0 -10.0 +54.4 +16.0
4 +2.4 +8.0 -14.0 -67.9 +4.0
5 -0.8 +4.0 +20.0 +15.0 -12.0
6 -4.2 +0.0 -11.0 -71.0 +0.0
7 +1.8 -4.0 +7.0 -27.4 -4.0
8 +7.2 +0.0 +9.0 -6.2 -20.0
9 -9.4 -4.0 -13.0 +68.9 -4.0
10 -6.4 +12.0 -5.0 -41.6 -8.0
11 +9.7 +0.0 -2.0 +18.8 +4.0

Accepted tradeoff

The maintainer accepted extra dashboard-page blocking and later secondary-pane chat catch-up for the primary dashboard-ready gain. The originally accepted run had +12 ms median LoAF blocking and +45.1 ms paired chat catch-up.

On the final head, dashboard LoAF blocking is 191 → 192 ms median, with overlapping IQRs and a −8 ms paired median. Dashboard chat catch-up is 1,115.7 → 1,153.0 ms, paired +29.0 ms. Catch-up is later in 8/11 pairs; its IQRs overlap, so it passes the declared regression rule. The remaining secondary-pane delay is retained under the accepted tradeoff.

Hello-handled is 715.4 → 715.1 ms, paired −2.3 ms. FCP is 236 → 240 ms, paired 0 ms; one pair has a +232 ms FCP outlier, while the IQRs overlap. All chat-route controls pass. A live regression in hello-handled time or final chat rows means revert.

Source-mapped attribution

Three profiles per build reveal no supported ≤20-line product fix. The candidate frame with extra blocking spends 13.9 ms in the benchmark's own visibility probe, including 13 ms forced style/layout. The exact source is warmReloadProbe.sample, which calls getComputedStyle before recording catch-up readiness. This explains that profiled frame, not every unprofiled blocking difference; no probe cost is subtracted from the gate above.

A roughly 16 ms theme-token read appears in both builds. Whole-reload sidebar geometry samples rise from roughly 15 to 30 ms, but do not establish duplicate reads or a safe way to omit the width measurement. Cache serialization, cached-board validation/restoration, and board rendering show no concentrated extra cost. Exact-window application self median is 30.2 → 25.0 ms; whole-reload application self is 671.0 → 658.4 ms. No speculative theme, cache, or scheduling change is included.

Profiling changes scheduling: only one candidate capture mounts before hello, and its connect send is 631 ms, outside the requested range. The unprofiled pairs above reproduce the requested handshake range and decide the gate. Profiles cover host execution, not sandbox subprocess CPU; inclusive samples overlap and cannot be added.

Correctness and validation

All proof below uses head db4ac4b7e54436fffdfe4f22b627e596a3e56b24 on AWS Crabbox cbx_f35cc07b0ab5 (run run_501abf5c7c696cd668d3f05c717f0425, fixed c7a.4xlarge). Baseline reproductions use 8fe652f7cef3ea1901eb6b916ec002bef90d9598 and its matching Gateway/UI build on the same lease.

Proof Result
Exact-head CI 39419407593 Green, 70 jobs completed, zero failures
Focused UI/cache/provider/Settings/catalog tests 316 passed across 21 files, 55.65 s, --maxWorkers=1
Existing board HTTP and runtime-authority tests 24 passed across 2 files, 74.97 s, --maxWorkers=1
Full UI E2E, node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=4 834 files passed, 2 failed, 4 skipped; 3,612 tests passed, 2 failed, 4 skipped; 4,496.49 s. Both failures reproduced on baseline below.
Builds, generated validator/boot manifest, startup size and source-map audit Passed
Core test types, UI production types, scripts types, formatting, UI i18n and controller guards Passed
node scripts/check-changed.mjs Red on inherited repository checks and monolithic lint exit 137; fully classified below
Independent autoreview Clean through P2, including the full feature, catalog/budget changes, and final test-type fix

The full suite passes the new dashboard cold-load E2E (2 cases, 8.629 s), native MCP board flows, widget sandbox, dashboard presentation/retention, lazy plugin Settings, and locale-loading coverage. The four skipped cases retain their existing suite conditions; no skip or expected-failure exception was added.

Regression coverage includes changed/removed/forbidden boards, unconfirmed apps, foreign scope, reconnect, expired ticket lifetimes, malformed cached boards preserving the transcript, Settings disposal during lazy loading, and cancellation of deferred cache writes after a board lease retires. The retired-lease regression failed before the fix and passes afterward. chat-pane-board.loading.test.tsx took 19.66 s locally with one worker; the final English-catalog test fix took 2.19 s locally. These are test runtimes, not performance measurements. The existing HTTP/runtime tests cover allowed document delivery, expired/stale ticket rejection, and live authority at board effects.

Inherited failures

Check Head result Baseline evidence
extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts POSIX private-mutation boundary rejects fixture setup before browser behavior Same failure on baseline, same dependency boundary
ui/src/pages/workboard/workboard-distribution.e2e.test.ts Times out waiting for .workboard-page-title containing the synthetic title Same wait fails on baseline (full-suite timeout 30 s; focused baseline timeout 10 s)
Max-lines suppression ratchet Flags chat-message.test.tsx, config-page-state.ts, sessions-page-state.ts Same three findings on baseline; these files and the suppression baseline are unchanged by this branch
Core test-root budget Four existing groups exceed 720 roots: 721, 721, 724, 727 Identical counts on baseline
Full-tree dead-export scan alreadyCurrentConvergenceCases in src/cli/update-cli/update-command-runtime-recovery.test-support.ts Same finding on baseline; script and production scans pass on both
Core lint Monolithic process exits 137. Supported split-core run completes and reports 18 max-lines errors. All 18 files are unchanged by this branch; focused baseline lint reproduces all 18 with identical line counts.

The two failing E2E files were rerun together on baseline with one worker: 2 failed, 1 passed, 168.01 s. The baseline lint reproduction took 44.7 s. Raw failing results remain recorded; no cap, lint rule, test, or permission check was weakened.

Identical baseline/head max-lines findings
  • src/agents/code-mode-execution.ts: 701 counted lines
  • src/agents/embedded-agent-runner/run/terminal-preparation.test.ts: 1007 counted lines
  • src/agents/harness/execution-environment.ts: 723 counted lines
  • src/cron/isolated-agent/run-prompt-executor.ts: 701 counted lines
  • src/gateway/methods/core-descriptors.ts: 701 counted lines
  • src/gateway/node-registry-private.ts: 710 counted lines
  • src/gateway/server/ws-connection/message-handler.ts: 707 counted lines
  • src/gateway/session-worktree-preparation.ts: 725 counted lines
  • src/state/openclaw-agent-db.postgres.test.ts: 1142 counted lines
  • src/state/openclaw-database-preflight.ts: 704 counted lines
  • ui/src/app/app-shell-gateway.test.ts: 1063 counted lines
  • ui/src/app/bootstrap.ts: 733 counted lines
  • ui/src/pages/activity/activity-page.test.ts: 1287 counted lines
  • ui/src/pages/chat/chat-thread-build.ts: 745 counted lines
  • ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts: 701 counted lines
  • ui/src/pages/model-providers/login-controller.ts: 704 counted lines
  • ui/src/pages/model-setup/model-setup-owner.ts: 714 counted lines
  • ui/src/pages/new-session/draft-place-state.ts: 707 counted lines

Known cache limit: explicit conversation-snapshot eviction, including rewind and branch switching, can discard the board alongside the transcript. The following reload safely uses live board loading until a board response repopulates the cache. Ordinary transcript replacement preserves board metadata. The existing bounded shared-record invalidation lifecycle is retained; review disposition.

Production size and release context

Handwritten UI runtime delta: +255 LOC (392 added, 137 removed). Generated board validator/types: +259 LOC. Growth implements the scoped board snapshot, original ticket lifetime, live reconciliation, and hydration/lease invalidation contracts. The superseded eager Settings loader body is removed; widget-only English copy leaves the eager catalog. No server durable-state change, new store, configuration option, or dependency.

Requested diff-stat command (git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'): 33 files, +1,183/−230, net +953. That literal pattern includes benchmark/probe fixtures and .test.tsx files; the runtime-only counts above exclude them. Release-note context: returning dashboard sessions can start embedded content from a scoped snapshot while live state reconciles.

Synthetic visual diagnostic

These synthetic-only captures illustrate the warm-start behavior. They are earlier traced diagnostic runs (baseline frame 1,609 ms; candidate frame 1,691 ms), not timing proof. No private capture was uploaded.

Before: synthetic dashboard is still loading

After: synthetic dashboard has rendered

Ready for maintainer review. Do not merge automatically. A live regression in hello-handled time or final chat rows means revert.

@clawsweeper

clawsweeper Bot commented Oct 20, 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 docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: XL labels Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR restores cached dashboard metadata before connection completion so widget sandboxes can start earlier.

Example: Reload the cached Mission control dashboard while Gateway hello and board.get are delayed.

  • Before: The widget sandbox waits for live board metadata.
  • After: The sandbox starts from cached metadata, and document fetching begins after connection while board.get remains pending.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The experiment has a coherent owner boundary, but a concrete persistence defect blocks correctness and restored-ticket authority lacks runtime proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: A returning dashboard user waits through connection and board-response dependencies before widgets begin loading.
Reason: The area owner explicitly sponsors this bounded experiment, and source confirms the targeted dependency; its experimental hold remains in force.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep this PR open as the owner's explicitly paused experiment; the new persistence path can save mutation-only fields that invalidate the shared warm cache.

Priority: P2
Reviewed head: 2651fbd109dc721db272c1d44a341f0872bd5552

Before merge

  • Add real behavior proof - Authority-chain proof required: restored board snapshots persist view tickets and permit document loading before board.get settles; provide allowed and nearest-forbidden final-effect traces showing revocation or reassignment prevents HTML delivery and widget actions, with sensitive values redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Project mutation responses to the canonical board shape before saving (P2) - Pinning a widget returns a BoardWidgetPutResult containing resolvedWidgetName. The spread here preserves that extra property and the new callback persists it. If the follow-up board.get is delayed or unavailable long enough for the snapshot write, the next reload rejects this otherwise valid board because isBoardSnapshot requires exactly sessionKey, revision, tabs, and widgets. SessionSnapshotStore.read then resets the entire shared snapshot database, dropping cached transcripts and sidebar state. Persist an explicit canonical board projection and cover a pin response round-trip through the snapshot store.
  • Resolve security concern: Verify authority after restoring bearer tickets - The existing server retains live authority and document checks, so no bypass is established; the supplied tests do not demonstrate cached-ticket rejection at HTML delivery or widget effects after access revocation or reassignment.
  • Resolve merge risk - Persisted tickets can reach document fetching before board revalidation; verify that revoked or reassigned access is rejected before HTML delivery and widget effects.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Project mutation responses to the canonical board shape before saving — ui/src/lib/board/gateway-provider.ts:550-552
  • [medium] Verify authority after restoring bearer tickets — ui/src/lib/board/gateway-provider.ts:130

Tests

  • Missing end-to-end proof: Show restored-ticket reload behavior at final HTTP/action boundaries, a latest-stable upgrade with existing snapshots intact, and the pin-response persistence regression failing on this head before its repair.
Agent review details

How this fits together

The Control UI board provider receives Gateway snapshots, publishes widget state to dashboard panes, and now saves that state through the account-scoped conversation snapshot store.

flowchart TD
  A[Dashboard route] --> B[Conversation snapshot store]
  B --> C[Board provider]
  D[Gateway board responses] --> C
  C --> B
  C --> E[Widget sandbox]
  E --> F[Authorized document and action requests]
Loading

Technical review

Best possible solution:

Persist canonical board fields through the existing snapshot owner, then qualify the warm-start experiment without weakening live authority checks.

Do we have a high-confidence way to reproduce the issue?

Source establishes both the existing board-data dependency and the introduced pin-response validation failure; no target code or tests were executed.

Is this the best way to solve the issue?

Reusing the scoped conversation store and existing board provider is a focused approach, but persisted snapshots must project the canonical board shape rather than retain complete mutation responses.

Full review comments:

  • [P2] Project mutation responses to the canonical board shape before saving — ui/src/lib/board/gateway-provider.ts:550-552
    Pinning a widget returns a BoardWidgetPutResult containing resolvedWidgetName. The spread here preserves that extra property and the new callback persists it. If the follow-up board.get is delayed or unavailable long enough for the snapshot write, the next reload rejects this otherwise valid board because isBoardSnapshot requires exactly sessionKey, revision, tabs, and widgets. SessionSnapshotStore.read then resets the entire shared snapshot database, dropping cached transcripts and sidebar state. Persist an explicit canonical board projection and cover a pin response round-trip through the snapshot store.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 765a5f2f4c44.

Merge-risk options

Maintainer options:

  1. Prove restored-ticket rejection (recommended)
    Exercise cached-ticket reloads through the real HTTP and widget-action owners, showing allowed access and rejection after revocation or reassignment before final effects.

Provenance checked

Testing

Proof path: unit tests only.

Security

Needs attention: Persisted view tickets need final-effect revocation proof before this experiment can merge.

Evidence

Security concerns:

  • [medium] Verify authority after restoring bearer tickets — ui/src/lib/board/gateway-provider.ts:130
    The existing server retains live authority and document checks, so no bypass is established; the supplied tests do not demonstrate cached-ticket rejection at HTML delivery or widget effects after access revocation or reassignment.
    Confidence: 0.95

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit febeb6a adds ui/src/lib/board/gateway-provider.ts:61 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: febeb6ac1267; files: ui/src/lib/board/gateway-provider.ts)

PR surface

Source +421, Tests +404, Docs +3, Generated +26, Other +130. Total +984 across 22 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 432 11 +421
Tests 9 492 88 +404
Docs 1 5 2 +3
Config 0 0 0 0
Generated 1 26 0 +26
Other 3 163 33 +130
Total 22 1118 134 +984

Review metrics

Metric Value Why it matters
Benchmark options 2 new flags --dashboard-widget and --connect-not-before-ms extend the synthetic benchmark; no Gateway configuration option is added.

Labels

Label changes:

  • add P2: This is a scoped dashboard reload improvement with a recoverable browser-cache defect.
  • add merge-risk: 🚨 session-state: A persisted pin response can fail validation and reset cached transcripts and sidebar snapshots.
  • add merge-risk: 🚨 security-boundary: The change persists bearer view tickets and consumes them before the live board refresh completes.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: This is a scoped dashboard reload improvement with a recoverable browser-cache defect.
  • merge-risk: 🚨 session-state: A persisted pin response can fail validation and reset cached transcripts and sidebar snapshots.
  • merge-risk: 🚨 security-boundary: The change persists bearer view tickets and consumes them before the live board refresh completes.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect proof that revoked or reassigned access rejects restored tickets before HTML delivery and widget actions.

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 20, 2026, 1:58 AM ET / 05:58 UTC.

@steipete
steipete force-pushed the steipete/coldload-dashboard-widget-warm-start branch 5 times, most recently from 4f43da4 to beef7f2 Compare October 20, 2026 07:14
@steipete steipete closed this Oct 20, 2026
@steipete steipete reopened this Oct 20, 2026
@steipete
steipete force-pushed the steipete/coldload-dashboard-widget-warm-start branch 7 times, most recently from 06910b8 to 7e93326 Compare October 20, 2026 08:32
@steipete steipete changed the title experiment(control-ui): dashboard widget warm start [do not merge] perf(control-ui): warm-start dashboard widgets from scoped snapshots Oct 20, 2026
@steipete
steipete marked this pull request as ready for review October 20, 2026 08:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-20T12:08:28.548875Z db4ac4b 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.

@steipete
steipete force-pushed the steipete/coldload-dashboard-widget-warm-start branch from 67f041f to db4ac4b Compare October 20, 2026 12:03

@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: db4ac4b7e5

ℹ️ 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 +327 to +331
// Boards belong to the scoped conversation key, independently of transcript resets.
const snapshot =
withWidgetHeights.board === undefined && existing?.snapshot.board !== undefined
? { ...withWidgetHeights, board: existing.snapshot.board }
: withWidgetHeights;

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 board snapshots during transcript invalidation

Storing the board only inside the transcript cache record means transcript-only operations also erase the board: both rewindChatHistory and switchChatHistoryBranch call clearChatMessagesFromCache, which unconditionally deletes the whole in-memory and IndexedDB snapshot. Those operations do not change the dashboard or trigger board.changed, so the board is not persisted again until a later board mutation; a reload in between loses the warm dashboard and waits for board.get. Preserve the board when invalidating transcript fields, or give it an independent invalidation lifecycle.

AGENTS.md reference: ui/AGENTS.md:L16-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed the cache-miss case. Rewind and branch switching intentionally evict the entire existing conversation snapshot through clearChatMessagesFromCache and SessionSnapshotStore.delete; the next dashboard reload therefore takes the live board.get path until the board is cached again. The board is not lost on the server, stale content is not shown, and authority checks are unchanged.

I am retaining that shared-record invalidation contract in this bounded warm-start change rather than adding a separate board-retention lifecycle. Ordinary transcript replacement already preserves the board; explicit snapshot eviction, expiration, and pruning remain allowed to discard it. I will document this limitation in the PR. Preserving warm dashboards across explicit history eviction is a follow-up optimization, not a correctness blocker for this cache.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Final head: db4ac4b. The body now contains the final 11-pair dashboard/chat comparison, stage table, accepted tradeoff, source-mapped attribution, and exact-head validation. Startup is 325,075 B gzip, 91 B below the unchanged cap. CI is green.

The final full UI run passed 834 files; its two failures reproduce on the pinned main baseline. Focused UI tests pass (316), as do the existing board HTTP and runtime-authority tests (24), including expired/stale ticket rejection and current authority at effects. The raw changed-check failures and matching baseline evidence are listed in the body. Independent review is clean through P2.

The retired-lease persistence finding is fixed. The newer advisory about explicit history-cache eviction is documented as a safe cold-load limitation, with the existing shared-record invalidation lifecycle retained. No merge action is requested.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 5ec154f into main Oct 20, 2026
148 of 149 checks passed
@steipete
steipete deleted the steipete/coldload-dashboard-widget-warm-start branch October 20, 2026 14:36
fuller-stack-dev added a commit that referenced this pull request Oct 20, 2026
…rator

Main's #178113 regenerated board.js with the previous generator after this branch's base. Regenerating with this branch's generator drops the physical dependency-path banner like the other validators; executable output is unchanged.
fuller-stack-dev added a commit that referenced this pull request Oct 20, 2026
…rktrees (#177934)

* fix(update): make validator generation path-independent and allow linked worktrees

Generated control UI validators embedded physical dependency paths, so a
hoisted or global install failed the freshness check. esbuild now minifies
whitespace, dropping those path banners; the TypeBox license is kept and
executable output is unchanged.

The reference-source snapshot rejected a registered linked worktree nested
in the checkout. It now excludes only a positively identified registered
worktree (reciprocal .git, gitdir and commondir identity) and rechecks it
before stopping the Gateway. Unknown nested repositories still refuse.

* chore(ui): regenerate board validators with the path-independent generator

Main's #178113 regenerated board.js with the previous generator after this branch's base. Regenerating with this branch's generator drops the physical dependency-path banner like the other validators; executable output is unchanged.
steipete added a commit that referenced this pull request Oct 21, 2026
…ript validation (#178658)

L158 (#178113) restores a cached dashboard before hello, but the restore waited on the lazily loaded transcript validator, so on Team the sandbox iframe often attached only after board.get returned (live r173: 776-797 ms in one batch, 505-633 ms in another). Restore the board snapshot independently of transcript validation, after the WebSocket connect request has been sent (a new initialConnectSent signal) so the early dashboard render never lands in the hello-handling window; re-read the cache after that wait and keep every #178113 safety rule (shape validation, session match, pending/rejected grant filter, ticket TTL aging, board.get authority).

Evidence (AWS c7a.4xlarge, 11 pairs, synthetic dashboard fixture with the transcript validator held): sandbox iframe insertion 808.8 -> 359.3 ms (-450.7 paired, 11/11); hello handling +8.1 ms paired with overlapping IQRs (within the no-regression rule); FCP, LoAF, chat catch-up and chat-route controls unchanged.

Runtime +35 LOC. Full UI 837 files / 3,617 tests (4 opt-in skips); focused tests incl. a held-validator negative control that fails on the original restore; exact-head CI green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…trip (openclaw#178113)

Reloading a dashboard-face session started its MCP app only at the end of a serial chain: WebSocket connect -> hello -> board.get -> mcp.app.discover -> board chunk mount -> sandbox iframe -> sandbox document -> board HTML -> srcdoc -> app. Live on Team (Peter's dashboard session) the sandbox iframe was inserted at ~0.72-1.16 s and the app painted last, after the sidebar, chat pane and a shimmering dashboard skeleton.

Persist the last board snapshot with the session's existing scoped conversation snapshot (same account/host/agent scope, written after the transcript's initial hydration so it never invalidates that read). On warm reload the board provider restores it before hello: the cached snapshot is shape-validated (generated board validator) and must match the session; MCP apps whose grant is pending or rejected are not restored; view-ticket TTLs are aged from their original receipt so expired tickets are not reused. board.get remains authoritative: a fresh snapshot replaces the restored one, FORBIDDEN or definitive unavailability clears the board and the cached copy. Board UI strings move to a board-owned English catalog and the plugin settings-view loader becomes lazy, keeping startup JS under its unchanged cap (325,075 B gzip, 91 B headroom).

Evidence (AWS c7a.4xlarge, 11 interleaved pairs, synthetic dashboard/MCP-app fixture with live-like handshake timing): dashboard app-ready -417.5 ms paired (11/11 faster); hello handling and FCP steady; LoAF median 191 -> 192 ms. Accepted tradeoff: dashboard-page chat catch-up +29 ms paired.

Runtime +255 handwritten LOC plus a 259-line generated board validator. 316 focused + 24 authority tests; full UI 834 files (2 failures reproduce on baseline); exact-head CI green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…rktrees (openclaw#177934)

* fix(update): make validator generation path-independent and allow linked worktrees

Generated control UI validators embedded physical dependency paths, so a
hoisted or global install failed the freshness check. esbuild now minifies
whitespace, dropping those path banners; the TypeBox license is kept and
executable output is unchanged.

The reference-source snapshot rejected a registered linked worktree nested
in the checkout. It now excludes only a positively identified registered
worktree (reciprocal .git, gitdir and commondir identity) and rechecks it
before stopping the Gateway. Unknown nested repositories still refuse.

* chore(ui): regenerate board validators with the path-independent generator

Main's openclaw#178113 regenerated board.js with the previous generator after this branch's base. Regenerating with this branch's generator drops the physical dependency-path banner like the other validators; executable output is unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…ript validation (openclaw#178658)

L158 (openclaw#178113) restores a cached dashboard before hello, but the restore waited on the lazily loaded transcript validator, so on Team the sandbox iframe often attached only after board.get returned (live r173: 776-797 ms in one batch, 505-633 ms in another). Restore the board snapshot independently of transcript validation, after the WebSocket connect request has been sent (a new initialConnectSent signal) so the early dashboard render never lands in the hello-handling window; re-read the cache after that wait and keep every openclaw#178113 safety rule (shape validation, session match, pending/rejected grant filter, ticket TTL aging, board.get authority).

Evidence (AWS c7a.4xlarge, 11 pairs, synthetic dashboard fixture with the transcript validator held): sandbox iframe insertion 808.8 -> 359.3 ms (-450.7 paired, 11/11); hello handling +8.1 ms paired with overlapping IQRs (within the no-regression rule); FCP, LoAF, chat catch-up and chat-route controls unchanged.

Runtime +35 LOC. Full UI 837 files / 3,617 tests (4 opt-in skips); focused tests incl. a held-validator negative control that fails on the original restore; exact-head CI green.
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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant