Repository navigation
perf(ui): trust startup metadata and damp catalog polling - #114837
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 12:07 AM ET / 04:07 UTC. ClawSweeper reviewWhat this changesThis PR reuses metadata returned by the Control UI’s initial chat startup request, fills only missing metadata afterward, and prevents timestamp-only catalog updates or foregrounding bursts from forcing rapid sidebar polling. Merge readiness⛔ Blocked until real behavior proof is added - 4 items remain Keep this PR open. The supplied diff and regression coverage support the intended Control UI performance change, but the PR still lacks inspectable after-fix runtime evidence and carries the protected Priority: P2 Review scores
Verification
How this fits togetherThe Control UI opens a chat by requesting startup data from the Gateway, which can include the model and command metadata used by the composer. Separately, the sidebar polls Gateway session catalogs; this change decides when refreshes are needed and how quickly the next poll should occur. flowchart LR
A[User opens chat] --> B[Control UI startup request]
B --> C[Gateway chat startup response]
C --> D[Startup metadata applied]
D --> E[Scoped metadata gap fill]
F[Presence or focus events] --> G[Catalog refresh debounce]
G --> H[Session catalog poll cadence]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +93, Tests +66. Total +159 across 12 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Post a redacted real Control UI/Gateway trace or recording that demonstrates complete-startup reuse, incomplete-startup gap fill, and stable polling under timestamp-only activity; then have the assigned reviewer assess the timeout and fallback behavior against a real session. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction is available in the supplied evidence. The redundant request and cadence decisions are source-reproducible from the branch and its focused tests, but the reported production timings and after-fix behavior need an inspectable runtime trace. Is this the best way to solve the issue? Yes, conditionally. Reusing complete startup metadata and preserving a scoped fallback is a narrower solution than adding a parallel request, but the real UI behavior and timeout tradeoff should be demonstrated before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 021e1457e807. LabelsLabel 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
History |
|
Merged via squash.
|
…14837) * perf(ui): trust startup metadata and damp catalog polling * chore(ui): de-export internal catalog refresh helpers * fix(ui): keep agent-scoped composer models fresh across pane switches * fix(ui): keep first-turn sends working while startup loading is pending
What Problem This Solves
Two Control UI inefficiencies around session loading (team.openclaw.ai production evidence):
chat.startup(avg 437ms) ANDchat.metadata(avg 441ms) in parallel — butchat.startupalready computes and ships the same metadata (buildChatStartupMetadataResult), and the client discarded whichever response arrived second. The redundant call could even trigger full catalog discovery server-side (nopreloadedOnly).JSON.stringifydiff of the whole payload changes — and rows carryupdatedAt/recencyAt, so any activity on any listed external session pinned every client at 5s (a 6× poll amplifier). Presence/focus/visibility/hostUpdated triggers also fired independent refreshes on foregrounding.Why This Change Was Made
Production perf campaign on session loading: one whole ~440ms request per session open was pure waste, and the poll amplifier multiplied the (separately expensive) catalog cost.
User Impact
Faster session opens and materially fewer catalog polls; no protocol or response-shape changes:
chat.metadatarequest; partial metadata → a scoped gap-fill for missing fields only; absent metadata (startup's 25ms catalog budget missed or full discovery required) → immediatechat.metadataso the model picker/commands never sit empty.updatedAt/recencyAtticks; genuinely new/removed rows still hit the 5s cadence.Evidence
git diff --checkclean.