Repository navigation
fix(ui): keep prefetched chats ready during unrelated session updates - #137947
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: blocked before merge. Reviewed September 4, 2026, 2:56 PM ET / 18:56 UTC. ClawSweeper reviewWhat this changesThe PR keeps prefetched Control UI chat history usable after unrelated sidebar session updates while rejecting results stale from connection, session, or cache changes. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: current main still invalidates this prefetch on any roster revision, while the PR replaces that with scoped connection, row, and cache validity checks. No actionable introduced defect was found; the maintainer-owned PR remains subject to its exact-head CI gate. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI prefetches recent Gateway chat transcripts into a local snapshot cache. Opening a chat can render that cache while fresh history loads, so the prefetcher must retain valid data without publishing stale data. flowchart LR
Gateway[Gateway session roster] --> Prefetch[Background transcript prefetch]
Connection[Connection lifecycle] --> Validity[Scoped validity checks]
Cache[Snapshot cache generation] --> Validity
Prefetch --> Validity
Sidebar[Unrelated sidebar refresh] --> Validity
Validity --> Chat[Opened chat renders cached history]
Decision needed
Why: The PR has a protected maintainer label and changes cache-publication behavior, so automated cleanup must not close or land it without explicit maintainer handling. Before merge
Agent review detailsSecurityNone. PR surfaceSource +28, Tests +345. Total +373 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the separate connection, row, and cache-generation ownership claims, then merge only after the exact-head CI gate is green. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main retires a held prefetch when any canonical roster revision changes, and the submitted browser test models an unrelated row update during that request. This read-only review did not execute the scenario. Is this the best way to solve the issue? Yes: the session capability owns connection lifecycle, the snapshot store owns cache invalidation, and per-key row checks replace the overly broad roster revision at the publication boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2b1fb5508ace. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
The remaining maintainer decision is resolved: retain the producer-owned connection, session-row and cache-generation checks. The net 33 production lines carry independent ownership facts that the old whole-roster revision conflated, and remove the separate activity scan. No additional state, setting, protocol or dependency is introduced. The final source matches the reviewed proof hashes. CI run 33842918991, attempt 2, and its aggregate gate are successful on exact Current-main qualification also covers the merged roster refresh repair: different-agent events are filtered earlier, while necessary same-agent and unscoped refreshes still reach this path. The two fixes complement each other. Retained Chromium evidence uses the built UI with a synthetic Gateway; it is not a new production latency measurement. The existing broader global/main snapshot-key routing follow-up remains separate. |
Merge current main into the existing prefetch repair while retaining serial background requests and visible transcript priority.
Merge current main into the existing prefetch branch while preserving its ancestry. Reuse the canonical test session capability so chat-page fixtures supply the current agent-selection owner and retain disposal. The unchanged attachment-handoff test reproduced the missing selection before this fixture repair; 85 owner and page-fixture tests and both Chromium prefetch cases pass on the merged tree.
Merge current main to include the landed strict-widget bootstrap and lazy provider-settings copy repairs. Keep all eight prefetch PR files byte-identical to the reviewed version and preserve branch ancestry. The existing widget sandbox case and both prefetch Chromium cases pass on the combined tree. Fresh independent P2 review has no findings.
|
The current maintainer decision is resolved: retain the separate connection, candidate-row and cache-generation claims. The final production delta is +28 lines; those facts replace the incorrect whole-roster invalidation and the separate activity scan. No new configuration, dependency, protocol or persisted representation is introduced. CI 33907845658 completed successfully on exact The PR body now reflects the final source, current proof and limitations. Earlier focused tests are reused through unchanged source bindings; synthetic browser evidence is not production latency proof. The broader global/main snapshot-key routing follow-up remains separate. |
|
Merged via squash.
|
…openclaw#137947) * fix(ui): keep prefetched chats ready during unrelated session updates * test(ui): use session lifecycle in chat page fixtures
* refactor(ui): consolidate page rendering and trim speculative recovery Reuse the canonical retained Lit-content owner for the composer, resolve New Session defaults through one owner, filter palette choices once, and render stacked/total usage bars through one rectangle path. Supported rendering, features, authorization and both migration paths remain intact. Remove duplicate warm-prefetch alias-clock validation and the debug panel's within-animation remeasurement/retargeting; keep their existing owners. Best-effort tradeoffs accepted: - Remove the companion post-rejoin history barrier from #125107. The synthetic initial-read/rejoin timing window has no cited human incident; a racing row appears on the next refresh/reopen/reconnect. Keep stable IDs, durable history, live wizard state and ambiguous-turn non-replay. - Remove old-Gateway system.info error classification from #114971. Core methods already share version and advertisement/read admission (#160982); unexpected unknown-method errors now remain visible and retry normally. - Remove warm-prefetch alias-clock comparisons from #137947's synthetic scenario. An unopened cached transcript may lag; foreground open still revalidates its cursor and retains account/identity/deletion ownership. - Remove debug body-size retargeting from #162315's synthetic E2E. A size change within the 160ms animation settles at finish; ordinary animation, reduced motion, drag/resize and same-mode continuity stay. Remove unused reconnect() left by the completed #170758 Solid cutover. Net production reduction: 181 lines; remove 107 mechanism-only test lines. Focused retained page/owner tests: 216 passed; synthetic capture: 1 passed. Expanded/minimized Debug frames are byte-identical before/after, inspected and synthetic. No changelog, schema, protocol, dependency or config change. * refactor(ui): consolidate sidebar and overlay presentation Use reactive JSX props for sidebar adapters, share rendered-ancestry observation between tooltips and hovercards, and consolidate picker placement and fixed menu rows. Keep the Lit/Solid shipping paths, DOM classes, text, authorization, focus, resource handling, and asynchronous overlay animation generations unchanged. Best-effort tradeoffs accepted: - Same-call show/hide listeners replacing or disconnecting their overlay no longer have intent-token fencing; the next ordinary request reconciles state. - Reopening from a native-close callback no longer triggers compensating reopen; the accepted close wins until a later ordinary user request. - Recursive self-retirement from a hide callback has no separate retirement protocol; ordinary disposal and descendant retirement are retained. - Children created during the parent's native-close callback receive no second late-child sweep; normal descendants retire before native mutation. These removed mechanisms came from synthetic callback cases in #169128, with no cited human actual-use incident. Preserve ordinary veto and browser input behavior; remove only the tests that pin the retired synchronous protocols. * refactor(ui): retain getter calls for new-session links * test(ui): align companion rejoin request expectation * refactor(ui): retain main overlay behavior after inconclusive replays * refactor(ui): retain main agent switcher after inconclusive replay Drop the agent-menu avatar/property cleanup after the WebKit scroll case failed in bundle CI but passed focused replays at both head and main. Preserve main's implementation under the coordinator's conservative-cut rule; do not claim the browser failure repaired.
…72582) * refactor(ui): consolidate page rendering and trim speculative recovery Reuse the canonical retained Lit-content owner for the composer, resolve New Session defaults through one owner, filter palette choices once, and render stacked/total usage bars through one rectangle path. Supported rendering, features, authorization and both migration paths remain intact. Remove duplicate warm-prefetch alias-clock validation and the debug panel's within-animation remeasurement/retargeting; keep their existing owners. Best-effort tradeoffs accepted: - Remove the companion post-rejoin history barrier from openclaw#125107. The synthetic initial-read/rejoin timing window has no cited human incident; a racing row appears on the next refresh/reopen/reconnect. Keep stable IDs, durable history, live wizard state and ambiguous-turn non-replay. - Remove old-Gateway system.info error classification from openclaw#114971. Core methods already share version and advertisement/read admission (openclaw#160982); unexpected unknown-method errors now remain visible and retry normally. - Remove warm-prefetch alias-clock comparisons from openclaw#137947's synthetic scenario. An unopened cached transcript may lag; foreground open still revalidates its cursor and retains account/identity/deletion ownership. - Remove debug body-size retargeting from openclaw#162315's synthetic E2E. A size change within the 160ms animation settles at finish; ordinary animation, reduced motion, drag/resize and same-mode continuity stay. Remove unused reconnect() left by the completed openclaw#170758 Solid cutover. Net production reduction: 181 lines; remove 107 mechanism-only test lines. Focused retained page/owner tests: 216 passed; synthetic capture: 1 passed. Expanded/minimized Debug frames are byte-identical before/after, inspected and synthetic. No changelog, schema, protocol, dependency or config change. * refactor(ui): consolidate sidebar and overlay presentation Use reactive JSX props for sidebar adapters, share rendered-ancestry observation between tooltips and hovercards, and consolidate picker placement and fixed menu rows. Keep the Lit/Solid shipping paths, DOM classes, text, authorization, focus, resource handling, and asynchronous overlay animation generations unchanged. Best-effort tradeoffs accepted: - Same-call show/hide listeners replacing or disconnecting their overlay no longer have intent-token fencing; the next ordinary request reconciles state. - Reopening from a native-close callback no longer triggers compensating reopen; the accepted close wins until a later ordinary user request. - Recursive self-retirement from a hide callback has no separate retirement protocol; ordinary disposal and descendant retirement are retained. - Children created during the parent's native-close callback receive no second late-child sweep; normal descendants retire before native mutation. These removed mechanisms came from synthetic callback cases in openclaw#169128, with no cited human actual-use incident. Preserve ordinary veto and browser input behavior; remove only the tests that pin the retired synchronous protocols. * refactor(ui): retain getter calls for new-session links * test(ui): align companion rejoin request expectation * refactor(ui): retain main overlay behavior after inconclusive replays * refactor(ui): retain main agent switcher after inconclusive replay Drop the agent-menu avatar/property cleanup after the WebKit scroll case failed in bundle CI but passed focused replays at both head and main. Preserve main's implementation under the coordinator's conservative-cut rule; do not claim the browser failure repaired.
What Problem This Solves
Opening a recently prefetched chat could show a loading skeleton when an unrelated session updated the sidebar while history was loading. The UI discarded usable history and could fetch it again after the prefetch cooldown.
Why This Change Was Made
The prefetch publication owner now carries the existing connection scope, captured session history and snapshot-cache generation instead of treating the entire roster revision as authority. One check validates every row sharing the snapshot key and requires the captured history to survive, so an unchanged alias cannot hide replacement, reset, newer activity or an active run. Owned synchronous hydration and cursor-reset writes renew only their cache claim. The separate activity scan is removed.
Production changes add 79/remove 51 lines (net 28); tests and test support add 349/remove 4 (net 345). The distinct connection, row and cache claims are necessary to retain useful work while fencing stale publication. Existing chat-page fixtures now use the canonical session capability and deterministic disposal. No configuration, dependency, protocol or stored representation changes.
User Impact
Unrelated session updates no longer discard a valid prefetch: the cached conversation can appear immediately while fresh startup is pending. Deletion, replacement, reconnect, profile or cache invalidation, newer history and active runs still retire stale work.
Evidence
The original unchanged-session regression failed before the repair. Additional alias failures drove coverage for replacement, conflicting aliases and deletion leaving an older alias. The final 85 owner/fixture tests and full 20-check changed gate passed on
5b24721; all eight feature postimages and relevant owner/dependency bindings are unchanged on97dc940.Fresh proof on
97dc940includes both Prefetch Chromium cases and the inherited widget/bootstrap case against the built UI with a synthetic Gateway, plus an independent P2 review with no actionable findings. The canonical candidate/base performance comparison passed at 349,001 startup JavaScript bytes, below the original 350,141-byte limit, with 8 requests, 43,900 bytes of CSS and 804 finalized sidecars verified. No assertions, timeouts or budgets were changed. Earlier CI 33905005327 used the older base and failed the inherited widget-navigation and startup-bundle checks; the candidate incorporates the already-landed #137342 repairs.Current native main
2b1fb550has identical eight feature preimages and qualified caller/build boundaries. The proof above measures97dc940, not a future merged tree or production Gateway latency. Exact-head CI 33907845658 and native landing remain separate gates.The captures show the original synthetic scenario before the alias refinement; the scenario is unchanged, and the later refinement has separate regression coverage. The fresh Chromium runs above verify the final composition.
A separate follow-up remains for global/main snapshot-key normalization versus canonical conversation routing. This change fences prefetch publication without changing cache keys or routing.