Skip to content

experiment(control-ui): reconnect indicator grace - #189602

Closed
steipete wants to merge 1 commit into
mainfrom
steipete/coldload-reconnect-pill-grace
Closed

steipete wants to merge 1 commit into
mainfrom
steipete/coldload-reconnect-pill-grace

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #189645 after approval to scope the fix to indicator timing. The results below describe the earlier experiment head.

What Problem This Solves

A signed-in reload of a dashboard deep link briefly shows saved-conversation connection feedback during the normal initial handshake. The original measured sequence had header shifts around 501 and 798 ms. Cached history and pending route resolution independently manufactured a reconnect indicator, bypassing the shared status grace.

Outcome: experiment stopped; do not merge

The presentation change removes the normal-boot indicator in all 22 candidate reloads, but the predeclared compound gate fails: 0/11 qualifying reloads on each route, versus the required 10/11. Two header-trailing shifts remain in every candidate reload. This draft is being closed as an experiment; no landing is requested.

Why This Change Was Made

Reuse the existing two-second connection presentation grace. The desktop header consumes the shared Gateway status instead of deriving status from cached history or unresolved routes. A real socket close atomically ends the grace, and feedback remains through retries until hello succeeds. Session controls stay mounted, and connection feedback is positioned below the header to avoid inserting width into the trailing controls.

Two seconds reuses the existing owner and timer and covers the observed normal sub-second boot. No new option, timer, protocol field, reconnect/backoff/liveness policy, or durable record is introduced. Recovery work on the related recovery branch merged in #186325; it is unchanged here.

User Impact

Ordinary warm reloads lose the connection-status flash. Slow and failed connection feedback remains visible in native lifecycle tests. The remaining header identity/action hydration prevents the complete no-shift experience, so this is not presented as a finished fix.

Evidence

Final candidate: 4f792e0727f5dbe7a96262540c78d85f21425d21, based on main 5353794239ba. Baseline is that checkout with only the six UI runtime files reversed; candidate and baseline use the same built Gateway, diagnostics, fixture and browser. Measurements ran on one AWS c7a.4xlarge lease, 16 CPUs / 31,378 MiB RAM, headless repository Playwright Chromium. Lease cbx_0b04095f08e5, run run_f6e218e099a48948e8edb3d4c961baa0. The lease is released and has no host.

The Team-scale bench used 11 interleaved pairs per route, warm archived sessions, live-fast latency, no trace/profile, 390 sessions and 240 transcript messages. Sidebar settings: involving-me, category grouping, created sort, 97 groups / 102 section-order entries, five collapsed groups, empty groups always, preview disabled, pins present. The pane probe samples indicator visibility and header geometry. All 44 bench runs had one connect and zero socket closes.

The separate real-Gateway warm-reload rig used 11 interleaved pairs per route, 3,000 synthetic sessions and the rig's 80 ms RTT setting on the same lease and bundles. Its first/final row timings use different boundaries: first painted rows is Element Timing; final rows is DOM readiness, which can precede paint. No local-Mac timings are used as performance results.

Tables show median [Q1, Q3]. Paired deltas are candidate minus baseline in run order.

Team-scale bench

chat

Metric Baseline Candidate Better / worse pairs
Indicator-visible sampled frames 9 [9, 9.5] 0 [0, 0] 11 / 0
Header-trailing movements 3 [3, 3] 2 [2, 2] 9 / 0
Hello arrival (ms) 536.6 [525.55, 585.2] 558.8 [523.1, 583.85] 5 / 6
First painted rows (ms) 488 [484, 520] 496 [480, 512] 5 / 3
LoAF blocking (ms) 124 [119.5, 163] 117 [111, 134.5] 7 / 3
Layout-shift sum 0.022912 [0.022912, 0.022912] 0.008321 [0.008321, 0.008321] 11 / 0
All per-pair deltas
  • Indicator-visible sampled frames: -9, -8, -9, -9, -8, -9, -11, -10, -9, -11, -9
  • Header-trailing movements: 0, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1
  • Hello arrival (ms): -0.5, -3.6, 19.1, 0.3, -12.6, 22.2, 5.4, 1, -9.9, -8.1, 2.5
  • First painted rows (ms): 4, -12, -8, -4, 0, 12, 4, 0, -20, -12, 0
  • LoAF blocking (ms): 22, -79, -34, -4, 7, 1, 0, -7, -17, -6, -62
  • Layout-shift sum: -0.0138, -0.0146, -0.0146, -0.0146, -0.0138, -0.0146, -0.0146, -0.0146, -0.0146, -0.0146, -0.0146

dashboard

Metric Baseline Candidate Better / worse pairs
Indicator-visible sampled frames 9 [9, 10] 0 [0, 0] 11 / 0
Header-trailing movements 3 [3, 3] 2 [2, 2] 11 / 0
Hello arrival (ms) 630.9 [585.6, 640.5] 653.7 [636.45, 689] 2 / 9
First painted rows (ms) 484 [480, 490] 476 [460, 510] 6 / 4
LoAF blocking (ms) 200 [130.5, 209] 204 [173.5, 216] 2 / 9
Layout-shift sum 0.017202 [0.017202, 0.017202] 0.006470 [0.006470, 0.006470] 11 / 0
All per-pair deltas
  • Indicator-visible sampled frames: -10, -9, -8, -9, -9, -10, -9, -10, -9, -11, -11
  • Header-trailing movements: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
  • Hello arrival (ms): 110.9, 12.5, 9.7, 2.9, 1.2, -83, 106, 100.8, 99.8, -12.4, 122.1
  • First painted rows (ms): -4, -32, -12, -36, 0, -8, 24, 12, 20, 28, -8
  • LoAF blocking (ms): 6, 8, 44, 15, 4, -10, 78, 49, 53, -6, 53
  • Layout-shift sum: -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107

Real Gateway

chat

Metric Baseline Candidate Better / worse pairs
Hello handled (ms) 475.43 [465.04, 478.32] 464.24 [423.49, 485.67] 6 / 5
FCP (ms) 836.96 [816.61, 853.53] 842.35 [819.06, 857.08] 6 / 5
First painted rows (ms) 839.48 [819.41, 855.45] 843.38 [821.47, 859.5] 5 / 6
Final rows DOM ready (ms) 390.19 [385.02, 397.15] 396.05 [383.51, 416.01] 5 / 6
LoAF blocking (ms) 187.4 [172.8, 203.9] 176 [159.3, 209.85] 6 / 5
CLS 0.003833 [0.003522, 0.003902] 0.000482 [0.000310, 0.000482] 11 / 0
All per-pair deltas
  • Hello handled (ms): -12.2629, -84.5009, 3.5167, -31.1189, 14.3068, 21.0912, -3.833, -71.4551, 45.4719, -83.168, 28.9077
  • FCP (ms): 94.323, 127.323, -29.443, -1.016, 5.633, -40.534, -85.434, 88.942, -52.602, 23.339, -16.548
  • First painted rows (ms): 96.0371, 128.0991, -32.0833, 0.0811, 4.0068, -39.8088, -84.033, 88.0449, -52.0281, 20.032, -16.0923
  • Final rows DOM ready (ms): -11.2629, 32.6991, -5.5833, -26.7189, 7.3068, -98.7088, -20.633, 49.9449, 43.3719, 45.032, 7.7077
  • LoAF blocking (ms): -20.1, -62, 35, -56.5, 10.3, -53, 47.8, -38.5, 63.1, -44.2, 66.1
  • CLS: -0.0034, -0.0038, -0.003, -0.0034, -0.003, -0.003, -0.003, -0.0037, -0.0035, -0.0038, -0.003

dashboard

