Skip to content

fix: recover the Control UI promptly after brief network drops - #189141

Merged
steipete merged 3 commits into
mainfrom
solid2/w-perf-remote-3-round3-1031
Oct 31, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-perf-remote-3-round3-1031

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes long Control UI reconnect waits after a brief network interruption: the transport's exponential retry can miss link restoration and sleep for several more seconds.

User Impact

A visible tab checks reachability every 750–1,000 ms during short interruptions. Online and foreground signals cancel the pending check and refresh that recovery window. Sustained failures back off to a 4–5 second health-check interval; failed checks never reset transport backoff or server retry hints.

Why This Change Was Made

The existing page-activation owner already knows whether a transport can be replaced. Reuse it instead of adding a transport retry loop. An upgrade failure whose health check straddles restoration can look like a busy Gateway; prior unreachable evidence now permits one recovery attempt. Another rejected upgrade against a live endpoint retains normal busy behavior. Young in-flight upgrades, pairing, startup retry, restart, hidden-page and suspension guards remain.

The benchmark records actual retry deadlines and native browser activation events through the existing application-context boundary. It retains the same authoritative hello and roster readiness requirement.

Evidence

Proof Result
Focused activation tests 29 pass; short-outage recovery and prolonged-failure regressions fail on the merge base
UI and script typechecks Final UI and script checks pass
Production Knip Pass
Independent review No outstanding actionable P0–P2 findings; native-visibility harness API finding fixed and re-reviewed
Strict production build Pass; startup 89,073 → 89,070 B gzip, one startup CSS request; Chat boot 1,267,221 → 1,267,136 B gzip
Remote benchmark 180 timing records complete and error-free (20 pairs/profile plus 10 A/A pairs/profile); all six native online/visible checks pass

Commands: node --import ./scripts/tsx.mjs scripts/bench-control-ui-wire.ts --bundle-dir <head-bundle> --compare-source-dir <base-checkout> --compare-bundle-dir <base-bundle> --profile <local|remote|mobile> --auth token --extended-flows --pairs 20 --output <fresh-output>. Identical-source A/A uses the base checkout and bundle on both sides, with --pairs 10. All browsers were headless; each side used an isolated real Gateway and synthetic 120-message conversations.

Cold-load source and wire audit: all 23 declared Chat assets are discovered together and transfer 1,207,282 B using the negotiated Brotli/identity encodings. Shared + Chat bundles contribute 810,374 B. The active boot work on metadata, input controls, presenters, and header subviews owns these cuts; this PR does not duplicate it. The round-trip ledger and timing table are below.

Production activation owner: 153 → 173 lines (+20). Tests: 288 → 368 lines (+80). The harness growth records the previously unlocalized retry schedule and verifies native online/visibility signals; no product diagnostic state or wire protocol is added. All four changed files total 2,797 → 3,126 lines; production growth is 20 lines. No rendering/effect/DOM-query baseline changes.

Reconnect results

20 serial interleaved pairs per profile; milliseconds, median / p95. These are raw distributions; the A/A and CPU qualification follows below.

Profile Base Candidate
Local 493 / 2,433 410 / 739
100 ms RTT, 10 Mbps 701 / 2,644 731 / 1,219
250 ms RTT, 3 Mbps 1,277 / 3,190 1,468 / 1,960

The mobile median increase remains visible. Its identical-code A/A control moves 1,774 → 1,247 ms at median, with both p95s near four seconds. The 100 ms identical-code control moves 1,062 → 2,055 ms at median and 2,824 → 4,893 ms at p95. These controls are outside the timing band, so the noisy-host rule applies: judge the 20-pair CPU and structural evidence and retain the raw timings. All three before/after cohorts have zero capture errors.

Mobile first-handshake p95 falls 2,200 → 1,073 ms; hello-adopted p95 falls 2,758 → 1,632 ms. Handshake-to-hello medians stay 557 → 558 ms and hello-to-ready medians 330 → 336 ms. Each sample has exactly one post-restoration handshake and no dropped observer events. The timing gain is before hello, where the fix acts. Mobile task CPU median/p95 is 251.2/341.2 → 262.7/278.8 ms; script CPU is 148.1/174.4 → 149.3/165.3 ms. Local and 100 ms reconnect task CPU p95 improve 15.8% and 14.7%.

The transport itself retains 800 ms initial retry, ×1.7 backoff, a 15 s cap, and up to 20% jitter. Its first three waits sum to 4,472–5,366 ms, straddling a five-second outage. The page owner shortens the wait only after fresh reachability evidence. Accepted limit: a genuinely in-flight blackholed upgrade retains the existing eight-second stale-opening guard; this PR does not promise a one-second universal bound or interrupt a slow/busy upgrade repeatedly.

Untouched-flow increases remain disclosed in the full table. Local Settings p95 rises 26.9% while task/script CPU p95 fall 0.7%/3.4%; 100 ms Usage p95 rises 15.1%, with two slow request samples per side and flat median CPU. The matching identical-code Usage control rises 17.5%. Local New Session and 100 ms New Session have small wall/CPU movement. The local identical-code New Session p95 moves 99.9 → 130.1 ms, and its reconnect median moves 276.3 → 382.5 ms; the local control is also outside the timing band. Across the 160 samples for these four audited flow/profile cells there are zero health requests, connect calls, or WebSocket upgrades; connected-flow HTTP counts are unchanged. No additional recovery work reaches these cells.

Native wake correctness

One focused real-Gateway check per stimulus/profile, outside the timing campaign. All six require trusted browser events, a fresh authoritative hello/roster, enabled composer, zero capture errors and zero dropped observer events. Values are single-sample readiness, not performance estimates.

Trigger Local 100 ms RTT 250 ms RTT
online 240.8 ms 499.5 ms 979.0 ms
visible 237.6 ms 596.9 ms 1001.9 ms

The first visibility attempt correctly failed when normal Playwright launch could not make the document hidden. The harness now reuses the existing native headless launcher and checks real hidden→visible transitions. A resulting viewport API error was caught by typecheck and independent review, corrected, and re-reviewed clean. Silent/online launch and context options are unchanged; their previous evidence is retained.

Cold mobile boot: handoff to W-BOOT-DIET

Ledger delivered to the active owner: #188996 (comment)

The detached baseline at b8a04d5f03fab0ead756311a9d9f668ec280faa7 reaches visible transcript at 6073.4 ms and enabled composer at 6073.5 ms with 250 ms RTT / 3 Mbps. This is one diagnostic at host load 26.2/20.4/19.6; the separate 20-pair comparison is recorded above. Source: base-diagnostic/01-base/01/sample.json. The earlier 7004.8 ms run is excluded because its serving checkout displayed a development branch badge.

Before-ready surface Measured bytes Serial dependency
HTML document 10,652 HTTP body 1 request/response
Declared Chat graph, 23 assets 1,207,282 HTTP body 1 discovery wave; not 23 serial RTTs
Other completed HTTP, 7 requests 69,866 HTTP body Parallel late work; no readiness gate established
Completed HTTP total, 31 requests 1,287,800 body / 1,317,373 incl. headers Do not add overlapping rows twice
Upgrade → hello → initial history → approval follow-up History: 4141 frame bytes / 99,668 decoded Four sequential exchanges; overlap the asset branch
Late literal resolve 189 request / 181 response frame bytes 1 subsequent exchange

All declared assets are requested at 704.9–705.9 ms. History arrives at 3256.1 ms, before the final shared bundle at 4611.8 ms. The observed slow branch is HTML → assets → literal resolve → ready: a 3×RTT structural floor, plus transfer, processing and scheduling—not a fitted remote-minus-local equation. Shared + Chat bundles are a subset totaling 810,374 B, 67.1% of declared bodies and 2161.0 ms nominal serialization. Every hashed asset already has immutable caching.

