Repository navigation
fix(ui): stop repeated background metadata reads across chat panes - #146685
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, 12:42 PM ET / 16:42 UTC (Revision 17). ClawSweeper reviewWhat this changesThe Control UI shares metadata refreshes across visible chat panes, defers hidden panes, recovers interrupted model reads, and coordinates build replacement in browser-test fixtures. Merge readiness✅ Ready for maintainer review This remains a useful, distinct fix beyond the merged request-queue work. No actionable correctness or security defect was found in the pinned patch. Priority: P2 Review scores
Verification
How this fits togetherChat panes consume command and model metadata from the Gateway. The browser's shared stores coordinate these reads and publish scoped results to chat controls without replacing conversation state. flowchart TD
A[Gateway change events] --> B[Shared metadata store]
C[Pane and document visibility] --> B
B --> D{Visible demand?}
D -->|No| E[Defer until presented]
E --> C
D -->|Yes| F[Existing command and model queues]
F --> G[Current scoped chat controls]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +409, Tests +1763, Docs +2. Total +2174 across 30 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep presentation demand in the shared metadata owner while the existing command and model stores retain transport scheduling, cancellation, and publication. Do we have a high-confidence way to reproduce the issue? Yes, from source: retain three chats, show one, and emit a shared metadata-change event; current main refreshes all subscribed panes. The supplied browser regression reports this failure, but this read-only review did not execute it. Is this the best way to solve the issue? Yes. The patch extends the existing metadata owner, preserves the merged transport queues, and centralizes session-event invalidation without adding settings or a parallel request implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b076a15e5103. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
b91d7f5 to
21f5329
Compare
Share automatic metadata and model catalog refresh generations across panes and defer hidden views until presented. Preserve startup snapshots, in-flight settlement, and explicit retries while coalescing invalidations. Validated with 317 focused unit tests, 18 mocked Chromium scenarios, targeted owner regressions, full changed-file checks, UI test types, unchanged bundle budgets, and a clean independent review.
Keep startup catalog delivery and command metadata independent across early and late presentation changes. Let the current catalog result enable the picker while command metadata is pending, and route integration proof through the application shell owner. Validation: 673 unit/integration tests; cold and visibility browser regressions; ordered account-snapshot proof; real-Gateway palette recovery; full changed-file and UI test type checks; unchanged bundle budget; clean independent review through P2. Earlier broad local account-picker timeouts remain unattributed and were not hidden by timeout or assertion changes.
Raw bounding-box replay could hit the adjacent Manage row after popup placement moved. Hover the retained More row, verify pointer targeting, then send one mouse down/up pair while preserving all disabled, request-count, navigation, and keyboard assertions. Proven with the original 13-test-order failure trace, which delivered the second click to Manage, followed by all 13 tests passing. UI test types, changed-file checks, and independent review through P2 pass.
Keep an inactive startup command fallback behind its predecessor's transport settlement. Reobserve waiting demand through the same admission owner, and fence inherited catalog work with its creation revision so invalidation cannot publish an old catalog as current. Same-generation visibility return and explicit refresh remain immediate. Honor writer-owned pending state during explicit synchronous metadata error retry after the publication-owner integration. Validation: 53 metadata/catalog tests, 94 chat/app-host entrypoint cases, 14 metadata browser scenarios, UI test types, full changed-file checks, and independent full-diff review through P2. Startup gzip is 354949 bytes under the unchanged 355719-byte limit. Both hidden invalidation/remount regressions fail before the repair and pass afterward.
1d35ba4 to
77354b3
Compare
Move the complete managed worktree test family into the existing agents-tools graph. Preserve all canonical roots, graph identities, stripe assignments, compiler concurrency, and the existing 700-root target and 720-root cap.
Use the canonical createDeferred helper in the two remaining sidebar scope tests after the shared helper export was retired. Preserve the existing scope-replacement assertions.
Merge current main while retaining its command scheduling and scoped session reconciliation. Coalesce automatic catalog refreshes across retained panes, preserve transport settlement barriers, and recover omitted startup commands without duplicating catalog reads.
Let visible command demand adopt the existing queued publication through the command owner while preserving transport settlement barriers. Keep the skill activation request bound intact and repair catalog and hydration test fixtures exposed by CI.
Preserve the canonical catalog queue and caller deadlines while automatic metadata demand waits on its raw settlement receipts. Retain scoped invalidation and presentation ownership, and make preview build replacement drain its active response streams.
Include the landed reclamation-memory fixture repair from #147028. The 27 owned performance and test-infrastructure files remain identical to the reviewed candidate.
Merge the current CI baseline while preserving the command and model request owners. Keep bulk metadata invalidation, listeners, and consumer setup in their lazy stores, reuse prepared scope keys, and trim catalogs only where publication grows them. Preserve cold catalog demand when an ordinary session event retires a pending automatic, explicit, or picker read. Display accepted expired snapshots across shared panes without retrying, and report replacement failures once. Include the standalone E2E publication inventory repair.
Merge the current CI baseline and use the shared startup grouping from #147110. Preserve immediate model invalidation for session events while the existing lazy client store qualifies command metadata changes. Ordinary messages skip the full metadata parser.
Bring in #147110 through normal main history and preserve the reviewed metadata source. Retain main's CI workflow fixture environment updates.
|
Merged via squash.
|
…penclaw#146685) * fix(ui): stop repeated background metadata reads across chat panes Share automatic metadata and model catalog refresh generations across panes and defer hidden views until presented. Preserve startup snapshots, in-flight settlement, and explicit retries while coalescing invalidations. Validated with 317 focused unit tests, 18 mocked Chromium scenarios, targeted owner regressions, full changed-file checks, UI test types, unchanged bundle budgets, and a clean independent review. * fix(ui): preserve chat readiness during shared metadata refreshes Keep startup catalog delivery and command metadata independent across early and late presentation changes. Let the current catalog result enable the picker while command metadata is pending, and route integration proof through the application shell owner. Validation: 673 unit/integration tests; cold and visibility browser regressions; ordered account-snapshot proof; real-Gateway palette recovery; full changed-file and UI test type checks; unchanged bundle budget; clean independent review through P2. Earlier broad local account-picker timeouts remain unattributed and were not hidden by timeout or assertion changes. * test(ui): target pending account rows before pointer clicks Raw bounding-box replay could hit the adjacent Manage row after popup placement moved. Hover the retained More row, verify pointer targeting, then send one mouse down/up pair while preserving all disabled, request-count, navigation, and keyboard assertions. Proven with the original 13-test-order failure trace, which delivered the second click to Manage, followed by all 13 tests passing. UI test types, changed-file checks, and independent review through P2 pass. * fix(ui): preserve metadata startup settlement across visibility changes Keep an inactive startup command fallback behind its predecessor's transport settlement. Reobserve waiting demand through the same admission owner, and fence inherited catalog work with its creation revision so invalidation cannot publish an old catalog as current. Same-generation visibility return and explicit refresh remain immediate. Honor writer-owned pending state during explicit synchronous metadata error retry after the publication-owner integration. Validation: 53 metadata/catalog tests, 94 chat/app-host entrypoint cases, 14 metadata browser scenarios, UI test types, full changed-file checks, and independent full-diff review through P2. Startup gzip is 354949 bytes under the unchanged 355719-byte limit. Both hidden invalidation/remount regressions fail before the repair and pass afterward. * fix(ci): restore agent test graph headroom Move the complete managed worktree test family into the existing agents-tools graph. Preserve all canonical roots, graph identities, stripe assignments, compiler concurrency, and the existing 700-root target and 720-root cap. * fix(test): complete sidebar deferred helper migration Use the canonical createDeferred helper in the two remaining sidebar scope tests after the shared helper export was retired. Preserve the existing scope-replacement assertions. * test(ui): close file previews through their hosted tabs * fix(ui): retain queued metadata publication during invalidation Let visible command demand adopt the existing queued publication through the command owner while preserving transport settlement barriers. Keep the skill activation request bound intact and repair catalog and hydration test fixtures exposed by CI.
Related: #146410
What Problem This Solves
Hidden retained chats keep issuing command and model reads after shared metadata changes. With three retained chats and only one shown, one event starts three request pairs on main.
User Impact
Visible chats share the required metadata work; hidden chats catch up when shown. Repeated invalidations coalesce behind pending work, while explicit model recovery, startup commands, and scoped session facts remain available. A session update during a cold model read no longer leaves the picker blank. No configuration or migration is required.
Why This Change Was Made
The metadata coordinator observes presentation demand and waits for the existing command and model request owners, then rechecks scope and visibility before dispatch. Main's command queues (#146810) and raw model transport lanes (#146953) retain dispatch, deadlines, cancellation, publication, and connection retirement. Canonical cache notifications retire automatic attempts after expiry, refresh, eviction, or connection changes. Metadata bulk invalidation and listener delivery live in the existing lazy client store. The shell synchronously delegates to it without loading request code. Model settlement and subscription setup also stay with the lazy model store; notifications reuse prepared scope keys and eviction runs only at publication. Session events invalidate model projections immediately, while metadata-specific qualification runs inside the existing lazy store so ordinary messages skip the full metadata parser.
CI also exposed a Vite preview-fixture race during service-worker build replacement. The preview owner now pauses admission, drains responses and file streams, swaps or restores the directory, and resumes waiting requests. The real-Vite publication test runs in the existing standalone E2E process lane, with its routing inventory updated.
Evidence
The unchanged retained-pane browser cases fail on pinned main
8d37c8a52ff2c4de202d2c7d3f20f06737741997and pass on the integrated candidate:config.changedchat.metadata.changedValidation includes 863 focused owner/provider/chunking tests and all 17 mounted metadata/skill-library cases. These exercise hidden and remounted chats, held transports, donated snapshots, both settlement orders, queued command adoption, failed-attempt sharing, and explicit recovery. Shell regressions reproduce cold-load loss after a model-only session event, cover automatic/explicit/picker recovery and replacement failures, and ensure two panes share an accepted expired snapshot without another request.
The complete original 30-file gate and final five-file integration gate pass. Fresh full-diff review through P2 found no actionable issues. Main's startup grouping from #147110 is integrated through normal history; this PR changes no budget files. The controlled build against main
8d424f82171e28d474db1904afef669c9d7ec991passes at 355,071 bytes gzip across seven startup requests, below even the earlier 355,719-byte limit. CSS remains 46,117 bytes with zero growth. All 17 browser cases and the 566-test workflow guard file pass again after that main integration. Exact-head CI completed successfully fora199cbd00915de5db72337f00fc87d4fc2c35a05, including the requiredopenclaw/ci-gate.The seven publication/service-worker cases and 47 routing/sharding checks passed before the final metadata-only edits. The single routing-inventory repair independently reproduced red and passed its complete 566-test owner with two unchanged skips. A complete local UI run with Vitest's supported process pool finished in 156 seconds: 19,418 passed, two browser interaction failures independently reproduced on unmodified main, and one skip. Default shared-thread validation on macOS encountered a native FSEvents finalization problem; that is a local execution limitation, and hosted CI retains its normal configuration.
These synthetic results prove reduced duplicate RPCs, not final production page latency. The inspected captures preserve the same synthetic visible state; RPC assertions establish the request reduction.