Metric Baseline Candidate Better / worse pairs
Hello handled (ms) 621.65 [599.05, 646.24] 632.77 [606.61, 640.99] 5 / 6
FCP (ms) 801.09 [777.83, 821.1] 803.64 [775.92, 825.35] 7 / 4
First painted rows (ms) 803.55 [779.46, 823.47] 807.43 [777.42, 827.44] 7 / 4
Final rows DOM ready (ms) 396.94 [388.49, 426.62] 398.73 [380.41, 404.49] 6 / 5
LoAF blocking (ms) 247.5 [209.4, 261.75] 225.4 [215.75, 247.45] 6 / 5
CLS 0.002212 [0.002073, 0.002212] 0.000138 [0.000138, 0.000138] 11 / 0
All per-pair deltas
  • Hello handled (ms): 95.4541, -100.4213, 13.3792, -32.1889, 28.9961, -52.3743, 50.626, -47.0757, 20.31, -36.3026, 47.7239
  • FCP (ms): -66.487, -106.165, -2.049, 164.979, -31.131, -89.722, 33.005, -20.866, -137.854, 59.637, 46.514
  • First painted rows (ms): -63.8459, -103.8213, -4.1208, 164.1111, -32.2039, -92.1743, 35.926, -20.0757, -139.99, 60.0974, 48.0239
  • Final rows DOM ready (ms): -36.4459, -74.7213, 6.2792, 83.4111, 29.3961, -50.1743, 53.526, -34.4757, -68.59, -7.3026, 16.1239
  • LoAF blocking (ms): -66.9, -103.9, 26.9, -33.8, 41.2, -41.4, 51.1, -35.7, 57.4, -52, 35.4
  • CLS: -0.0019, -0.0021, -0.0021, -0.0021, -0.0021, -0.0021, -0.0019, -0.0021, -0.0021, -0.0019, -0.0019

Attribution and secondary limits

Indicator frames fall from median 9 to 0 on both routes, 11/11 pairs better each. Header movements fall from median 3 to 2, but never reach zero. The candidate still moves the trailing region 144.22 px during workspace/session-identity hydration (chat 379–442 ms; dashboard 394–470 ms), then 32 px as session actions arrive (chat 737–873 ms; dashboard 678–809 ms). The first movement coincides with the title moving right and the archived footer contracting 26 px; the second coincides with the header identity subtree growing from one to seven nodes. These observations point to separate identity/action hydration; they do not establish a complete causal fix for those paths.

The baseline adds a 231.05 px indicator insertion/removal to those movements. Removing it reduces real-Gateway median CLS by 87.4% on chat and 93.7% on dashboard, with separated IQRs and all 11 pairs better on each route. This is a consistent indicator-only benefit, not a pass of the compound gate.

Real-Gateway hello-handled, FCP, first painted rows, final rows and LoAF all have overlapping IQRs and mixed pair signs. There is no supported timing improvement from those results. Instrumented Team-scale dashboard LoAF is worse in 9/11 pairs, with median paired delta +15 ms (marginal medians 200→204 ms); that raises a secondary regression concern under the paired rule. The separate real-Gateway dashboard LoAF is 247.5→225.4 ms with mixed signs. No A/A control was run to resolve the discrepancy because the primary gate had already failed. Team-scale dashboard hello arrival is worse in 9/11 pairs, paired median +12.5 ms, below its 3% threshold (~18.9 ms).

