Repository navigation
fix(control-ui): show reconnect feedback only for real connection delays - #189645
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 changes before merge. What this changesThis PR suppresses brief initial connection feedback and retains desktop header controls during connection failures. Example: A cached conversation reconnects 800 ms after a warm reload.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this maintainer-authored PR open: the focused fix addresses a current presentation problem, but duplicate connection announcements and contradictory documentation need correction. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Gateway store publishes connection facts, the shared status resolver derives feedback, and the shell and conversation header present it alongside cached content. flowchart LR
A[Gateway client] --> B[Gateway store]
B --> C[Shared status resolver]
C --> D[Shell feedback and announcements]
C --> E[Conversation header]
F[Cached conversation] --> E
E --> G[Retained controls]
Technical reviewBest possible solution: Keep the shared grace and retained controls, preserve the shell as the sole announcement owner, and align the warm-reload guide. Do we have a high-confidence way to reproduce the issue? The base header derives reconnecting from cached messages independently of connection grace, establishing the flash path in source; this review ran no target code. Is this the best way to solve the issue? Reusing the Gateway store timer and shared resolver is the smallest complete approach, provided visible header feedback does not become a second announcement owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a31d9039928c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +2, Tests +148, Docs +7, Other +12. Total +169 across 13 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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, 2:40 PM ET / 18:40 UTC. |
7aab54b to
a70828e
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. |
a70828e to
98fa417
Compare
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.
98fa417 to
b7f9de1
Compare
The desktop header indicator now renders without its own live region; the shell's sr-only status remains the single announcer. Align the warm-reload guide with the indicator inputs.
…ays (openclaw#189645) Warm reloads no longer flash "Saved conversation · Reconnecting…" or shift header controls during a healthy initial connection: the initial connection keeps the Gateway store's two-second grace, while an observed close/failure shows feedback immediately and through retries. History loading and route resolution no longer imply a lost connection. Cached conversations keep their header controls; the indicator fills the header's existing gap without moving controls. The app shell's live region remains the single connection announcer. Surface: Control UI chat/dashboard header (desktop + mobile), offline/reconnect docs. Evidence: indicator flash removed on 22/22 warm reloads (median indicator frames 9 -> 0), dashboard LoAF/hello within A/A, real Chromium outage proof (Gateway stopped at reload, mid-session socket loss) with screenshots in the PR; exact-head CI green on b7f9de1; runtime +23 LOC.
What Problem This Solves
The original campaign measured 14 visible startup states over about 15 seconds on a signed-in reload of a dashboard deep link. This PR addresses one remaining warm-reload artifact.
An ordinary signed-in warm reload of a chat or dashboard deep link flashed “Saved conversation · Reconnecting…” despite a healthy connection. Cached history and pending route resolution manufactured this status independently of the Gateway owner.
User Impact
Normal warm reloads retain their cached content without a connection-status flash. Slow and failed connections show feedback inside the header without moving its controls or covering conversation rows. Real socket loss produces feedback immediately and retains it through retries until hello succeeds.
Identity and action hydration remain separate follow-up work. The fully offline dashboard screenshot shows the HTML widget's connection-waiting view; cached transcript, sidebar and chrome remain visible. This PR does not claim the broader cached-page campaign is complete.
Why This Change Was Made
The header now consumes shared Gateway status and its existing two-second initial grace. An observed socket close ends that grace immediately. Cached messages only qualify the label; they no longer invent connection state. The existing action region retains its flexible width and holds feedback in its available gap. Desktop controls stay mounted during recovery.
No new timer, config option, transport/backoff/liveness policy, Gateway protocol or durable state change. The existing grace comfortably covers the normal sub-second handshake. An inexpensive connected check also keeps transcript projection out of connected header rendering.
Release-note context: Control UI warm reloads no longer flash reconnect feedback during an ordinary initial handshake; slow or failed connections remain visible without displacing header controls.
Evidence
Head:
b7f9de1604be6c4f7580377ff4dc18e397712455; pinned main:9e3b867810d470abf8b39af2eafa1a56dd7b49c3.AWS lease
cbx_32579014eeca, fixedc7a.4xlarge, runrun_76c22858145aa9efced0ad765236afe3. Both arms use the same Chromium and server; baseline reverses only this PR's six UI runtime files. Team-scale archived-session fixture, live-fast latency, category / involving-me / created, 97 groups, 102 section-order entries, five collapsed sections, empty groups always, preview off, pinned sessions. Unprofiled, 11 interleaved pairs per comparison.Across all 22 candidate warm reloads, indicator frames were zero (11 chat, 11 dashboard). Every baseline reload showed 8–11 sampled indicator frames. Attributed header shifts decrease from 3 to 2; remaining identity/action hydration belongs to the separate follow-up.
The portal invocation contains the Team-scale comparison and native regression proof. It stopped at fixture readiness: an earlier chat snapshot could satisfy the dashboard setup check. Real outage proof and remaining validation continued on the same retained lease and unchanged head, with clean-tree assertions and active-conversation persistence verified through the existing cache owner.
Dashboard A/A control and secondary gate
The predeclared conservative stop gate is at least 8/11 worse candidate pairs with paired median exceeding the positive A/A upper quartile. Full paired arrays below expose the noise spread.
Team-scale bench
All time metrics are milliseconds; shift sum is unitless. Values are median [IQR].
Real Gateway timing gates
Same box and Chromium, 3,000 synthetic sessions, 80 ms RTT setting, 11 interleaved warm pairs on both routes. Hello handled is the client handler milestone; final rows is DOM completion. Values are median [IQR], milliseconds except CLS.
The positive secondary deltas remain visible in these tables. Real-Gateway dashboard FCP and first painted rows are +21.25 / +20.10 ms paired, with 9/11 worse pairs, below their approximately 32 ms (3%) thresholds and with overlapping IQRs. Chat final-row DOM completion is +39.44 ms paired with 8/11 worse pairs and overlapping IQRs. These do not reach the declared regression criteria. The primary improvement is the absent reconnect flash on 22/22 candidate reloads.
All per-pair candidate − baseline deltas
-2.1, 109.3, 12.3, 83.8, 7.9, 11.4, -78.7, -66.1, -88.8, -23.9, 136.7; range-88.8…136.7.-59, 57, -43, -39, -31, 65, -35, -18, -84, 38, 33; range-84…65.-9, -8, -8, -10, -9, -10, -9, -10, -9, -10, -8.-1, 0, -1, -1, -1, -1, -1, -1, 0, -1, 0.-9.7, 5.2, -4.2, -19.3, -0.1, 12.9, 29.2, -9.9, 26, -16.5, -6.8.8, 4, 4, -4, 4, 4, 0, 8, -4, 8, 8.-8, -4, -24, -28, -4, -8, 16, -4, 16, 0, -12.44, -62, -66, -33, -15, 55, 14, -58, -3, -21, -7.-0.0146, -0.0138, -0.0146, -0.0146, -0.0146, -0.0146, -0.0146, -0.0146, -0.0138, -0.0146, -0.0138.-11, -10, -10, -9, -9, -9, -8, -8, -10, -8, -8.-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1.128.3, -1.1, 17.2, 13.9, 0.1, 23.3, -92.1, -15.4, -16.7, 3.1, 111.6.4, 4, 8, 4, 8, 4, 8, 0, 4, 0, 12.20, 0, -20, -16, -4, 24, -16, -16, 12, 4, 24.70, -4, -13, 15, 45, 73, -54, -17, -26, 1, 38.-0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107, -0.0107.-45.8, -27.97, -0.41, -54.09, 12.94, 4.2, 28.93, 16.26, -25.78, -69.06, 12.34.46.23, -68.45, 134.48, -98.66, -53.7, 75.75, -51.73, -82.06, 105.51, 32.1, 171.39.43.9, -67.87, 131.89, -99.99, -51.96, 76, -51.97, -79.94, 108.02, 32.04, 171.84.23, 47.33, 130.39, -50.99, -121.86, 118.8, -36.77, 29.66, 133.62, 39.44, 88.74.-44, -38.2, 55.1, -53.4, 20, 2.7, 30.6, 5.5, -46.7, 24.3, 16.4.-0.0032, 0, -0.0038, -0.0032, 0, -0.0034, 0, 0, -0.0032, -0.0032, -0.0032.-43.35, -126.75, 6.78, -40.5, -51.04, -26.58, -28.99, -129.93, 99, -109.2, 57.42.-26.25, 110.18, 11.62, 21.25, 62.21, 26.94, 72.12, -51.83, 1.83, 14.19, 65.4.-28.15, 112.05, 8.08, 20.1, 59.96, 24.02, 71.81, -47.93, 4, 12.1, 67.92.-45.15, -5.15, -7.42, -40.5, 83.46, -29.08, 109.51, 29.77, -30.1, 50.8, 57.02.-33.2, -85.4, 15.7, -57.5, -12.9, -24.8, 6, -66.8, 64.8, -56.3, 51.4.-0.0019, -0.0019, -0.0019, -0.0019, -0.0019, -0.0021, -0.0021, -0.0019, -0.0019, -0.0021, -0.0019.Actual offline and socket-loss proof
Real Chromium against an isolated real loopback Gateway. Before each outage, the fixture waits for the active conversation’s snapshot to persist through its existing owner. Full browser offline mode then exercises the installed service worker and that persisted snapshot. A transparent proxy destroys the established socket and blocks retries until released; it never synthesizes Gateway replies.
The cached page paints during offline reload, with failure feedback well before the full two-second grace. Mid-session feedback remains through failed retries until a real hello. These times describe lifecycle observations, not a speedup comparison. All captures below were inspected in full and contain synthetic data only.
Validation
Exact-head CI run 41239333597 is green on
b7f9de1604be6c4f7580377ff4dc18e397712455. Fresh independent Codex autoreview after changed checks is clean through P2, as is the pre-commit review. CSS differential budget passes (+16 B raw, +19 B gzip; no budget raise).The native two-route regression passes on the candidate; both baseline scenarios fail at the intended initial-indicator assertion (expected zero, received one). The original gateway-status e2e passes all four cases with its mobile drawer assertion unchanged; its pinned-main-runtime control also passes. Focused shell-view, document-title, and Gateway observer consumers pass.
--maxWorkers=1)pnpm test ui/src/e2e/chat-header-connection.e2e.test.tspnpm test ui/src/pages/chat/components/chat-pane-header.browser.test.tsxOPENCLAW_UI_WEBKIT=1 pnpm --dir ui test src/pages/chat/components/chat-pane-header.browser.test.tsx --project=webkitpnpm test ui/src/e2e/gateway-status.e2e.test.tspnpm test ui/src/app/gateway-store.retention.test.tspnpm test ui/src/lib/gateway-status.test.tspnpm test ui/src/pages/chat/components/chat-pane-header.test.tsxnode scripts/check-changed.mjsran to completion. All gates passed except the production unused-export scan:src/plugins/plugin-source-snapshot-artifact.ts: publishPluginSourceSnapshot. This file is untouched by the PR. The identical scan (pnpm deadcode:exports) on clean, detached pinned main9e3b867810d470abf8b39af2eafa1a56dd7b49c3reports the same unused export; this is an inherited main failure.The full UI suite ran once on the final head with
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts: 878 files passed, 3 failed, 3 skipped (884); 3348 tests passed, 4 failed, 4 skipped (3356), 5555.84 s. The suite's real-Gateway warm chat/dashboard reload and cold-reload composer-geometry files passed.Failed files are checked individually with the same suite configuration and
--maxWorkers=1from clean pinned main on the same lease:ui/src/e2e/chat-pull-requests.e2e.test.tsui/src/e2e/quiet-automations.real-gateway.e2e.test.tsextensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.tsNo retry, expected-failure annotation, test relaxation, or unrelated production repair was made. Full-suite file inventory follows; names omit the common
.e2e.test.tssuffix.Failed: 3 files
extensions/qa-lab/src/ui/src/e2e/Skipped by existing suite conditions: 3 files
ui/src/e2e/Passed: 878 files
extensions/qa-lab/src/ui/src/ui/src/e2e/ui/src/pages/agents-home/ui/src/pages/chat/ui/src/pages/chat/components/ui/src/pages/cron/ui/src/pages/lobsterdex/ui/src/pages/plugins/ui/src/pages/secrets/ui/src/pages/templates/ui/src/pages/workboard/ui/src/test-helpers/Production and test cost
UI runtime net +13 lines, reusable diagnostic +10. The requested non-test/non-doc stat is 144 additions / 118 deletions, net +26, including the two-line allocation and one added narrow browser fixture line. Runtime/diagnostic source growth is +23 lines. The small growth reserves the flexible feedback slot and makes observed failure immediate while deleting the competing cached-history status fallback and desktop menu-hiding policy. Existing late-action reservation remains covered in Chromium and WebKit.
The exact test allocation is 155 net LF lines, with no slack or shared scalar bump: owner normal/slow/failed grace regression, updated status table, and native two-route lifecycle/geometry/containment regression, plus offline feedback in the existing narrow desktop fixture. The diagnostic stays because
bench-control-ui-cold-load.tscalls it through--pane-chrome-probe; indicator frames and identity attribution are reusable by the follow-up lane.Inspected synthetic screenshots
All captures are synthetic and were inspected in full. Native before/after images deliberately hold hello to expose boot feedback; identity hydration is separate from this indicator assertion.