Repository navigation
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 24, 2026, 11:43 AM ET / 15:43 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR adds Gateway metadata relevance flags so the Control UI retains model and authentication caches on unrelated updates, while refreshing affected views and stabilizing a WebSocket admission test. Merge readiness✅ Ready for maintainer review Keep open. Current main still invalidates both browser caches on every metadata event, and the merged server-side preparation change does not remove those client RPCs. The earlier palette-skill finding is addressed; this review found no definite introduced defect. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway publishes changes to model, authentication, and skill metadata. The Control UI uses those events to refresh cached model choices, credential status, commands, and search results. flowchart LR
A[Config, auth, skills, catalog] --> B[Gateway metadata facts]
B --> C[Change relevance flags]
C --> D[Control UI event handler]
D --> E[Model and auth caches]
D --> F[Command and skill search]
E --> G[Pickers and sidebar]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +59, Tests +205, Docs +1. Total +265 across 23 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep Gateway metadata facts as the relevance owner and let each Control UI cache follow its own invalidation lifecycle; measure the post-deployment RPC rate to confirm the expected reduction. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows broad invalidation on every metadata event, and the PR reports a failing pre-fix 50-event shell regression; this read-only review did not execute it. Is this the best way to solve the issue? Yes. The Gateway derives relevance from its published facts, while browser consumers retain a conservative refresh path for events without the new flags. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5c13ecfcbf19. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
* commit '9a1a6f7db9783d0b8abaf918bfe12978ea745b57': (26 commits) fix(maintainer): restore cold PR worktree provisioning (#157394) feat(ios): establish native Cloudflare Access sign-in sessions (#146996) fix: restore the Gateway after interrupted Doctor maintenance (#156854) refactor(line): retire the Express webhook adapter (#157369) refactor(cron): consolidate unavailable delivery targets (#157393) ci: apply Go memory defaults to architecture checks fix(cli): preserve the first PowerShell completion test failure (#157267) refactor(agents): consolidate transcript-tail model selection (#157382) fix(release): honor frozen validation contracts (#157034) fix(perf): use settled Kova terminal CPU accounting (#157029) chore(windows): verify packaged repair worker lifecycle (#157047) refactor(logging): share memory pressure threshold selection (#157164) fix(release): verify bundled fs-safe native bindings (#157027) perf(skills): skip warm prompt search when minimum cannot fit (#157343) fix(ui): avoid retaining detached tooltip anchors (#157226) perf(ci): reuse compiler state and shorten guard and UI tests (#157265) perf(ui): preserve model caches on unrelated metadata updates (#157254) chore: remove the tracked PR-body artifact and ignore .artifacts (#157296) refactor: consolidate duplicate MCP lifecycle tests (#157360) test(qa): consolidate CLI runtime fixtures (#118496) ...
…aw#157254) * perf(ui): preserve model caches on unrelated metadata updates * perf(ui): complete metadata invalidation validation fixes * perf(ui): refresh palette skills independently of model caches
Related: #156784
What Problem This Solves
The Control UI discards cached model choices and authentication status on every
chat.metadata.changed, including skill changes and catalog-discovery settlement with unchanged credentials. A deployment sample recorded 5,098models.authStatuscalls/hour across 96 connections; sharing server preparation reduced server work but left redundant client RPCs.User Impact
Fewer background model/auth requests while retaining credential expiry warnings, account changes, catalog discovery progress, and refreshed commands. No configuration or visual changes. Net production growth: 59 lines.
Why This Change Was Made
The existing metadata owner compares its published config, auth metadata, and catalog facts and sends separate catalog/auth relevance flags. The shell always invalidates command metadata; model consumers and sidebar attention use the corresponding relevance decision. The command palette independently refreshes its combined skill/search results on metadata events while reusing current model choices.
Model-selection policy changes still clear choices. Personal-account/profile updates retain their intentional broad empty-payload notification. Reconnect/identity changes, explicit refreshes, matching
models.snapshotpublications, catalog cooldowns, and credential expiry deadlines keep their existing lifecycle. External owner replacement stays conservative because auth materializations can change without replacing the snapshot object. Session-scoped event delivery accepts only the bounded boolean flags.Source audit corrected the initial attribution: title/label/activity and session-model changes use
sessions.changed, notchat.metadata.changed. Fact capture moved into the existing metadata-facts owner to keep the runtime under its line cap.Evidence
Final head
7ac959bb993e1404728519489ede8599a89a081c: both requiredopenclaw/ci-gatechecks are SUCCESS. CI run 36021240023 passed in 1,216 s wall, and ClawSweeper marked this exact head ready with no actionable findings. The requested squash auto-merge command was refused locally (string rewrite protection blocked unsafe input), so auto-merge remains disabled and the PR is open.Before/after: 50 metadata-only publications through the real shell event handler caused 50 → 0 auth RPCs, 50 → 0 catalog RPCs, and 50 → 0 catalog notifications. Command metadata still invalidates. Config/auth changes each trigger exactly one shared reload; catalog-status settlement triggers one catalog reload and zero auth reloads. The regression failed on the original implementation for the expected redundant-request counts.
All heavy validation used Blacksmith Testbox, profile
openclaw-check:tbx_01m39g2jeq2ynfmg2jc0q58dqk(runner).node scripts/run-vitest.mjs ui/src/app/app-host.chat-metadata.test.ts --maxWorkers=1 -t 'retains model and auth reads across 50'failed as expected (3.99 s). The eight-file owner/cache/expiry proof then passed (53.10 s including cold compilation; UI shard 61 tests in 3.56 s).tbx_01m39hbwxjpe4kwa37jy8hnr2s(runner).node scripts/check-changed.mjs --base fe846d3c9498b855ae0d8bd3c95c318b12a04047passed all prerequisite guards, core/UI typechecks, all 25 test type graphs, and dead-export scans before reporting one boolean-style lint error. After the equivalent simplification, its exact planned lint/style/schema/database/media/sidecar/import-cycle/webhook/auth tail passed. No checks were disabled; passing proof was reused. Runtime import cycles: 0.pnpm test <file> --maxWorkers=1 --reporter=dot, 148 tests passed across seven files. The final lint/guard/test command exited 0 in 305.82 s.git diff --checkand changed-file formatting passed.tbx_01m39ngsyyzcebpz2cdsz5v7b8(runner).pnpm test ui/src/components/command-palette.metadata.test.ts --maxWorkers=1 --reporter=dotfailed with the renamed skill absent before the fix, then passed in 3.03 s wall. The mounted palette updates the skill name without anothermodels.listcall. The existing palette and shell suites also passed (90 tests, 5.36 s runner wall).node scripts/check-changed.mjs --base 8e954098b282a72f09d74f9a1e160b9519f90b1dpassed in full on that lease, including six affected test type graphs, UI typechecking, dead-export scans, formatting and lint. Combined regression/sibling-test/changed-check command exited 0 in 675.65 s. Fresh independent review was clean.tbx_01m39sp63vbq4zn8nndwwjb6xa(runner) passed 221 tests in 12 model/auth/palette/expiry/broadcast/integration files (61.88 s runner wall), followed by the complete targeted UI/docs changed checks. Combined command exited 0 in 866.26 s. This exercises main's independently loaded palette models together with retained-cache metadata events.src/gateway/server-broadcast-model-metadata.test.tssrc/gateway/server-chat-metadata-lifecycle.catalog-renewal.test.tssrc/gateway/server-chat-metadata-lifecycle.test.tssrc/gateway/server-methods/chat-metadata-runtime.refresh.test.tssrc/gateway/server-methods/chat-metadata-runtime.test.tsui/src/app/app-host.chat-metadata.test.tssrc/agents/prepared-model-catalog-worker.chat-metadata.integration.test.tsThe renewal command includes 17.94 s of cold worker compilation; its actual test execution was about 2.6 s. The existing integration test protects actual published-owner composition. No real timers, new serial configuration, or test-only production seams were added.
Validation recovery: fresh leases needed remote dependency installation. The first lease was retired after two checksum-sync timeouts; replacement
tbx_01m39h0tayas8zb1pknwqz176ycaught a moving-main comparison that included unrelated plugin changes. Pinning the lane base and pushed candidate resolved that. Validation also caught and fixed the runtime line cap, a moved-error test import, the test event's optional payload type, and the boolean-style lint error. All leases were stopped. No local heavy validation or live deployment was performed.Expected steady-state contribution from skills-only and catalog-status-only publications: 0 auth RPCs/minute. If those account for the observed ~85/minute, that component is eliminated; aggregate production reduction requires a post-deployment event-mix measurement. Genuine changes, explicit refreshes, connections, and expiry deadlines still generate reads.
CI exposed a separate fixture race introduced on main by #157229. Its validation case advanced fake timers before startup's real
fs.realpathcatalog registration finished, then asserted stdin was already destroyed. Main fixed this in 619405d49ddd by waiting for the mocked Writable'scloseevent. That canonical fix is incorporated; no Codex fixture or runtime changes remain in this PR.During diagnosis on Testbox
tbx_01m39v251ax4hs3bnmt3m7t3dv(runner), the reproduction tree exactly matched CI merge tree7990c6cb188576d0604740233584ef2d15ec72d0. The original 23-file/two-worker shard reproduced the same assertion failure. An independently prepared stream-close barrier passed the six cleanup cases, 20 standalone runs of the 132-test owning file (13.93–18.33 s wall each), and three original 830-test shard runs (99.34, 108.45, 132.33 s wall). The initial CI shard took 193.54 s and failed two validation cases. Main landed its equivalent repair while this proof was running, so the duplicate repair was removed in favor of the canonical file.The independently prepared helper repair also passed its full changed-file gate on that lease (516.89 s including fetching the pinned base object), covering extension test typechecking, plugin boundaries, export scans, and lint. The repair preserved timeouts, assertions, and test counts.
The earlier CI typecheck job reached its 20-minute limit after passing the core graphs. Incorporated main commit
9e007615ece5restores hosted core typecheck stripes; the next CI run passed all five stripes. A missed merge-ref startup was recovered by reopening this same PR after verifying the head was mergeable and had no CI attachment.CI also exposed a five-second timeout in the existing raw-WebSocket Control UI build-admission fixture: the first case timed out while the second completed in 817 ms. The fixture now prepares a real pending pairing request and reads it back before connecting, explicitly checks the device is still unpaired, and retains real signature authentication and automatic approval. Both five-second phase bounds remain; the close deadline starts only after the test sends the post-rejection frame that permits closure. All no-registration, no-presence and no-RPC assertions remain intact.
The original 13-file/eight-worker shard passed unchanged on Testbox, so cold-start timing is not claimed consistently reproduced there. The fixture correction passed 20 standalone runs (two tests each, 11.16–23.78 s wall) and three original-shard runs (168 passed, the same one pre-existing skip; 135.28, 164.09, 148.12 s wall) on
tbx_01m39yvv83rgffs6h0zhkdhjx1(runner). Fresh independent review was clean.The fixture's full targeted changed-file gate passed too, including its Gateway test type graph, export scans and lint. The combined stability/check command exited 0 in 1,098.62 s. The production cache change remains +59 lines; this CI repair changes only fixture preparation and close-deadline ordering.