Tests and review

  • Six focused remote files passed: gateway retention (15 tests, Vitest 1.25 s; pnpm wrapper 2.63 s), status (1, 0.37 s / 1.72 s), header component (36, 7.88 s / 9.26 s), app shell (20, 4.69 s / 6.03 s), document title (12, 2.28 s / 3.66 s), and Gateway observers (40, 0.80 s / 2.13 s). All commands used pnpm test <file> --maxWorkers=1; 124 assertions/tests passed across the files.
  • New native Chromium two-route test passed locally, with a held initial hello, fake-clock slow connection after the grace, successful hello and an observed close. It checks no initial indicator and unchanged trailing/action geometry through those transitions. The ordinary run took 79.11 s including UI build; scenario bodies took 3.42 s and 2.47 s. The capture run took 67.71 s including build.
  • The same native test on the remote baseline fails correctly on both routes at the initial indicator assertion: expected zero, received one. The Gateway-owner regression also failed on pre-fix code and passed with the fix.
  • Independent local Codex autoreview was clean through P2 before the commit.
  • check-changed was interrupted during its run when the lease was stopped after gate failure; completed checks are partial evidence only. Full UI e2e was not started. Actual browser airplane-mode proof was not completed; native observed-close/offline and slow-connect coverage are not substitutes for that missing proof.
  • Exact-head broad PR CI is skipped because this remains an experiment draft. Ancillary checks passed; there is no green broad-CI claim and no ready-to-land claim.

Production LOC and scope

UI runtime delta is +2 lines. Keeping explicit close feedback and stable session controls while removing competing fallback policy accounts for that small growth. Benchmark diagnostics add 10 lines for indicator-frame counting and identity-region attribution. The requested non-test/non-doc diff-stat command reports 54 insertions / 40 deletions, net +14, including the two-line test allocation record; executable production/diagnostic net is +12. The exact 148-line allocation covers the added native lifecycle/geometry and owner regressions, with no shared scalar budget increase.

Touched runtime: gateway-store.ts, gateway-status.ts, chat-pane-header.ts, components/chat-pane-header.tsx, components/chat-pane-mobile-composition.tsx, startup-layout.css. Also touched the pane-chrome probe, three test files plus the new native e2e file, offline/reconnect docs, and the exact test allocation record. No changelog edits.

Synthetic visual states

All images were inspected and contain synthetic fixture data only. Baseline images come from the exact remote baseline native regression. Candidate images illustrate the same runtime patch before its final rebase; other UI files changed on main during that rebase, so these are illustrative lifecycle states, not exact-final-head pixel comparisons. Quantitative final-head evidence is in the tables above.

Route Before normal hello Candidate normal hello
Chat Synthetic baseline chat boot Synthetic candidate chat boot
Dashboard Synthetic baseline dashboard boot Synthetic candidate dashboard boot

Candidate slow connection after grace:

Synthetic slow-connection feedback

Candidate observed-close/offline feedback:

Synthetic observed-close feedback

Lead decision

The open question is whether the indicator-only improvement should be accepted under a separately scoped gate, or whether workspace/session-identity and header-action hydration should first remove the remaining 144.22 px and 32 px movements. This experiment makes neither decision and is stopped before merge.

Use the existing initial connection grace for the chat header and show observed failures immediately. Retain desktop actions and float outage feedback without moving header geometry. Cached history and route resolution no longer produce reconnect state.
@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 docs Improvements or additions to documentation 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 changes before merge.

What this changes

This PR delays initial connection feedback for two seconds and retains desktop header controls while displaying outage feedback below them.

Example: A cached conversation reconnects successfully 800 ms after reload.

  • Before: The header briefly displays “Saved conversation · Reconnecting…” and changes geometry when it disappears.
  • After: The header retains its controls without showing connection feedback during the initial grace period.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and reuses existing owners, but an accessibility defect remains and supplied validation does not satisfy the visual behavior gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Ordinary warm reloads briefly show reconnect feedback and move header controls despite a healthy initial handshake.
Reason: The maintainer-authored direction addresses observed header shifts using existing presentation owners and adds no configuration or persistence machinery.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored experiment open and honor its do-not-merge instruction; the focused change addresses a source-confirmed presentation defect but introduces duplicate connection announcements.

Priority: P2
Reviewed head: 4f792e0727f5dbe7a96262540c78d85f21425d21

Before merge

  • Keep desktop connection announcements in the shell (P2) - On a desktop conversation with no saved messages, a connection lasting over two seconds now populates this fallback with connecting. That mounts the header's .chat-pane__connection-state live region (role="status", aria-live="polite") while app-shell-view.tsx independently announces the same shared status through its always-mounted live region. Previously this desktop case had neither an injected gatewayStatus nor the saved-conversation fallback, so it did not create the second announcement. Subsequent status transitions can therefore be announced twice, contrary to the single-announcement design recorded in feat(ui): show the Gateway connection state in the sidebar footer #174022. Keep the visible header feedback, but use the existing shell as its announcement owner and cover that distinction in the regression.

Findings

  • [P2] Keep desktop connection announcements in the shell — ui/src/pages/chat/chat-pane-header.ts:453-454

Tests

  • Missing end-to-end proof: Supply redacted before/after screenshots or a recording from the built UI with a real Gateway covering a normal cached reload, a connection exceeding two seconds, and an observed disconnect without header movement.
Agent review details

How this fits together

The Gateway store publishes connection lifecycle facts, a shared resolver derives presentation status, and the shell and chat header render that status alongside cached conversation content.

flowchart LR
  A[Gateway client] --> B[Gateway store]
  B --> C[Shared status resolver]
  C --> D[Shell status and announcements]
  C --> E[Chat header]
  F[Cached conversation] --> E
  E --> G[Retained session controls]
Loading

Technical review

Best possible solution:

Keep the shared connection grace and retained controls, while leaving connection announcements with the existing shell owner.

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

The base header explicitly infers reconnecting from cached messages during initial connection, independently of the store's grace period; source establishes the path, but this review ran no reproduction.

Is this the best way to solve the issue?

Reusing the existing store timer and status resolver is the smallest complete approach; retaining the controls avoids their removal and remounting, but the new presentation must preserve the shell's single-announcement contract.

Full review comments:

  • [P2] Keep desktop connection announcements in the shell — ui/src/pages/chat/chat-pane-header.ts:453-454
    On a desktop conversation with no saved messages, a connection lasting over two seconds now populates this fallback with connecting. That mounts the header's .chat-pane__connection-state live region (role="status", aria-live="polite") while app-shell-view.tsx independently announces the same shared status through its always-mounted live region. Previously this desktop case had neither an injected gatewayStatus nor the saved-conversation fallback, so it did not create the second announcement. Subsequent status transitions can therefore be announced twice, contrary to the single-announcement design recorded in feat(ui): show the Gateway connection state in the sidebar footer #174022. Keep the visible header feedback, but use the existing shell as its announcement owner and cover that distinction in the regression.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Cached conversation reconnect inference changes intended behavior with a stated reason (368b9dc: Show saved conversations before the Gateway connects while keeping remote content gated until admission.)
  • Shared connection lifecycle presentation changes intended behavior with a stated reason (017eb0d: Consolidate lifecycle status and suppress transient initial recovery feedback.)
  • Desktop session-action visibility during outages changes intended behavior with a stated reason (feat(ui): add responsive session headers and detail panels #176653: Coordinate responsive header controls and retained mobile Details navigation; later compact-header work preserved outage notices.)
  • Retained Gateway presentation keeps the original intent (98d893a: Retain readable presentation during transport loss while independently gating actions on live authority.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

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

PR surface

Source +2, Tests +148, Docs +7, Other +12. Total +169 across 13 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 6 39 37 +2
Tests 4 152 4 +148
Docs 1 8 1 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 2 12 0 +12
Total 13 211 42 +169

Labels

Label changes:

  • add P2: This is a bounded header-stability improvement with an introduced accessibility defect, without evidence of broken message delivery or core availability.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a bounded header-stability improvement with an introduced accessibility defect, without evidence of broken message delivery or core availability.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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, 1:54 PM ET / 17:54 UTC.

@steipete steipete closed this Oct 31, 2026
@steipete steipete changed the title experiment(control-ui): reconnect indicator grace [do not merge] fix(control-ui): show reconnect feedback only for real connection delays Oct 31, 2026
@steipete steipete changed the title fix(control-ui): show reconnect feedback only for real connection delays experiment(control-ui): reconnect indicator grace Oct 31, 2026
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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant