Repository navigation
perf(control-ui): admit dashboard reloads through the early Gateway handoff - #189762
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets literal dashboard links use the existing early Gateway connection and subscription handoff. Example: Reload /dashboard/main/dashboard/proof.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open: current main still excludes dashboard routes, and the focused change preserves the existing startup owners with no actionable code defect found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe browser entry point resolves connection settings and the route, starts an eligible Gateway transport, and hands its authenticated connection and buffered subscription to the application. flowchart LR
A[Browser entry point] --> B[Startup settings and route]
B --> C[Existing credential owner]
C --> D[Early Gateway transport]
D --> E[Gateway authentication]
E --> F[Bounded subscription handoff]
F --> G[Application and dashboard]
Technical reviewBest possible solution: Retain the single-condition change and existing handoff owners if the declared isolated performance gates pass. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically excludes literal dashboard routes from early startup; no target code was executed during this read-only review. Is this the best way to solve the issue? Removing the namespace restriction is the smallest complete implementation: both route namespaces share parsing, credential preparation, transport adoption, and subscription ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0022746e539c. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +42, Other +2. Total +44 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 5:16 PM ET / 21:16 UTC. |
db9f643 to
02f405f
Compare
02f405f to
c23d0ae
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…andoff (openclaw#189762) Literal dashboard routes now use the existing early Gateway connection and subscription handoff instead of waiting for ordinary application startup. The native, pending-confirmation, document-ownership and relay guards are unchanged, and non-literal dashboard routes stay with their resolver. Dashboard warm reload hello 570.4 -> 468.2 ms (paired -96.9 ms, 11/11 better); chat untouched; accepted dashboard CLS +0.000287. Runtime LOC 0.
Status: ready
A is accepted for landing, including its negligible dashboard CLS tradeoff. Dashboard hello improves in 11/11 pairs, 570.42→468.20 ms, paired median −96.88 ms [−182.18, −60.44]. The former maximum-absolute-A/A clearance requirement is withdrawn for this consistent effect.
Dashboard CLS increases by a paired median +0.000287 (8/11 worse), approximately 0.0003 and below 0.001; this is an accepted tradeoff. A/A paired CLS range was [−0.002341, +0.000267]. Chat is untouched by this change; its measured variation is A/A-like noise. Final-head CI is green; standalone validation findings are classified below. This PR stops at ready review and will not be merged by this lane.
What Problem This Solves
Literal dashboard deep links skip the early Gateway handoff and begin their connection after more application startup work. Chat links already overlap that handoff with startup. The campaign's original evidence counted 14 visible states during a signed-in reload of a dashboard deep link; this change addresses its delayed handshake admission.
Why This Change Was Made
Remove only the chat-namespace restriction. Literal chat and dashboard routes use the existing credential owner, full session key,
chat.startuphistory parameters, bounded event handoff, and adoption checks. Short/main references still wait for their resolver; confirmation-required endpoints, native startup and non-workspace documents keep their existing startup owner. No identity/signer preload or runtime configuration, protocol, cache or storage change.History: the restriction was introduced with the chat-scoped optimization in #185683 (
4420648c4046). Its comment protects short references, native handoffs, confirmation and route replacement; those independent guards are retained. No dashboard-specific authority or scope invariant was found. The existing handoff rechecks URL and credentials at adoption.B stays dropped: live connection/route confirmation enables the favicon fetcher, changing settled message
linkFaviconsfrom false to true and adding actual favicon placeholders. That is a legitimate markup input change. Suppressing the preparation as redundant would be incorrect; this PR does not change it.User Impact
Dashboard reloads begin their Gateway handshake earlier while preserving cached views, authentication and route resolution. Chat continues through its existing early handoff and startup sequence; there is no change to chat rendering or requests. Cached page restoration keeps its existing ordering, including #185558's accepted earlier cached-row paint / later hello tradeoff. No application WebSocket request is sent before successful connect receipt.
Evidence
The accepted comparison uses a synthetic signed-in 3,000-session fixture matching the campaign's archived targets/sidebar preferences; one quiet AWS c7a.4xlarge; the same built Gateway for both UI arms; an 80 ms CDP network profile (not calibrated per-RPC wire RTT); 11 interleaved warm pairs on chat and dashboard plus an 11-pair A/A control. Unprofiled results only. No absolute historical hello budget applies.
Performance proof was recorded before the mechanical rebase: UI baseline
828b81ad1f94, candidate02f405f70530, AWS Crabboxcbx_1d63caee9630, actual c7a.4xlarge (16 CPUs), Chromium 156.0.8078.4. The production patch and owner files remain unchanged on the final validation head. Both UI arms used the same built Gateway. Quiet-host CPU idle was 92.41% for A/A and 93.48% for A/B. No CPU profiler ran during comparisons.Accepted performance result: dashboard hello 570.42→468.20 ms, better in 11/11 pairs; paired median −96.88 ms [−182.18, −60.44]. The earlier maximum-absolute-A/A clearance rule is withdrawn for this consistent effect. A/A hello paired range was [−105.03, +87.56] ms, median +5.18 ms, IQR [−44.62, +51.47] ms. Candidate paired IQR is separated from the control paired IQR.
Chat is untouched by this change: it keeps its existing early handoff and startup sequence. Chat hello paired delta −4.81 ms (6 better / 5 worse) and other chat results are A/A-like noise, not a claimed chat improvement.
Accepted CLS tradeoff: dashboard CLS paired median increases by 0.00028717 (8/11 worse), approximately 0.0003 and below 0.001. A/A paired CLS range is [-0.00234068, 0.00026723], with median -0.00011550. The increase is retained and explicitly accepted as negligible.
Dashboard FCP paired median −17.12 ms (9/11 better), first ElementTiming row paint −16.07 ms (9/11 better), and LoAF −19.20 ms (6 better / 5 worse) accompany the handshake gain.
All values are milliseconds except CLS; brackets are [Q1,Q3]. Paired delta is candidate minus its paired baseline, which differs from subtracting the independent arm medians. Lower is better. Better/worse counts omit ties. No pairs were removed. ElementTiming and DOM readiness do not establish complete-page pixel-firstness.
chat
A/A control: identical baseline assets, same box/rig, 11 interleaved pairs.
All A/A per-pair deltas
dashboard
A/A control: identical baseline assets, same box/rig, 11 interleaved pairs.
All A/A per-pair deltas
Connection phases
Native open-event delivery and renderer send/receipt timestamps include event-loop scheduling. These intervals locate the wait; they are not function-level CPU attribution. B is unchanged.
The phase decomposition shows where event-loop waits change as the handshake overlaps startup. The accepted cached-render ordering is retained.
Transport audit: 96/96 loads (including cold setup/control loads) have one socket, one successful connect receipt, and zero application sends before that receipt, checked at both the page send boundary and native wire timestamps. No missing required final regions or browser-error loads. One candidate dashboard capture (warm pair 9) changed visually within the final second of its eight-second observation window; it is marked visually censored and retained in all tables. No complete visual-settling claim is made.
Retained raw-report SHA256:
1fa4c53be6274bfe23dce4e51dc0c6d68e3b28d8afbe1e56f251c933856b8cdd158229559b7ba509cfaef3bc8277004e6feff9fa16ee6c0362eae07efde544c6Proof
Final validation head:
c23d0ae518fefed39c5701f5dfa39aa5f02cb6de, rebased onto79ef1c6d17e04545a3d39eee300e086c4ae2ab8b. The production patch remains byte-identical to the accepted measurement patch.git diff --checkpasses.cbx_0ad5ab15f152:corepack pnpm test ui/src/app/early-gateway.test.ts --maxWorkers=1passes 12/12, command wall 8.44 seconds. Focused gateway-boot, gateway-preconnect and connection-bootstrap consumers pass 3 files / 26 tests.node scripts/check-changed.mjs --base 79ef1c6d17e04545a3d39eee300e086c4ae2ab8b: formatting, all ratchets, core-test/UI typechecks, core lint and script lint pass. The command exits 1 solely for the untouchedMAX_DATABASE_SNAPSHOT_EXTRACT_BYTESexport insrc/commands/backup-verify-spool.ts; the same export fails on the main control below. No skip flag was used.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.tscompleted 886 files: 877 passed, 6 failed, 3 skipped; 3,335 tests passed, 2 failed, 17 skipped (4,823.38 seconds). Route coverage passed, including boot/module boundaries (18), warm boot (10), initial-connect splash (19), shell routing (1), snapshot admission (10), dashboard cold load (2), session-dashboard (5) and dashboards-list-demand (4).e515a095c5b588fb5d2e708cec5b47cfab7b79a2, on the same AWS lease. Both reproduce the matching failure below. The full-suite attempt remains recorded as failed; all its findings are accounted for.c23d0ae518fefed39c5701f5dfa39aa5f02cb6de. There are no CI reds to classify.MAX_DATABASE_SNAPSHOT_EXTRACT_BYTESchat-outbox-migration.e2e.test.tscontrol-ui-automation-management.real-gateway.e2e.test.tsValidation receipts are retained locally; candidate and control tracked source remained clean. No owned Gateway listener remained in ports 19600–19699 after validation. Validation lease
cbx_0ad5ab15f152is released with cleanup complete; the measurement lease was released earlier.Warm-cache records confirm 97 groups / 102 section-order entries, category grouping, created sorting and five collapsed sections for both arms/routes. Both targets are archived; involving-me, empty groups always, previews disabled and pinned rows use the same fixture. All 96 measurement loads satisfy the successful connect-first transport invariant. One candidate dashboard capture changed visually within the last second of the observation window; it remains included in all tables. No complete-page settling claim is made.
Runtime LOC delta: 0 net (one condition simplified). The requested non-test diff is +2 net, entirely the exact regression-budget allocation record. Test delta is +42 LF; the allocation grants exactly 42 for distinct route/history/ordering regressions, with no shared scalar increase or slack. No runtime growth, new owner or superseded machinery retained.
Files:
ui/src/app/early-gateway.ts,ui/src/app/early-gateway.test.ts,config/test-lines-allocations/control-ui-early-dashboard.txt.Visual Before / After
Inspected synthetic-only benchmark captures from the recorded pre-rebase comparison, after the fixed observation window. These show retained layout/content; they do not establish first-frame completeness. Timing evidence and the visually censored capture are described above.