Prioritize the existing W-BOOT-DIET owners: conditional tool presenters; input/control execution; header/appearance subviews; tool identity/detail metadata (#188996); and media/viewer closure (#181062). The menu/catalog partition (#189053) is already included in this baseline; do not count its savings again.

Resolve takes 1170.6 ms but only 1.89 ms of handler work; admission consumes 492.83 ms, with additional proxy scheduling delay. Preserve exact-key/name ambiguity semantics when removing this dependency. Selected-font preload and CSS start together; font-display: swap applies. Config requests overlap, and the second completes after readiness. Neither fonts nor duplicate config are proven gates. No acceptance win or target attainment is claimed from this sample.

Syntax highlighting and Mermaid are already conditional (markdown-code-blocks.ts:28, markdown-blocks-owner.ts:164) and absent from this plain-text cold asset wave. The 72,193 B Brotli Markdown runtime supplies visible-history parsing/sanitization; do not count all of it as optional highlighting. Source-map candidates include icon catalogs (36,045 mapped raw B), composer English (17,214 mapped raw B), and link-reader preview/network-policy closure. Those raw attribution values are not compressed savings; visible icons and inline-link safety remain required. The existing catalog partition is already on this baseline.

Synthetic screenshots

Before:

Reconnect before

After:

Reconnect after

Full timing, CPU, retry-phase, A/A, and host-load evidence

Saved measurement evidence

Values are base → candidate in milliseconds; p95 is nearest rank. Ranges retain all samples. Paired % is the median of per-pair ratios, which can differ from the ratio of cohort medians. Incomplete cohorts appear only in the integrity table and make no acceptance claim.

Cohort Status Records B/H Eight flow counts B/H Observer available / dropped Trigger
local COMPLETE 20/20 all 20/20 40/40 available; 0 dropped silent
remote COMPLETE 20/20 all 20/20 40/40 available; 0 dropped silent
mobile COMPLETE 20/20 all 20/20 40/40 available; 0 dropped silent
aa-local COMPLETE 10/10 all 10/10 20/20 available; 0 dropped silent
aa-remote COMPLETE 10/10 all 10/10 20/20 available; 0 dropped silent
aa-mobile COMPLETE 10/10 all 10/10 20/20 available; 0 dropped silent

Revision identities (each cohort remains pinned to its own recorded source):

  • local: base b8a04d5f03fab0ead756311a9d9f668ec280faa7; candidate 93d4e4cb057b7bec5c3c24fde9c3965d966dcda0; record errors 0; source round3/local-summary.json.
  • remote: base b8a04d5f03fab0ead756311a9d9f668ec280faa7; candidate 93d4e4cb057b7bec5c3c24fde9c3965d966dcda0; record errors 0; source round3/remote-summary.json.
  • mobile: base b8a04d5f03fab0ead756311a9d9f668ec280faa7; candidate bd6e72dfb4573a80feb4a42a9610721b2f7f89b3; record errors 0; source round3/mobile-summary.json.
  • aa-local: base b8a04d5f03fab0ead756311a9d9f668ec280faa7; candidate b8a04d5f03fab0ead756311a9d9f668ec280faa7; record errors 0; source round3/aa-local-summary.json.
  • aa-remote: base b8a04d5f03fab0ead756311a9d9f668ec280faa7; candidate b8a04d5f03fab0ead756311a9d9f668ec280faa7; record errors 0; source round3/aa-remote-summary.json.
  • aa-mobile: base b8a04d5f03fab0ead756311a9d9f668ec280faa7; candidate b8a04d5f03fab0ead756311a9d9f668ec280faa7; record errors 0; source round3/aa-mobile-summary.json.

Different candidate revisions were measured across profiles. These rows are not automatically evidence for one final head; source-equivalence or final-head validation must be supplied separately.

Source-equivalence qualification: Mobile candidates were measured at bd6e72d; remote/local at 93d4e4c. The latter only rewrites benchmark event projection with explicit same-field assignments for lint. Final head 22d2815 changes only the visibility-mode harness to reuse the existing native headless launcher; silent/online launch and context options are preserved. Production source is identical, all candidates served the same immutable head UI bundle, and its source map matches the final committed production file byte-for-byte. Both sides of every A/A control use b8a04d5 and the same immutable base bundle.

Layout and bundle-content identities are not exported by these summary files and are not independently certified by this formatter.

Ready latency

Profile / flow Median B→H p95 B→H Range B→H Paired %
local / cold-chat 423.3 → 419.1 439.5 → 442.7 398.4–4,582.0 → 405.0–1,608.7 +0.55%
local / warm-chat 297.3 → 301.5 324.8 → 339.4 285.2–353.9 → 281.0–348.4 -0.95%
local / session-switch 129.1 → 128.8 139.0 → 138.6 118.0–200.0 → 116.8–141.4 +0.92%
local / new-session 64.9 → 65.3 68.3 → 78.8 59.5–81.4 → 62.1–82.4 +1.38%
local / first-board 107.8 → 110.6 116.5 → 115.8 99.3–120.3 → 99.5–116.0 +1.27%
local / first-usage 111.2 → 107.8 252.6 → 131.6 93.0–2,241.4 → 99.4–2,679.3 +0.49%
local / first-settings 76.8 → 82.4 89.5 → 113.6 71.9–89.8 → 70.2–135.6 +7.97%
local / reconnect 493.0 → 409.9 2,433.1 → 739.3 230.7–2,559.0 → 166.0–965.9 -16.54%
local / warm visible 233.1 → 231.8 253.8 → 282.8 210.6–256.0 → 203.4–287.9 -1.59%
remote / cold-chat 1,958.9 → 1,956.2 2,088.0 → 2,059.8 1,919.7–3,984.3 → 1,886.2–5,238.3 +0.04%
remote / warm-chat 629.7 → 628.9 815.6 → 743.8 531.0–1,008.5 → 575.1–766.8 +1.19%
remote / session-switch 197.1 → 197.2 231.1 → 211.5 185.1–234.1 → 184.3–275.8 +0.41%
remote / new-session 150.6 → 163.6 164.8 → 175.6 145.8–215.7 → 147.0–272.3 +4.10%
remote / first-board 521.2 → 522.4 560.4 → 528.4 510.1–576.7 → 507.9–529.2 -0.36%
remote / first-usage 648.3 → 642.6 3,524.0 → 4,056.0 631.2–3,532.6 → 627.6–5,407.7 -0.58%
remote / first-settings 619.9 → 618.9 651.4 → 687.4 614.0–670.8 → 607.6–730.8 -0.21%
remote / reconnect 700.8 → 730.7 2,643.9 → 1,219.2 467.4–2,839.6 → 442.9–1,270.6 -1.94%
remote / warm visible 343.6 → 345.6 386.4 → 373.6 329.1–411.2 → 328.8–618.1 +0.67%
mobile / cold-chat 5,381.3 → 5,411.7 5,493.1 → 5,471.3 5,188.9–6,289.5 → 5,288.3–5,917.0 +0.58%
mobile / warm-chat 1,223.3 → 1,228.7 1,378.9 → 1,264.3 1,209.9–1,393.1 → 1,206.7–1,338.7 +0.04%
mobile / session-switch 359.9 → 356.2 375.0 → 363.5 351.9–383.5 → 350.5–373.8 -0.78%
mobile / new-session 313.8 → 299.6 316.6 → 315.9 297.9–381.4 → 296.9–381.9 -0.91%
mobile / first-board 1,237.6 → 1,235.1 1,252.9 → 1,247.5 1,228.1–1,283.8 → 1,228.2–1,247.6 -0.11%
mobile / first-usage 1,468.3 → 1,470.6 1,549.7 → 1,557.9 1,457.4–4,219.7 → 1,457.7–3,893.6 -0.03%
mobile / first-settings 1,425.4 → 1,425.5 1,431.9 → 1,430.7 1,419.6–1,434.8 → 1,421.5–1,434.6 +0.06%
mobile / reconnect 1,277.4 → 1,468.1 3,190.0 → 1,959.8 921.7–3,930.3 → 942.4–1,987.1 -1.82%
mobile / warm visible 643.5 → 642.6 711.4 → 656.4 630.8–799.6 → 634.7–726.4 +0.37%

Reconnect CPU and observed phases

CPU at ready and settled CPU have different endpoints; the settled window includes the post-ready drain. A pending retry deadline can be retired by a health/wake path, so it is not necessarily the winning attempt. “Hello adopted” is the connected snapshot, not first wire-byte arrival.

Profile / metric Median B→H p95 B→H Range B→H n B/H
local / cpuMs.TaskDuration 226.2 → 206.7 305.2 → 256.9 182.2–334.4 → 176.0–267.2 20/20
local / cpuMs.ScriptDuration 150.1 → 138.2 172.9 → 171.9 132.8–194.9 → 130.3–185.3 20/20
local / settledCpuMs.TaskDuration 325.8 → 301.0 399.7 → 326.0 273.8–406.6 → 266.9–340.4 20/20
local / settledCpuMs.ScriptDuration 212.9 → 201.3 239.0 → 217.9 197.8–239.8 → 184.2–230.4 20/20
local / Outage (excluded from readiness) 5,005.0 → 5,005.8 5,025.0 → 5,023.8 5,002.6–5,029.4 → 5,003.0–5,025.3 20/20
local / Restoration → ready 491.3 → 408.4 2,431.9 → 736.7 229.0–2,557.3 → 160.7–964.4 20/20
local / Pending deadline at restoration 4,183.5 → 3,731.0 4,537.0 → 4,501.0 17.0–4,618.0 → 20.0–4,650.0 20/20
local / Restoration → first handshake request 330.8 → 223.8 2,278.3 → 571.2 26.6–2,394.1 → 19.5–798.0 20/20
local / First handshake − pending deadline -2,478.8 → -3,377.5 11.9 → 12.6 -4,283.9–12.0 → -4,481.5–14.3 20/20
local / Restoration → hello adopted 355.8 → 254.9 2,294.1 → 598.1 55.3–2,419.5 → 48.8–820.4 20/20
local / Hello adopted → ready 139.2 → 142.7 173.7 → 214.1 119.6–228.5 → 111.9–258.9 20/20
remote / cpuMs.TaskDuration 235.8 → 234.6 341.9 → 291.5 184.9–360.8 → 196.8–296.0 20/20
remote / cpuMs.ScriptDuration 146.9 → 147.8 179.7 → 183.3 125.8–192.8 → 122.0–186.5 20/20
remote / settledCpuMs.TaskDuration 333.3 → 329.8 413.1 → 353.3 281.1–449.8 → 301.0–373.3 20/20
remote / settledCpuMs.ScriptDuration 219.7 → 217.3 232.7 → 236.8 194.5–256.0 → 192.0–239.0 20/20
remote / Outage (excluded from readiness) 5,005.5 → 5,005.9 5,013.8 → 5,031.4 5,002.9–5,016.0 → 5,002.5–5,034.4 20/20
remote / Restoration → ready 699.2 → 725.2 2,642.0 → 1,217.5 466.0–2,834.5 → 441.1–1,268.2 20/20
remote / Pending deadline at restoration 3,976.0 → 3,926.0 4,570.0 → 4,496.0 33.0–4,578.0 → 12.0–4,570.0 20/20
remote / Restoration → first handshake request 282.5 → 269.3 1,892.6 → 650.6 43.5–2,413.5 → 22.7–727.5 20/20
remote / First handshake − pending deadline -3,002.5 → -3,493.5 12.7 → 11.3 -4,266.7–13.7 → -4,263.6–11.4 20/20
remote / Restoration → hello adopted 504.9 → 487.0 2,102.0 → 866.7 268.2–2,628.0 → 249.8–948.5 20/20
remote / Hello adopted → ready 200.7 → 207.2 537.7 → 350.8 168.7–639.3 → 165.4–377.0 20/20
mobile / cpuMs.TaskDuration 251.2 → 262.7 341.2 → 278.8 200.3–368.1 → 208.7–296.1 20/20
mobile / cpuMs.ScriptDuration 148.1 → 149.3 174.4 → 165.3 125.6–198.6 → 119.1–170.1 20/20
mobile / settledCpuMs.TaskDuration 344.7 → 345.0 426.8 → 393.3 287.8–430.5 → 279.3–400.2 20/20
mobile / settledCpuMs.ScriptDuration 217.0 → 209.2 236.2 → 244.7 186.6–249.4 → 179.0–247.3 20/20
mobile / Outage (excluded from readiness) 5,005.3 → 5,004.6 5,010.1 → 5,016.4 5,002.9–5,010.2 → 5,002.8–5,019.8 20/20
mobile / Restoration → ready 1,275.8 → 1,465.9 3,188.4 → 1,958.3 920.2–3,928.2 → 941.0–1,985.6 20/20
mobile / Pending deadline at restoration 3,821.0 → 3,997.5 4,532.0 → 4,413.0 22.0–4,548.0 → 30.0–4,478.0 20/20
mobile / Restoration → first handshake request 406.0 → 576.5 2,199.5 → 1,073.1 30.3–3,019.3 → 39.7–1,103.1 20/20
mobile / First handshake − pending deadline -2,292.7 → -3,309.6 11.2 → 11.6 -3,995.1–11.3 → -3,756.9–15.5 20/20
mobile / Restoration → hello adopted 952.1 → 1,126.8 2,758.1 → 1,631.7 593.8–3,577.5 → 598.5–1,656.0 20/20
mobile / Hello adopted → ready 330.3 → 336.4 430.3 → 428.4 310.1–466.7 → 302.3–449.6 20/20

Reconnect event counts (unit: events; each cell is median B→H / p95 B→H [range B→H]):

Profile Post-restoration handshake requests Health requests in capture
local 1.0 → 1.0 / 1.0 → 1.0 [1.0–1.0 → 1.0–1.0] 1.0 → 1.0 / 1.0 → 1.0 [0.0–2.0 → 0.0–1.0]
remote 1.0 → 1.0 / 1.0 → 1.0 [1.0–1.0 → 1.0–1.0] 1.0 → 1.0 / 1.0 → 1.0 [0.0–1.0 → 0.0–2.0]
mobile 1.0 → 1.0 / 1.0 → 1.0 [1.0–1.0 → 1.0–1.0] 1.0 → 1.0 / 1.0 → 2.0 [0.0–1.0 → 0.0–2.0]

A/A controls

Identical revision is required within each A/A row. Controls qualify their own network profile, not a different profile or host-load window.

Control / flow Median B→H p95 B→H Paired %
aa-local / cold-chat 413.5 → 403.6 3,111.9 → 4,820.6 -0.61%
aa-local / warm-chat 289.1 → 284.3 359.2 → 320.1 -1.66%
aa-local / session-switch 128.4 → 122.4 133.5 → 132.5 -3.73%
aa-local / new-session 65.9 → 65.2 99.9 → 130.1 -0.88%
aa-local / first-board 106.9 → 103.6 130.3 → 129.2 -2.87%
aa-local / first-usage 103.7 → 103.2 2,928.2 → 2,052.1 -0.15%
aa-local / first-settings 74.8 → 71.1 88.1 → 92.2 -0.63%
aa-local / reconnect 276.3 → 382.4 2,754.9 → 2,088.0 +87.51%
aa-local / reconnect cpuMs.TaskDuration 197.7 → 201.4 276.2 → 266.3 +15.55%
aa-local / reconnect cpuMs.ScriptDuration 134.5 → 134.4 171.1 → 163.8 +3.95%
aa-local / reconnect settledCpuMs.TaskDuration 275.1 → 284.5 362.4 → 358.2 +13.25%
aa-local / reconnect settledCpuMs.ScriptDuration 190.6 → 196.6 226.1 → 220.0 +1.20%
aa-local / reconnect reconnect.firstHandshakeAfterRestoreMs 97.8 → 216.1 2,601.0 → 1,944.2 +346.71%
aa-local / reconnect reconnect.connectedAfterRestoreMs 130.9 → 249.0 2,624.8 → 1,958.2 +219.75%
aa-local / reconnect reconnect.readyAfterConnectedMs 138.1 → 137.0 208.9 → 207.7 -0.55%
aa-remote / cold-chat 1,940.4 → 1,940.9 3,732.4 → 3,082.2 -0.35%
aa-remote / warm-chat 616.8 → 624.4 668.3 → 725.1 +0.31%
aa-remote / session-switch 189.8 → 186.8 204.5 → 341.1 -0.96%
aa-remote / new-session 149.0 → 149.4 199.2 → 181.9 -0.50%
aa-remote / first-board 517.3 → 520.8 533.4 → 550.7 +0.41%
aa-remote / first-usage 642.9 → 642.9 2,688.8 → 3,160.2 +0.15%
aa-remote / first-settings 615.8 → 612.7 671.2 → 621.9 -1.00%
aa-remote / reconnect 1,061.9 → 2,054.7 2,823.8 → 4,892.7 +18.71%
aa-remote / reconnect cpuMs.TaskDuration 235.5 → 277.4 296.2 → 372.3 +9.26%
aa-remote / reconnect cpuMs.ScriptDuration 145.3 → 150.0 175.2 → 192.2 +3.23%
aa-remote / reconnect settledCpuMs.TaskDuration 333.9 → 360.9 393.5 → 474.2 +4.57%
aa-remote / reconnect settledCpuMs.ScriptDuration 212.0 → 216.2 226.9 → 262.5 +0.80%
aa-remote / reconnect reconnect.firstHandshakeAfterRestoreMs 649.3 → 1,625.6 2,388.8 → 4,469.9 +23.02%
aa-remote / reconnect reconnect.connectedAfterRestoreMs 871.0 → 1,844.3 2,598.8 → 4,695.6 +19.11%
aa-remote / reconnect reconnect.readyAfterConnectedMs 191.9 → 198.8 352.1 → 358.2 +1.80%
aa-mobile / cold-chat 5,419.8 → 5,413.6 5,849.4 → 5,911.2 +0.49%
aa-mobile / warm-chat 1,241.3 → 1,238.2 1,270.9 → 1,251.1 -0.45%
aa-mobile / session-switch 363.6 → 359.6 417.5 → 388.4 -1.89%
aa-mobile / new-session 314.0 → 313.1 349.6 → 380.3 -0.11%
aa-mobile / first-board 1,235.8 → 1,241.1 1,251.1 → 1,302.5 +0.43%
aa-mobile / first-usage 1,475.3 → 1,474.5 4,739.6 → 4,354.4 -0.67%
aa-mobile / first-settings 1,429.6 → 1,428.9 1,444.3 → 1,438.9 -0.18%
aa-mobile / reconnect 1,774.4 → 1,246.8 4,041.2 → 3,947.2 -31.85%
aa-mobile / reconnect cpuMs.TaskDuration 289.1 → 266.3 413.4 → 417.4 -11.62%
aa-mobile / reconnect cpuMs.ScriptDuration 160.1 → 155.7 211.6 → 219.8 -8.90%
aa-mobile / reconnect settledCpuMs.TaskDuration 382.9 → 352.6 493.1 → 494.7 -10.54%
aa-mobile / reconnect settledCpuMs.ScriptDuration 229.5 → 227.5 271.0 → 272.2 -4.60%
aa-mobile / reconnect reconnect.firstHandshakeAfterRestoreMs 854.2 → 326.0 3,011.3 → 2,901.5 -72.90%
aa-mobile / reconnect reconnect.connectedAfterRestoreMs 1,407.6 → 882.8 3,569.5 → 3,461.4 -41.45%
aa-mobile / reconnect reconnect.readyAfterConnectedMs 354.8 → 335.0 469.8 → 484.2 -5.72%

Host load

OS load averages sampled at reconnect readiness, not CPU utilization. Each cell is median B→H [range B→H].

Cohort 1 minute 5 minutes 15 minutes
local 31.9 → 32.6 [23.8–38.4 → 25.0–40.5] 29.8 → 30.3 [27.8–32.7 → 28.2–33.4] 27.7 → 27.7 [27.0–29.5 → 27.2–29.7]
remote 28.8 → 30.6 [22.1–36.7 → 23.6–38.0] 28.4 → 28.7 [24.4–29.4 → 26.3–29.5] 25.0 → 25.1 [22.1–26.2 → 22.8–26.3]
mobile 18.1 → 18.6 [14.9–28.5 → 15.3–29.2] 19.8 → 20.1 [17.7–28.6 → 17.7–26.9] 20.9 → 21.0 [19.7–23.9 → 19.7–23.4]
aa-local 23.2 → 22.6 [16.1–26.2 → 16.6–25.8] 21.5 → 21.6 [20.1–22.7 → 20.5–22.2] 23.6 → 23.6 [22.7–23.9 → 22.9–23.8]
aa-remote 19.0 → 19.8 [15.9–24.0 → 17.1–21.7] 22.0 → 21.9 [20.2–25.1 → 20.8–24.4] 25.2 → 25.1 [23.9–27.0 → 24.2–26.6]
aa-mobile 23.4 → 24.0 [20.0–34.5 → 19.6–39.7] 28.0 → 27.8 [25.1–32.3 → 25.2–32.8] 28.8 → 28.7 [27.3–30.2 → 27.4–30.2]

Increases requiring interpretation

This is a flag list, not automatic attribution. Compare the matching completed A/A and exact schedule/HTTP evidence before accepting or assigning a cause.

Profile / flow Cohort median change p95 change Paired median change
local / new-session +0.62% +15.37% +1.38%
local / first-settings +7.29% +26.93% +7.97%
remote / new-session +8.63% +6.55% +4.10%
remote / first-usage -0.88% +15.10% -0.58%
remote / first-settings -0.17% +5.53% -0.21%
mobile / reconnect +14.92% -38.56% -1.82%

The mobile reconnect cohort-median increase must not be replaced by its negative paired-median number; both describe the same retained samples. Likewise, a flat Usage median does not erase a longer p95. No claim of “no regression” follows from this formatter.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 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 app: web-ui App: web-ui scripts Repository scripts size: M labels Oct 31, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR accelerates short-outage recovery through the existing page-activation owner and adds benchmark observations for reconnect timing and browser activation.

Example: A visible tab has a closed transport when connectivity returns after a five-second outage.

  • Before: The next reachability check can wait another 2–3 seconds.
  • After: During the fast recovery window, checks are scheduled 750–1,000 ms apart, with transport replacement still requiring successful reachability evidence.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has no identified correctness defect, but the supplied proof does not establish the changed recovery behavior.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: A brief network interruption can leave the Control UI waiting after connectivity returns.
Reason: The maintainer-authored direction improves an existing recovery flow with a small production change and preserves its established ownership.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored draft makes a useful, focused recovery improvement; no definite introduced code defect was found.

Priority: P2
Reviewed head: 93d4e4cb057b7bec5c3c24fde9c3965d966dcda0

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide completed production-browser transport traces showing short-outage restoration, native online/visibility recovery, and sustained-failure backoff while retaining fresh handshake and roster readiness.
Agent review details

How this fits together

Browser lifecycle signals and Gateway connection snapshots enter the page-activation owner, which probes same-origin health and requests client replacement through the application Gateway owner.

flowchart TD
  A[Browser lifecycle signals] --> B[Page activation owner]
  C[Gateway connection snapshot] --> B
  B --> D[Same origin health probe]
  D --> B
  B --> E[Application Gateway connect]
  E --> F[Authenticated WebSocket handshake]
Loading

Technical review

Best possible solution:

Retain the adaptive cadence and bounded busy-recovery exception in the existing activation owner, with the original transport and lifecycle guards intact.

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

Current-main source shows the slower polling interval and inferred-busy exclusion, and the PR reports base-failing regressions; no product execution was performed during this read-only review.

Is this the best way to solve the issue?

The patch is appropriately placed: it adjusts the existing reachability scheduler, resets its failure budget at recovery boundaries, and keeps application-owned client replacement instead of adding another transport retry loop.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 84a74eb6b1f1.

Provenance checked

  • Reachability cadence and inferred busy exclusion changes intended behavior with a stated reason (00096a1: Recover silent outages without replacing live or young sockets or accelerating known busy/startup retries.)
  • Benchmark reconnect readiness and capture details keeps the original intent (perf(ui): shorten remote page loading waterfalls #188922: Measure authoritative readiness separately from visible cached content and retain bounded post-readiness observations.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 00096a1 adds ui/src/app/gateway-page-activation.ts:43 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 00096a11f22b; files: ui/src/app/gateway-page-activation.ts)
  • RoboClaw: Raw commit 258c737 adds ui/src/app/gateway-page-activation.ts:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 258c73769f01; files: ui/src/app/gateway-page-activation.ts)

PR surface

Source +20, Tests +80, Docs +31, Other +184. Total +315 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 23 3 +20
Tests 1 82 2 +80
Docs 1 31 0 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 1 192 8 +184
Total 4 328 13 +315

Review metrics

Metric Value Why it matters
Production versus regression tests Runtime production +23/−3 lines; regression tests +82/−2 lines. The small runtime change reuses the existing owner; tests address short restoration, sustained failures, inferred busy recovery, and activation signals.
New tooling option One benchmark flag: --reconnect-trigger silent|online|visible; default silent. Separates recovery workloads without introducing a user configuration setting.

Labels

Label changes:

  • add P2: Improves recovery latency after brief interruptions while existing automatic reconnection remains available.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Improves recovery latency after brief interruptions while existing automatic reconnection remains available.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Publish the completed reconnect measurements and transport traces already planned for this draft.

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 31, 2026, 2:54 AM ET / 06:54 UTC.

@steipete
steipete marked this pull request as ready for review October 31, 2026 08:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T08:04:58.377291Z 22d2815 Draft marked ready
ℹ️ 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 enabled auto-merge (squash) October 31, 2026 08:04
@steipete
steipete merged commit ad59635 into main Oct 31, 2026
170 of 172 checks passed
@steipete
steipete deleted the solid2/w-perf-remote-3-round3-1031 branch October 31, 2026 08:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…law#189141)

* perf(ui): recover short network drops before retry backoff expires

* chore: keep reconnect timeline projection lint clean

* fix: capture native visibility in the reconnect benchmark
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 ci:full Keep ordinary native-locale CI selection on the next PR run. 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: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant