Skip to content

perf(control-ui): admit warm full-UUID routes from snapshots - #177153

Merged
steipete merged 10 commits into
mainfrom
steipete/coldload-route-binding-from-snapshot
Oct 19, 2026
Merged

steipete merged 10 commits into
mainfrom
steipete/coldload-route-binding-from-snapshot

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A warm reload of an off-roster full-UUID chat deep link waits for sessions.resolve before mounting its cached conversation. The existing host/account/profile-scoped conversation snapshot already identifies that exact UUID and agent, but the operator sees a shell-to-transcript waterfall.

Selected B: immediate snapshot admission. On the final head, B improved transcript-visible paint in 11/11 pairs on both faces: chat 656→384 ms, median paired delta −268 ms; dashboard 636→356 ms, paired −276 ms. FCP median increased 72 ms and 48 ms (paired +72 and +52), within the lead's accepted tradeoff. The first LCP was transcript text in all 22 B reloads; A's first LCP was the shell in all 22.

C (one animation frame followed by a task before admission) does not qualify: chat misses the accepted FCP tradeoff, and dashboard misses the primary gate and FCP tradeoff. C's transcript paint is 246 ms slower than B by paired median. B passes final rows, LoAF blocking, RPC count, and the seven-pair exact-key dashboard control. Board-control FCP rises 4 ms with overlapping IQRs and mixed signs (4 worse, 3 better); the declared no-regression rule treats that as noise.

Change and isolation

Implement the lead's design: admit only a complete UUID (32 hex digits, dashes optional), with the route's exact agent, from the already-started scoped conversation snapshot. Reuse the snapshot owner's validation and the same validated promise for route binding and pane hydration. No new store, persisted field, scope, product setting, or server schema.

Record whether route admission came from the roster or snapshot. Only snapshot admission gets the new automatic revalidation; existing roster and pending-session navigation keep their discovery lifecycle. Keep sessions.resolve authoritative: retain the same key, replace a moved key, or show not-found and remove cached rows. Prefix and slug-only URLs retain their existing behavior; ambiguous-prefix handling is unchanged. chat.startup follows the earlier pane mount. Keep the full input URL until authoritative canonicalization, and retain the validated navigation handoff so canonical navigation sends one resolver request.

Until snapshot-route revalidation settles, the composer remains editable but sending and stored outbox delivery are held by the existing send-admission owner. Empty startup history cannot recreate a deleted or moved cached key. The hold clears on same-key confirmation; replacement routes retain the old pane's hold.

A leaf type module keeps the snapshot contract out of the runtime import cycle. The superseded duplicate record-validation path is removed. Tests cover foreign host/account snapshots, agent/UUID mismatch, prefixes/slugs, deleted and moved sessions, and reconnect during admission; native browser scenarios exercise cached rows before resolution and their removal/replacement afterward.

Bench-only instrumentation tags direct transcript text owners before paint and observes Element Timing renderTime plus LCP time/element identity. It adds no production attribute. RPC accounting retains abandoned attempts from closed sockets without preventing benchmark settlement.

Evidence and predeclared decision

The campaign's EVIDENCE.md records 14 visual states over about 15 seconds, with dashboard content first at 11.75 seconds. In the later signed-in warm dashboard deep-link capture, FCP was about 405 ms, resolve returned at 608 ms, cached rows appeared at 677–689 ms, startup was sent at 673 ms, and final rows appeared at 865–888 ms. These timings identify the resolver-to-pane dependency addressed here; no private capture content is included.

Final common main baseline: 17bef10. Candidate: 0b249f5. The base includes L150/#176696 and L152/#177017. B retains immediate snapshot admission; C adds only the temporary three-line frame/task yield. The final run rebuilds A from main runtime sources and B/C from this candidate, retaining common benchmark instrumentation.

Quiet AWS c7a.4xlarge, 16 CPUs, AMD EPYC 9R14; repository headless Playwright Chromium. Eleven continuous A/B/C triplets per face, same browser per face, identical warm storage restored before every reload. General wire latency 20 ms; resolve/describe latency minimum 195 ms. All samples retained. Same untraced LoAF/RPC probes for all variants. Seven A/B control pairs use a normal exact-key dashboard URL, bypassing UUID admission. Board readiness is a sandbox resource-load milestone, not a presentation timestamp.

Rule declared before measurement:

  • Qualify only when transcript-visible paint beats A in at least 9/11 pairs on both faces with median paired delta below zero.
  • Among qualifiers, prefer the earliest transcript paint; prefer C if B and C are within 30 ms median.
  • Accept an FCP increase up to 100 ms median only when transcript-visible paint improves by at least 150 ms median.
  • LoAF, final rows, RPC count, and board reload retain the campaign rule: regression requires non-overlapping IQRs, or worse in at least 9/11 (6/7) pairs with median rise above max(10 ms, 3%). Count comparisons use zero count tolerance.
View Variant Metric A median [Q1–Q3] Variant median [Q1–Q3] Paired median delta Better / worse
chat B FCP 312.0 [300.0–346.0] 384.0 [374.0–392.0] +72.0 0 / 11
chat B Final rows 946.5 [926.8–1030.7] 727.1 [715.8–737.2] -202.3 11 / 0
chat B LoAF blocking 228.0 [224.0–231.5] 168.0 [154.0–185.0] -61.0 11 / 0
chat B RPC attempts 84.0 [84.0–84.0] 84.0 [84.0–84.0] +0.0 0 / 1
chat B Transcript visible paint 656.0 [632.0–676.0] 384.0 [374.0–392.0] -268.0 11 / 0
chat C FCP 312.0 [300.0–346.0] 348.0 [322.0–542.0] +40.0 4 / 7
chat C Final rows 946.5 [926.8–1030.7] 833.1 [787.1–860.5] -161.0 10 / 1
chat C LoAF blocking 228.0 [224.0–231.5] 218.0 [203.5–249.5] -13.0 8 / 3
chat C RPC attempts 84.0 [84.0–84.0] 84.0 [84.0–84.0] +0.0 1 / 1
chat C Transcript visible paint 656.0 [632.0–676.0] 620.0 [550.0–642.0] -64.0 11 / 0
dashboard B FCP 308.0 [298.0–316.0] 356.0 [352.0–360.0] +52.0 0 / 11
dashboard B Final rows 971.3 [916.6–1039.7] 752.2 [747.1–765.5] -221.2 11 / 0
dashboard B LoAF blocking 252.0 [228.5–266.0] 170.0 [161.5–178.0] -63.0 10 / 1
dashboard B RPC attempts 82.0 [82.0–82.0] 82.0 [82.0–82.0] +0.0 0 / 1
dashboard B Transcript visible paint 636.0 [614.0–650.0] 356.0 [352.0–360.0] -276.0 11 / 0
dashboard C FCP 308.0 [298.0–316.0] 352.0 [324.0–458.0] +44.0 3 / 8
dashboard C Final rows 971.3 [916.6–1039.7] 889.5 [835.8–915.3] -92.8 9 / 2
dashboard C LoAF blocking 252.0 [228.5–266.0] 217.0 [204.0–233.5] -35.0 8 / 3
dashboard C RPC attempts 82.0 [82.0–82.0] 82.0 [82.0–82.0] +0.0 1 / 2
dashboard C Transcript visible paint 636.0 [614.0–650.0] 624.0 [522.0–636.0] -20.0 6 / 5

Times are milliseconds; RPC attempts are counts. Quartiles use the inclusive method.

All eleven paired deltas, variant minus A

chat B

  • FCP: +72.0, +92.0, +84.0, +76.0, +76.0, +48.0, +44.0, +32.0, +60.0, +40.0, +76.0
  • Final rows: -345.2, -308.5, -187.6, -272.7, -310.7, -190.4, -202.3, -168.1, -416.0, -157.2, -147.6
  • LoAF blocking: -48.0, -77.0, -86.0, -77.0, -60.0, -53.0, -5.0, -55.0, -68.0, -61.0, -76.0
  • RPC attempts: +1.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0
  • Transcript visible paint: -268.0, -252.0, -308.0, -236.0, -252.0, -264.0, -284.0, -280.0, -248.0, -320.0, -320.0

chat C

  • FCP: +240.0, +260.0, +256.0, +244.0, +248.0, -68.0, -68.0, -48.0, +28.0, -16.0, +40.0
  • Final rows: -267.9, -246.4, -171.9, -161.0, -240.8, -81.3, -96.3, -21.3, -228.6, +89.0, -77.8
  • LoAF blocking: +5.0, +54.0, +143.0, -13.0, -23.0, -35.0, -33.0, -6.0, -20.0, -10.0, -23.0
  • RPC attempts: +0.0, +0.0, +48.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, +0.0, -8.0
  • Transcript visible paint: -100.0, -84.0, -136.0, -68.0, -80.0, -20.0, -36.0, -16.0, -4.0, -64.0, -44.0

dashboard B

  • FCP: +16.0, +40.0, +80.0, +52.0, +56.0, +56.0, +80.0, +52.0, +28.0, +32.0, +48.0
  • Final rows: -179.8, -274.9, -208.5, -159.3, -426.4, -6.1, -238.8, -221.2, -501.4, -119.9, -249.0
  • LoAF blocking: -92.0, -63.0, -41.0, -97.0, -65.0, +40.0, -104.0, -50.0, -326.0, -55.0, -49.0
  • RPC attempts: +0.0, +0.0, +0.0, +0.0, +0.0, +8.0, +0.0, +0.0, +0.0, +0.0, +0.0
  • Transcript visible paint: -276.0, -252.0, -280.0, -292.0, -256.0, -252.0, -296.0, -308.0, -464.0, -260.0, -260.0

dashboard C

  • FCP: +8.0, -36.0, +68.0, +220.0, +216.0, -8.0, +244.0, +100.0, -24.0, +28.0, +44.0
  • Final rows: -74.3, -91.2, +21.8, -100.0, -277.1, -17.2, -168.7, -172.3, -362.0, +55.8, -92.8
  • LoAF blocking: -35.0, -28.0, +171.0, -62.0, +46.0, -65.0, -36.0, -54.0, -266.0, -8.0, +5.0
  • RPC attempts: +0.0, +0.0, +45.0, +0.0, -8.0, +8.0, +0.0, +0.0, +0.0, +0.0, +0.0
  • Transcript visible paint: +72.0, +16.0, -20.0, -124.0, -96.0, +12.0, -132.0, -260.0, -176.0, +28.0, +28.0

LCP corroboration

View Variant First LCP median Last LCP median First LCP is transcript Last LCP elements
chat A 312.0 656.0 0/11 {'p': 11}
chat B 384.0 384.0 11/11 {'p': 11}
chat C 348.0 620.0 5/11 {'p': 11}
dashboard A 308.0 636.0 0/11 {'p': 11}
dashboard B 356.0 356.0 11/11 {'p': 11}
dashboard C 352.0 624.0 4/11 {'p': 11}

Exact-key dashboard control (seven pairs)

Metric A median [Q1–Q3] Selected median [Q1–Q3] Paired median delta Better / worse
FCP 352.0 [346.0–376.0] 356.0 [356.0–358.0] +4.0 3 / 4
Final rows 726.4 [719.2–740.2] 729.2 [718.2–733.3] -8.0 4 / 3
LoAF blocking 212.0 [199.5–228.0] 196.0 [187.0–211.0] -10.0 4 / 3
RPC attempts 81.0 [81.0–81.0] 81.0 [81.0–81.0] +0.0 1 / 0
Board ready 1332.5 [1326.3–1350.7] 1300.5 [1288.2–1373.2] -21.6 4 / 3

Per-pair control deltas:

  • FCP: +4.0, +8.0, -20.0, +16.0, +8.0, -12.0, -20.0
  • Final rows: +15.3, +33.9, +4.5, -22.7, -41.5, -8.7, -8.0
  • LoAF blocking: +8.0, -153.0, -23.0, -10.0, +7.0, +5.0, -26.0
  • RPC attempts: +0.0, -44.0, +0.0, +0.0, +0.0, +0.0, +0.0
  • Board ready: +47.9, -21.6, +23.6, -78.8, -39.8, +46.0, -49.8

Decision: {"qualified": ["B"], "selected": "B", "boardCandidate": "B", "medianPairedCMinusB": 246.0, "cMinusB": [168, 168, 172, 168, 172, 244, 248, 264, 244, 256, 276, 348, 268, 260, 168, 160, 264, 164, 48, 288, 288, 288], "boardPass": true}.

Validation

Final-head performance gates pass on AWS c7a.4xlarge lease cbx_9168455f3ae9 (run). Exact-head CI run 39270828753 is green for 0b249f56ca0aa39748157ec966f0473930b0100e.

Focused route/snapshot/consumer tests, import-cycle checks, all 17 changed test files individually, and the 19-test native group pass. The full UI e2e suite passes: 835 files / 3,613 tests, four existing skips, no failures (--maxWorkers=2, 5,475 seconds). This includes warm reload, session switching, deleted-session routes, pending session creation, auth/reconnect, boot module boundaries, and real-Gateway chat loading. No full-suite waiver was used. Existing opt-in skips: desktop-resize.real-gateway, peer-followup-restart.real-gateway, chat-steer-deferred-custody.real-gateway, and deepseek-search.real-gateway.

The chat boot JS check passes against the main baseline, which includes L150/#176696: 1,447,520→1,448,295 B gzip (+775 B), 24 requests unchanged, 51,705 B headroom. New Session: 1,005,108→1,005,464 B (+356 B), 19 requests unchanged, 44,536 B headroom. CSS is unchanged. The changed-file check passes core/UI/scripts types, formatting, lint, import/controller guards, and dead exports; only the max-lines suppression ratchet and core test-root budget fail. Both failures reproduce unchanged on pinned main: existing max-lines suppressions in chat-message.test.tsx, config-page-state.ts, and sessions-page-state.ts; core test-root counts are gateway 724 and plugins/platform 725 against 720. These are inherited, not failures introduced by this diff.

Per-file test wall time (one worker, AWS)

Each unit/browser file ran as pnpm test <file> --maxWorkers=1; the native file used node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts <file> --maxWorkers=1.

Test file Wall seconds
app/session-route-recovery 3.26
e2e/chat-snapshot-route 29.61
pages/chat/chat-history-observation 5.43
pages/chat/chat-history-warm-startup 4.29
pages/chat/chat-page-snapshot-custody 4.53
pages/chat/chat-route-write-readiness 2.68
pages/chat/chat-send-readiness 3.21
pages/chat/route-snapshot 2.70
pages/chat/route-warm-boot 2.41
pages/chat/session-message-cache 2.50
pages/chat/session-prefetch-lifecycle 3.06
pages/chat/session-prefetch 3.16
pages/chat/session-snapshot-prewarm 2.85
pages/chat/session-snapshot-store 3.02
pages/chat/session-snapshot-write 2.90
test-helpers/control-ui-cold-load-probes.browser 2.76
test-helpers/control-ui-transcript-paint.browser 2.78

Paths are under ui/src/; suffixes are .test.ts, with .e2e.test.ts for the native file.

The write-readiness repair has a red/green regression: the old head enables Send during held route resolution in all three same/deleted/moved scenarios; the patched native suite passes all six snapshot-route scenarios. A focused test also proves stored outbox hold/resume after startup.
The broad prior-head sweep caught an introduced pending-session regression. Automatic revalidation was too broad: a roster-admitted Incognito creation could be revalidated while its startup was still pending. The final repair distinguishes roster from snapshot admission, restores the existing roster lifecycle, and removes the superseded navigation workaround. The added lifecycle regression fails before the repair; 44 focused tests and all 8 cloud-startup cases pass afterward.

The baseline native browser regression fails at the missing cached-text wait while resolution is held. The Element Timing browser regression proves opacity-hidden nested text does not count until shown. Autoreview is clean through P2 on the final committed head.

Automated-review clarification: the existing delayed-delivery behavior does not let retired transport frames mutate the application. The shared protocol client's message handler rejects an inactive socket/generation or aborted connection before parsing. The queued callback can still reach the browser adapter, but application frame processing stops at that guard. The close hook retires pending probe accounting; no extra transport policy was added.

Prior-head red/green validation used lease cbx_74f7477e962d, now released. The later lease cbx_16171d806e67 was also released when main introduced a benchmark conflict; the final comparison and validation used the fresh lease linked above. All owned leases are now released. No merge requested. This supersedes closed experiment #177101, which GitHub would not reopen after the branch rewrite.

Size

Requested non-test/non-doc stat: 393 insertions, 60 deletions; net +333 LOC across 23 files. Application runtime: +128 LOC; benchmark/probe tooling: +205 LOC; tests: +477 LOC; docs: 0. Growth implements exact-identity/scope admission, authoritative after-hello replacement, pending-route send admission, and reproducible paint measurement. The duplicate snapshot read/validation path is removed, and route/pane reuse the validated snapshot promise.

Reproduction

Build A from the pinned main, B from this branch, and C from B with the following temporary insertion immediately after readPrewarmedChatSnapshot(...) in findSnapshotSessionReference:

if (admitted) {
  await new Promise<void>((resolve) => requestAnimationFrame(() => setTimeout(resolve, 0)));
}

Then run with the three prebuilt directories and the campaign's common probes:

node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts \
  --runs 33 --untraced --warm-reload --full-uuid-route --face chat \
  --latency-ms 20 --frame-gap-ms 0 \
  --method-latency-ms sessions.resolve=195 \
  --method-latency-ms sessions.describe=195 \
  --probe-dir <probes> --bundle-dir <A> \
  --compare-bundle-dir <B> --compare-bundle-dir <C>

Repeat with --face dashboard. The seven-pair control uses --runs 14 --face dashboard, omits --full-uuid-route, and compares only A and B. Each invocation prewarms the supplied bundles, then restores identical saved IndexedDB/localStorage state before every reload.

The paired images below use the pinned main bundle and final candidate with the same synthetic conversation and held route resolution.

Before: main waits for route resolution with a synthetic cached conversation

After: cached synthetic conversation appears while route resolution is held

@clawsweeper

clawsweeper Bot commented Oct 19, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T14:43:42.992047Z 0b249f5 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: L labels Oct 19, 2026
@steipete
steipete force-pushed the steipete/coldload-route-binding-from-snapshot branch 2 times, most recently from 1d898f5 to ccd4cb6 Compare October 19, 2026 09:05

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

ℹ️ 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".

socket.addEventListener(
"close",
() => {
for (const [id, request] of pending) {

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 Drop delayed frames after their socket closes

When a frame is waiting in the artificial latency timer and its socket closes first—especially with --method-latency-ms—this handler deletes the request and records it as abandoned, but the already-scheduled callback still executes dispatch(event). The browser socket adapter keeps its message listener attached, so the application processes a frame from a closed transport while the benchmark reports its RPC as abandoned, contaminating reconnect measurements; cancel or suppress queued deliveries belonging to the closed socket.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-route-binding-from-snapshot branch from ccd4cb6 to f29d036 Compare October 19, 2026 09:15
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR renders matching cached full-UUID conversations before route resolution and extends the benchmark to compare warm-reload paint.

Example: Reload /chat/main/b1c2cd3c-1234-4321-9876-123456789abc with a matching scoped snapshot outside the cached roster.

  • Before: The conversation remains a loading skeleton until sessions.resolve answers.
  • After: Cached messages appear while the Gateway resolves the link, then reconcile with its authoritative answer.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The visible improvement is supported and source review found no definite introduced defect, but the failed exact-head CI gate leaves validation unresolved.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected before/after browser screenshots show the changed cached-rendering behavior, supported by synthetic Chromium paint measurements and reported deleted/moved-route scenarios.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: A warm full-UUID conversation reload shows a skeleton while waiting for route resolution despite already having its scoped transcript.
Reason: The maintainer-authored direction records measurable transcript-paint improvements and explicitly accepts the FCP tradeoff.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed optimization addresses a verified loading waterfall, and no introduced correctness defect was established; exact-head CI remains blocked by an unexplained attachment-menu test failure.

Priority: P2
Reviewed head: f29d0365a7d4bb67d209261ec34e01b7596e9b18

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI route loader consumes browser snapshots scoped to the Gateway and account, mounts the selected conversation, and reconciles its identity through the existing Gateway resolver.

flowchart TD
  A[Full UUID URL] --> B[Route loader]
  C[Scoped browser snapshot] --> D[Snapshot validator]
  D --> B
  B --> E[Cached conversation]
  B --> F[Gateway resolver]
  F --> E
Loading

Technical review

Best possible solution:

Render exact scoped snapshots immediately while retaining the existing snapshot validator and Gateway resolver as the sole owners of validation and authoritative identity.

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

The baseline loader waits for network resolution when an exact cached conversation is outside the roster; the inspected baseline screenshot and reported red browser regression corroborate that path.

Is this the best way to solve the issue?

The implementation removes the route waterfall using existing snapshot and recovery owners, shares validation with the pane, and preserves authoritative replacement without introducing another persistent cache.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0293f8f81385.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduction and current-main behavior: The introduced diff adds snapshot admission before roster settlement and network resolution; fetched main retains the resolver-first path for this off-roster case. (ui/src/pages/chat/route-loader.ts:485, f29d0365a7d4)
  • Exact identity and scope checks: Admission requires a complete UUID, matching agent, matching existing snapshot scope, successful owner validation, and an unchanged connection revision. (ui/src/pages/chat/route-loader-short-cache.ts:29, f29d0365a7d4)
  • Authoritative replacement: Cached admission triggers route revalidation after connection; the loader bypasses snapshot shortcuts during revalidation and handles missing or changed session identities. (ui/src/app-routes.ts:321, f29d0365a7d4)
  • Existing storage contract preserved: The shared validated promise changes runtime read ownership; snapshot fields, projection version, database version, and serialization remain unchanged, establishing a no-migration case. (ui/src/pages/chat/session-snapshot-store.ts:189, f29d0365a7d4)
  • Inspected visual evidence and accepted tradeoff: The complete PR body matches captured SHA-256 9418e3d34b6cb542965c4b440f2315d1f10c402cb8711e4bce2c5719148dc593. Both linked screenshots were visually inspected: the baseline shows a skeleton and the candidate shows cached transcript text. The maintainer-authored body explicitly accepts increased FCP for earlier transcript paint and reports synthetic Chromium comparisons. (f29d0365a7d4)
  • Earlier delayed-frame concern not sustained: The concern at perf(control-ui): admit warm full-UUID routes from snapshots #177153 (comment) correctly observes delayed dispatch, but the production protocol client rejects retired-socket messages before parsing or publishing them; the claimed application-state corruption is therefore not established. (packages/gateway-client/src/protocol-client.ts:429, f29d0365a7d4)

Likely related people:

  • Peter Steinberger: Raw commit 0e7f8c9 adds ui/src/pages/chat/session-snapshot-store.ts:73 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0e7f8c9ce963; files: ui/src/pages/chat/session-snapshot-store.ts)
  • Shakker: Raw commit cf45dcd adds ui/src/pages/chat/session-message-cache.ts:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: cf45dcd07e51; files: ui/src/pages/chat/session-message-cache.ts)

PR surface

Source +110, Tests +392, Docs 0, Other +166. Total +668 across 28 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 9 153 43 +110
Tests 16 408 16 +392
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 179 13 +166
Total 28 741 73 +668

Review metrics

Metric Value Why it matters
Benchmark configuration 5 benchmark-only CLI options Bundle comparison, method latency, face selection, short routes, and full-UUID routes support reproducible measurement without adding product settings.

Labels

Label changes:

  • add P2: This improves warm conversation loading with limited user impact and no established urgent regression.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This improves warm conversation loading with limited user impact and no established urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Establish whether the attachment-menu failure also occurs on the base, or repair a demonstrated head regression.

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 19, 2026, 5:32 AM ET / 09:32 UTC.

@steipete
steipete force-pushed the steipete/coldload-route-binding-from-snapshot branch from f29d036 to 5321b21 Compare October 19, 2026 11:38

@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: 5321b21de9

ℹ️ 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".

agentId: snapshot.agentId,
...sessionRouteHints(routeLocation),
face,
sessionResolutionFromCache: "snapshot",

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.

P1 Badge Gate sends until snapshot routes are revalidated

When sessions.resolve is slow and the cached route refers to a deleted or moved session, this returns a normal session route while revalidation runs asynchronously after commit. Nothing carries the pending validation state into ChatPane, so after chat.startup commits the composer can become enabled; because the Gateway explicitly marks chat.send as mayCreate (src/gateway/session-method-policy.ts:26), sending during this window can create or run against the stale key before the route changes to moved/not-found. Keep writes disabled until the authoritative revalidation succeeds.

AGENTS.md reference: AGENTS.md:L65-L65

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-route-binding-from-snapshot branch from 5321b21 to 703a192 Compare October 19, 2026 13:11

@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: 703a192eea

ℹ️ 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 thread ui/src/app-routes.ts
Comment on lines +386 to +387
revalidatedCache.add(target.abortController);
void verifyReconnectedSession(target, false);

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 Retry snapshot validation after transient failures

When the initial sessions.resolve revalidation for a snapshot-admitted full-UUID route rejects while the connection remains up, this controller is recorded in revalidatedCache before the attempt and the error is swallowed below. No successful replacement clears sessionResolutionFromCache, so the composer and stored outboxes remain gated, while subsequent router publications will not retry validation for this controller; the conversation stays read-only until a reload or reconnect. Mark the controller only after authoritative validation succeeds, or remove/schedule it for retry on failure.

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

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-route-binding-from-snapshot branch from 703a192 to 0b249f5 Compare October 19, 2026 14:38
@steipete

Copy link
Copy Markdown
Contributor Author

Final proof is updated for 0b249f56ca0aa39748157ec966f0473930b0100e: exact-head CI is green; full UI e2e passed 835 files / 3,613 tests (four existing opt-in skips). The PR body contains the final 11-triplet paint comparison, seven-pair board control, matching synthetic screenshots, isolation regressions, and main reproduction of both inherited changed-check failures.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 0d95528 into main Oct 19, 2026
134 of 135 checks passed
@steipete
steipete deleted the steipete/coldload-route-binding-from-snapshot branch October 19, 2026 16:53
steipete added a commit that referenced this pull request Oct 19, 2026
…ns.resolve (#177760)

Revert the runtime part of #177153 (0d95528). It rendered a cached full-UUID chat route from the prewarmed snapshot before sessions.resolve, which won on the bench but regressed live: on Team r170 (Peter's 820-message session, 3 warm reloads) the snapshot-admitted pane mounted in one 157-190 ms task right as the WebSocket connect response arrived, so connect was handled at 619-632 ms instead of 386-425 ms (9 runs on r164-r167) and every post-hello RPC shifted ~230 ms. First rows moved slightly earlier (586-710 vs 655-778 ms), but final rows went 822-998 -> 976-1,161 ms and LoAF blocking 96-131 -> 185-227 ms. Board connect RTT was unchanged, so the cost was client-side. The bench had missed it because its handshake finished before the mount.

The fix-forward attempt (mount after hello with a bounded wait, #177759) kept a 152 ms painted-transcript gain but regressed chat final rows +44.6 ms in 9/11 pairs and was rejected by its pre-declared gate, so the pre-declared fallback lands.

Benchmark tooling and probes added by #177153 (paint/element timing, per-method latency, short URLs) are kept. Runtime -127 LOC. 286 focused tests, typecheck/lint, 8 warm-boot tests, full UI 831 files (remaining Crabline permission failure reproduces on main); exact-head CI green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
….resolve (openclaw#177153)

On a warm reload of a chat link for a session that isn't in the cached sidebar roster, the route loader waited for sessions.resolve before mounting the pane, so the cached transcript appeared roughly 280 ms after the shell. Live on Team (Peter's 820-message session, r164) resolve returned at ~608 ms and cached rows followed at 677-689 ms while FCP was ~405 ms.

When the link carries a full session UUID (32 hex, no prefix ambiguity), admit the route from the already-prewarmed conversation snapshot whose key has exactly that UUID and agent, under the snapshot owner's existing account/host scope key (re-checked after the read, together with the connection revision). Render the cached rows immediately; sessions.resolve stays authoritative: the router revalidates snapshot-admitted routes once after hello, and a deleted, moved or mismatched session is replaced exactly like a roster-admitted route. Sends and restored queued sends are held (draft kept) until the route is confirmed. Short-prefix, slug-only and ambiguous links are unchanged. No new store, persisted field or cache scope.

Evidence (AWS c7a.4xlarge, 11 interleaved triplets per face, element-timing paint of the first transcript row): painted transcript chat 656 -> 384 ms, dashboard 636 -> 356 ms (11/11 each). Pre-declared accepted tradeoff: FCP +72 / +48 ms because the first paint now contains the transcript (allowed up to +100 ms when transcript paint improves >= 150 ms). A shell-first one-frame-yield variant failed qualification. Final rows and LoAF blocking improve; RPC counts unchanged; 7-pair board control passes.

Runtime +128 LOC. Full UI 835 files / 3,613 tests; focused regressions for same/deleted/moved authority, held sends, reconnect during admission and router revalidation; exact-head CI green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…ns.resolve (openclaw#177760)

Revert the runtime part of openclaw#177153 (6d343c3). It rendered a cached full-UUID chat route from the prewarmed snapshot before sessions.resolve, which won on the bench but regressed live: on Team r170 (Peter's 820-message session, 3 warm reloads) the snapshot-admitted pane mounted in one 157-190 ms task right as the WebSocket connect response arrived, so connect was handled at 619-632 ms instead of 386-425 ms (9 runs on r164-r167) and every post-hello RPC shifted ~230 ms. First rows moved slightly earlier (586-710 vs 655-778 ms), but final rows went 822-998 -> 976-1,161 ms and LoAF blocking 96-131 -> 185-227 ms. Board connect RTT was unchanged, so the cost was client-side. The bench had missed it because its handshake finished before the mount.

The fix-forward attempt (mount after hello with a bounded wait, openclaw#177759) kept a 152 ms painted-transcript gain but regressed chat final rows +44.6 ms in 9/11 pairs and was rejected by its pre-declared gate, so the pre-declared fallback lands.

Benchmark tooling and probes added by openclaw#177153 (paint/element timing, per-method latency, short URLs) are kept. Runtime -127 LOC. 286 focused tests, typecheck/lint, 8 warm-boot tests, full UI 831 files (remaining Crabline permission failure reproduces on main); exact-head CI green.
steipete added a commit that referenced this pull request Oct 22, 2026
….resolve, off the hello window (#179701)

On a warm reload of a full-UUID chat link for a session outside the cached sidebar roster (Peter's sessions on Team), the transcript waited for sessions.resolve before the pane mounted. An earlier attempt (#177153) rendered the cached transcript first but its single mount landed on the WebSocket connect response and was reverted (#177760).

Admit the route from the account/host-scoped prewarmed snapshot only for an exact full-UUID + agent match (scope key and connection revision re-checked after the read), schedule the cached pane mount after the connect request is sent and split it so no task lands in the hello window, and keep sessions.resolve authoritative (deleted, moved or mismatched sessions are replaced). Composer sends and restored queued sends are held until the route is confirmed; other mutations stay server-authorized by session key, ID or view ticket and fail safely on a deleted/moved session (see "Write hold scope" in the PR). Saved agent selection is restored after roster hydration so a fresh shell reopening the canonical global session lands on the selected agent (regression test; the old head reproduced the failure, 0/30 on the final head and base).

Evidence (AWS c7a.4xlarge, 11 interleaved triplets): transcript paint 1,112 -> 860 ms (11/11), final rows 1,279 -> 1,119 ms, LoAF 240 -> 208 ms, FCP flat. Accepted tradeoff: hello handling +15.6 ms paired, which does not cascade (final rows improve in the same runs). Live rule: revert if Team's live final rows or hello regress materially.

Runtime +163 LOC; startup gzip 325,800 -> 325,703 B. 179 unit and 34 focused e2e tests; full UI 842 passed (QA-lab failure reproduces on base; two intermittent color assertions - a sidebar hover reference captured mid-transition and a theme-change color read - did not differ meaningfully between head and base in paired replays and passed in CI); exact-head CI green.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
….resolve, off the hello window (openclaw#179701)

On a warm reload of a full-UUID chat link for a session outside the cached sidebar roster (Peter's sessions on Team), the transcript waited for sessions.resolve before the pane mounted. An earlier attempt (openclaw#177153) rendered the cached transcript first but its single mount landed on the WebSocket connect response and was reverted (openclaw#177760).

Admit the route from the account/host-scoped prewarmed snapshot only for an exact full-UUID + agent match (scope key and connection revision re-checked after the read), schedule the cached pane mount after the connect request is sent and split it so no task lands in the hello window, and keep sessions.resolve authoritative (deleted, moved or mismatched sessions are replaced). Composer sends and restored queued sends are held until the route is confirmed; other mutations stay server-authorized by session key, ID or view ticket and fail safely on a deleted/moved session (see "Write hold scope" in the PR). Saved agent selection is restored after roster hydration so a fresh shell reopening the canonical global session lands on the selected agent (regression test; the old head reproduced the failure, 0/30 on the final head and base).

Evidence (AWS c7a.4xlarge, 11 interleaved triplets): transcript paint 1,112 -> 860 ms (11/11), final rows 1,279 -> 1,119 ms, LoAF 240 -> 208 ms, FCP flat. Accepted tradeoff: hello handling +15.6 ms paired, which does not cascade (final rows improve in the same runs). Live rule: revert if Team's live final rows or hello regress materially.

Runtime +163 LOC; startup gzip 325,800 -> 325,703 B. 179 unit and 34 focused e2e tests; full UI 842 passed (QA-lab failure reproduces on base; two intermittent color assertions - a sidebar hover reference captured mid-transition and a theme-change color read - did not differ meaningfully between head and base in paired replays and passed in CI); 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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L 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