Repository navigation
perf(ui): parallelize session-switch hydration - #114338
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 1:36 AM ET / 05:36 UTC. ClawSweeper reviewWhat this changesThis PR starts Control UI chat metadata alongside transcript startup and defers branches, discussion, companion, and pull-request hydration until the transcript has committed, aiming to make session switching responsive sooner. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open for explicit maintainer handling and real browser behavior proof. The patch has focused concurrency guards and contributor-reported automated coverage, but the available evidence only demonstrates mocked-browser behavior rather than an inspectable after-fix Control UI session-switch run; the Priority: P2 Review scores
Verification
How this fits togetherWhen a user switches sessions in the Control UI, the chat pane loads the transcript and then refreshes optional session-specific panels. This PR keeps transcript-critical startup on the first-render path while scheduling optional panels after the render commit and rejecting stale responses from prior sessions or connections. flowchart LR
A[User switches session] --> B[Start transcript and metadata requests]
B --> C[Commit transcript render]
C --> D[Check session and connection identity]
D --> E[Hydrate branches and discussion]
D --> F[Hydrate companion and pull requests]
E --> G[Updated session panels]
F --> G
Decision needed
Why: The patch changes ordering across several per-session UI surfaces, and the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +98, Tests +255. Total +353 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Proof path suggestionMantis can provide targeted web UI chat proof that the transcript becomes usable before the deferred session panels finish hydrating. Mantis is proof-only, so it must not be asked to change code or mutate GitHub state. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the guarded deferred-hydration design, rebase or refresh it against current Do we have a high-confidence way to reproduce the issue? Not applicable: this PR targets responsiveness rather than a separately specified broken behavior. The reported performance path is concrete, but the supplied evidence does not include an inspectable live reproduction or after-fix trace. Is this the best way to solve the issue? Unclear: deferring non-transcript hydration behind the render commit is a plausible bounded solution, but it needs real Control UI proof on a refreshed head to establish that this is the safest ordering across reconnect and fast-switch paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d3e043751aed. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* perf(ui): parallelize session switch hydration * test(ui): cover reconnect session hydration * test(ui): give hydration request mocks real signatures
What Problem This Solves
Switching sessions in the Control UI triggers a burst of RPCs whose server-side costs stack when serialized. Production averages on team.openclaw.ai:
chat.startup436ms,sessions.branches.list341ms,session.discussion.info312ms,sessions.messages.subscribe292ms,sessions.companion.state212ms,chat.metadata137ms. With the previous await structure, secondary hydration gated on earlier calls, so perceived switch latency trended toward the sum (~1.7s) rather than the max (~450ms).Why This Change Was Made
Hydration is now split into a critical path and a deferred set:
chat.metadatastarts concurrently withchat.startupinstead of after it, with coordination so startup-provided metadata and the parallel fetch cannot fight (including the compatible model/command fallback path inchat-state-refresh.ts).No server, protocol, or config changes.
User Impact
Session switching renders the chat pane on the critical path only — roughly the slowest single call instead of the whole chain. Deferred panels hydrate immediately after, without blocking input.
Evidence
chat.metadatastarts whilechat.startupis held open.chat.startupheld open).gpt-5.6-sol, xhigh): three fallback/reconnect findings accepted and fixed during the work; final pass clean, "patch is correct (0.9)".