Repository navigation
fix(ui): load selected chats before background session lists - #146591
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. Reviewed September 13, 2026, 1:35 AM ET / 05:35 UTC (Revision 4). ClawSweeper reviewWhat this changesThe Control UI prioritizes the selected chat over automatic session lists, preserves refresh and recovery behavior, and loads Skill Workshop translations with its lazy views. Merge readiness✅ Ready for maintainer review This remains useful work beyond current main. The earlier subscription finding is resolved, and the latest fixture-only update introduces no actionable defect. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives routes, session selections, and Gateway events. Its connection scheduler coordinates background reads while chat and sidebar owners publish their own results. flowchart TD
A[Route and selected chat] --> B[Connection scheduler]
C[Gateway connection] --> B
D[Transcript ready or visibly failed] --> B
B --> E[Automatic session lists]
C --> F[Live session events]
F --> G[Chat and sidebar views]
E --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +459, Tests +1341, Docs +2, Other +3. Total +1805 across 80 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep startup admission in the existing connection scheduler while session owners retain query scope, explicit actions, and visible recovery. Do we have a high-confidence way to reproduce the issue? Yes: the browser scenario holds selected-chat startup and bulk list replies, then checks transcript readiness, live messages, and explicit actions. This review inspected that scenario and its captures without executing it. Is this the best way to solve the issue? Yes. Extending the existing scheduler and retaining query ownership is a maintainable way to prioritize chat without introducing competing session state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b86bcb7dd218. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Register session events immediately and defer automatic roster, catalog, and Swarm hydration until selected native history is ready or fails. Keep scope replacement, trailing refresh, and lazy-import resubmission with their existing owners so startup priority does not drop later work.
Keep automatic roster successors behind the selected transcript while preserving explicit refresh, pagination, and retry behavior. Let the primary request owner coalesce selection and hydration, and retain managed invalidations across new foreground holds. Preserve completed history across cache eviction, keep failed-history Retry with its owner, refresh selected runtime descriptors independently of bulk lists, and retain exact-run terminal reconciliation on reconnect. Repair canonical browser fixtures exposed by the new ordering. Load Skill Workshop English with its lazy consumers while preserving the complete composed catalog and the existing startup-size budget.
9d911b7 to
f5ced56
Compare
Keep live descriptor observations current after invalidation, retain failed child refreshes until explicit retry, and invalidate the existing roster query when a model picker catalog completes instead of replacing it. Validation: 265 focused tests, changed checks, production UI build, unchanged startup-size gate, and independent P2 review passed.
Cloud placement failure cleanup must invalidate existing session queries instead of issuing an unscoped refresh that consumes a held bootstrap. Preserve the visible recovery error and explicit Retry. Validation: 323 focused tests, 10 bundled browser cases, changed checks, production build, unchanged startup-size gate, and independent P2 review.
|
Merged via squash.
|
…w#146591) * fix(ui): load selected chats before background task lists Register session events immediately and defer automatic roster, catalog, and Swarm hydration until selected native history is ready or fails. Keep scope replacement, trailing refresh, and lazy-import resubmission with their existing owners so startup priority does not drop later work. * fix(ui): preserve chat startup priority through recovery Keep automatic roster successors behind the selected transcript while preserving explicit refresh, pagination, and retry behavior. Let the primary request owner coalesce selection and hydration, and retain managed invalidations across new foreground holds. Preserve completed history across cache eviction, keep failed-history Retry with its owner, refresh selected runtime descriptors independently of bulk lists, and retain exact-run terminal reconciliation on reconnect. Repair canonical browser fixtures exposed by the new ordering. Load Skill Workshop English with its lazy consumers while preserving the complete composed catalog and the existing startup-size budget. * fix(ui): preserve session state across deferred startup Keep live descriptor observations current after invalidation, retain failed child refreshes until explicit retry, and invalidate the existing roster query when a model picker catalog completes instead of replacing it. Validation: 265 focused tests, changed checks, production UI build, unchanged startup-size gate, and independent P2 review passed. * fix(ui): keep the selected sidebar through cloud recovery Cloud placement failure cleanup must invalidate existing session queries instead of issuing an unscoped refresh that consumes a held bootstrap. Preserve the visible recovery error and explicit Retry. Validation: 323 focused tests, 10 bundled browser cases, changed checks, production build, unchanged startup-size gate, and independent P2 review. * test(ui): complete the model picker session fixture
The final digest rendered correctly, but the test captured zero matching sessions.list requests before initial roster bootstrap was released. Its no-extra-read assertion then mistook the first roster read for an event reload (expected length 0, received 1). Introducing ordering: b023df8 (#146591) prioritizes selected chat history over automatic background lists. A selected descriptor can already render the sidebar row while chat.startup still holds that first list. Hold chat.startup to exercise the early descriptor path, release it, then wait for a second row available only from roster admission before recording the request baseline. Preserve the exact final-digest and no-extra-list-read assertions. No production change, retry, timeout increase, or sleep is added. Probe evidence on main 1a94ee9: - Original whole file: 5 passed, target failed with the CI 0-to-1 signature. - Holding startup until after the final digest deterministically reproduces the same failure; the final digest is visible before the assertion fails. - The identical probe passes with only the background-startup gate introduced by b023df8 temporarily removed. That production change was reverted. - Suspect-range samples before and at b7e2666 and at 3a306a4 pass the unmodified file. Snapshot stamping is not the stale-digest cause: static list fixtures already seed canonical descriptors, and the digest renders. - Full replay at b023df8 cannot build with the installed dependency set (missing historical ms dependency); no dependencies were installed. The attribution uses its parent-relative patch plus the isolated gate control. Validation: - Complete sidebar presentation E2E file: 6 passed, 49.08s wall including bundle build; changed scenario 1.405s. - Bootstrap, sidebar narration, roster event and reconciliation owners: 4 files / 107 tests passed, one worker, 29.23s runner wall. - pnpm tsgo:ui, oxfmt, targeted core-tsconfig oxlint, git diff --check. - Line-cap, max-lines suppression and assertion-safety ratchets pass. The combined max-lines command also reports the existing environment-name budget failure (484 vs 483), reproduced from the untouched HEAD index. - Independent Codex autoreview: scoped-clean through P2. Release-note context: test reliability only; product behavior is unchanged.
The final digest rendered correctly, but the test captured zero matching sessions.list requests before initial roster bootstrap was released. Its no-extra-read assertion then mistook the first roster read for an event reload (expected length 0, received 1). Introducing ordering: 6474f32 (openclaw#146591) prioritizes selected chat history over automatic background lists. A selected descriptor can already render the sidebar row while chat.startup still holds that first list. Hold chat.startup to exercise the early descriptor path, release it, then wait for a second row available only from roster admission before recording the request baseline. Preserve the exact final-digest and no-extra-list-read assertions. No production change, retry, timeout increase, or sleep is added. Probe evidence on main 5405301: - Original whole file: 5 passed, target failed with the CI 0-to-1 signature. - Holding startup until after the final digest deterministically reproduces the same failure; the final digest is visible before the assertion fails. - The identical probe passes with only the background-startup gate introduced by 6474f32 temporarily removed. That production change was reverted. - Suspect-range samples before and at 2642b2d and at d50e9f2 pass the unmodified file. Snapshot stamping is not the stale-digest cause: static list fixtures already seed canonical descriptors, and the digest renders. - Full replay at 6474f32 cannot build with the installed dependency set (missing historical ms dependency); no dependencies were installed. The attribution uses its parent-relative patch plus the isolated gate control. Validation: - Complete sidebar presentation E2E file: 6 passed, 49.08s wall including bundle build; changed scenario 1.405s. - Bootstrap, sidebar narration, roster event and reconciliation owners: 4 files / 107 tests passed, one worker, 29.23s runner wall. - pnpm tsgo:ui, oxfmt, targeted core-tsconfig oxlint, git diff --check. - Line-cap, max-lines suppression and assertion-safety ratchets pass. The combined max-lines command also reports the existing environment-name budget failure (484 vs 483), reproduced from the untouched HEAD index. - Independent Codex autoreview: scoped-clean through P2. Release-note context: test reliability only; product behavior is unchanged.
What Problem This Solves
Automatic sidebar rosters, catalog discovery, and Swarm reads can compete with a selected chat's startup on a busy Gateway. This change lets the selected transcript and composer become usable before those background reads finish.
User Impact
Session events remain subscribed during startup. Explicit refreshes, filters, pagination, and retries stay available, and automatic reads resume after the selected transcript succeeds, fails visibly, or is left by navigation. Empty conversations also release background work correctly.
Why This Change Was Made
The connection coordinator owns admission; session, catalog, and pane owners retain their own pending work. The primary roster uses one queue for explicit actions, automatic hydration, and current agent selection. Each automatic successor obtains fresh admission, including when another chat is selected during an active read. Event registration uses acknowledgement-only subscription followed by separately admitted roster hydration. Model-picker catalog completion and cloud placement failure cleanup invalidate the existing roster query. This preserves selected filters and a held bootstrap instead of replacing them with an unscoped or pane-derived query. Cloud recovery keeps its visible error and explicit Retry.
Removing early roster reads exposed lifecycle assumptions that are repaired at their owners. The selected descriptor refreshes independently on global runner-availability changes, preserving newer facts against stale startup responses. Cache eviction retires cache readers without resetting a successfully loaded transcript; explicit session reset keeps its existing behavior. Background outbox wakeups preserve a failed transcript's visible Retry action, and reconnect reconciliation retains the terminal receipt for the exact owned run. Routed descriptor projections carry the producing event revision while retaining read provenance, so a valid live update survives an older invalidated descriptor read. Failed child refreshes retain visible rows and an explicit Retry without keeping a stale loaded marker.
Skill Workshop English now loads with its existing lazy editor consumers. The complete composed English catalog is byte-identical, and eager navigation labels remain available.
This preserves the managed child-query lifecycle, pagination, provenance, and explicit retry from #146410. No Gateway protocol or configuration changes are required.
Evidence
The earlier published candidate passed 69 bundled browser cases across startup priority, owner-first hydration, reconnect recovery, sidebar stability, identity links, cloud placement/reload, runner freshness, loading deadlines, and Skill Workshop. The startup cases verify an authoritative selected transcript, selected-message subscription, live peer message, and editable draft while bulk replies are held. The runner test rejects an invalidated descriptor reply and later stale startup without losing the visible current row.
152 primary roster/observation tests, 138 cache/history/prefetch tests, and 108 Skill Workshop tests pass. Regressions were demonstrated failing before their repairs. The combined CI repair passes 323 tests across ten catalog, bootstrap, selection, placement recovery, sidebar, and observation files, plus all ten bundled cloud-dispatch, startup-priority, and model-picker browser cases present on this branch. The picker-control fixture correction also passes a 163-test paired run without unhandled errors. Eight regression cases fail before their catalog or recovery repair and pass afterward; catalog coverage includes settled and competing filtered queries plus a scoped bootstrap held behind selected history. The production build passes the unchanged startup-size gate at 354,194 gzip bytes across 8 JavaScript requests (limit: 355,719 bytes). Independent P2 review found no actionable findings in the complete published candidate and in the complete nine-file CI repair and the final picker fixture correction.
Exact-head CI passed on
769d29e85eeb, including all 56 real-Gateway cases in 28 files. Its first attempt had one Canvas-heading timeout; the exact merge passed a Linux replay with the same prebuilt setup, system Chromium, and both overlapping sibling suites, followed by a successful unchanged-head CI rerun. The original timeout remains unattributed; test deadlines and assertions were unchanged.The following synthetic captures show pending and completed transcript states while bulk replies remain held. They demonstrate request ordering and usable chat, not a production latency benchmark.
Selected chat startup pending:
Selected transcript, live peer message, and editable draft ready while bulk replies remain held: