Repository navigation
test(ui): measure usable first-run replies without losing RPC events - #194958
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 lowers the browser reconnect backoff seed from 800 ms to 700 ms after an authenticated expected-restart announcement. Example: A connected browser receives shutdown with restartExpectedMs: 1500, then disconnects.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open; the focused reconnect optimization is distinct from the merged layout fix, and no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGatewayBrowserClient translates browser connection policy into the shared GatewayProtocolClient, which owns WebSocket handshakes, reconnect scheduling, jitter, cancellation, and server retry floors. flowchart LR
A[Gateway restart announcement] --> B[Browser connection adapter]
B --> C[Shared protocol client]
C --> D[Retry supervisor]
D --> E[WebSocket reconnect]
E --> F[Accepted hello and usable Chat]
Technical reviewBest possible solution: Retain the existing reconnect owner and ship the narrow announced-restart adjustment only if it meets the declared performance acceptance. Do we have a high-confidence way to reproduce the issue? Source establishes the existing 800 ms reconnect seed and the proposed announced-restart exception; the linked investigation reports a repeated reconnect tail, but this review ran no product code or tests. Is this the best way to solve the issue? The change is a small, coherent performance experiment using the existing retry owner; the helper extraction preserves synchronous hello delivery and the regression distinguishes announced from ordinary reconnects. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0b4fc062a553. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests 0. Total +8 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 7, 2026, 10:32 PM ET / November 8, 2026, 03:32 UTC. |
Wait on animation frames for the expected reply and enabled composer, and drain first-run RPC records atomically. Withdraw the reconnect tuning that did not clear the recorded timing parity rule. Merge current main.
Codex Review Summary: ✅ CompletedThis 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. |
|
Merged via squash auto-merge.
|
…penclaw#194958) * perf(ui): shorten announced restart reconnect backoff * fix(perf): align first-run reply and RPC measurement windows
What problem this solves
The first-run benchmark could keep collecting renderer CPU for another 449–500 ms after a reply was visible because its locator wait backed off, and its readiness marker did not require the composer to be enabled. It also read the RPC record array and cleared it later, dropping shutdown/hello records that arrived between those operations (two WebKit restart pairs were missing in 20 journeys).
Result
Use the existing visible-control wait on animation frames, require both the new reply and enabled composer for reply readiness, retain exact synthetic-text assertions, and drain captured RPC records atomically. No production UI, reconnect policy, protocol, dependency, or bundle changes remain.
The final diff is two benchmark files: 1,923 → 1,926 lines (+19/−16). The existing helper owns the wait; no new state or abstraction is introduced.
Proof
ci:full; 42450147355 passed on exact head81961c955e1The benchmark's CLI cleanup still reports
Gateway shutdown was not acknowledged and cleanafter the completed journeys (accepted acknowledgment, process terminated by the existing watchdog). This remains a recorded local failure, not a passing exit code; it is outside this change and was not investigated here.Commands used the existing
scripts/bench-control-ui-rpc-payloads.ts --first-runworkload with immutable base/head bundles, headless engines, desktop localhost, fresh isolated state and synthetic provider data. Chromium ran the predeclared 20-triplet comparison plus one fixed 10-triplet extension; Firefox ran 20, and WebKit ran a three-triplet capture supplement. The original 35-condition first-run coverage includes desktop/mobile, localhost/100 ms RTT, and Chromium 1×/4×. No local full E2E suite was run.Investigation outcome
An experimental 700 ms announced-restart retry seed was removed before landing. It shortened Chromium shutdown→usable composer from 5,042.9 to 4,496.5 ms (30 pairs), but second-reply CPU p95 remained 257.9 → 272.1 ms (+5.5%) after the fixed extension; readiness p95 was 365.6 → 372.5 ms (+1.9%). A/A did not clear the recorded parity rule. This is not a claim of statistically proven harm; it is insufficient evidence to land the runtime change. No further resampling or remote performance-acceptance matrix was run after that failure.
Related landed fixes: provider-setup crash #194866 and activation layout stability #194914. This PR changes measurement only and makes no UI latency-win claim.