Repository navigation
fix(ui): model pickers stay on the old catalog when a change arrives mid-read - #174812
Conversation
|
@clawsweeper review |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR starts fresh catalog reads after invalidation while retaining older requests until their transports settle. Example: An open automation picker receives a catalog change from fixture/retiring to fixture/published during an outstanding models.list read.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a source-confirmed stale-catalog path still present on main, and no concrete introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe browser catalog cache shares Gateway models.list requests across scoped consumers and supplies model choices to chat, settings, and automation pickers. flowchart LR
A[Gateway catalog change] --> B[Catalog invalidation]
B --> C[Retire matching requests]
B --> D[Picker reload]
D --> E[Fresh models.list request]
E --> F[Shared catalog cache]
F --> G[Model picker]
C --> H[Original readers settle]
Technical reviewBest possible solution: Keep invalidation and request retirement in the shared catalog owner while preserving original-reader settlement and connection cleanup. Do we have a high-confidence way to reproduce the issue? Source shows that invalidation leaves an outstanding request joinable and its reply publishable; the new regression exercises that sequence, but this read-only review ran no target code. Is this the best way to solve the issue? The change fixes request admission and publication at their shared owner without restoring the removed scheduler or adding consumer-specific workarounds. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 646647245f1a. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +34, Tests +21. Total +55 across 5 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 7:07 PM ET / 23:07 UTC. |
|
Real-Gateway frame trace (local run on Four invalidations produced one |
The model catalog owner now retires requests sent before an invalidation (919e835, #174812). The metadata E2E still expected that old request to serve later demand, leaving all six ordering/presentation variants red. Hold the replacement request, return a distinct obsolete catalog from the retired request, and verify that panes retain the prior accepted display. Then release the fresh result and require exactly one replacement read for the invalidation burst. Preserve command counts and all timeouts. Proof: current main reproduces all six old expectations failing with three models.list calls instead of two. The native bundled UI E2E file passes all 16 cases with the updated contract (--maxWorkers=1). Targeted chat-E2E typecheck, source-backed typed lint and formatting pass.
The model catalog owner now retires requests sent before an invalidation (e6ed736, openclaw#174812). The metadata E2E still expected that old request to serve later demand, leaving all six ordering/presentation variants red. Hold the replacement request, return a distinct obsolete catalog from the retired request, and verify that panes retain the prior accepted display. Then release the fresh result and require exactly one replacement read for the invalidation burst. Preserve command counts and all timeouts. Proof: current main reproduces all six old expectations failing with three models.list calls instead of two. The native bundled UI E2E file passes all 16 cases with the updated contract (--maxWorkers=1). Targeted chat-E2E typecheck, source-backed typed lint and formatting pass.
…78169) * fix: distinguish workflow approval and exception capabilities (#172661) (cherry picked from commit aade2f8) Co-authored-by: RomneyDa <[email protected]> * fix(release): expose Linux builder admission and retain failed bundles (#170297) * fix(release): expose Linux builder admission and retain failed bundles * fix(release): preserve unconfirmed Linux dispatch status * fix(ci): make Linux build event admission explicit * fix(ci): separate Linux mirror dispatch from release builds * fix(ci): budget cold Linux source package builds (cherry picked from commit 614f559) Co-authored-by: RomneyDa <[email protected]> * fix(ui): let locale refresh workers bootstrap new locale memory (#172689) (cherry picked from commit 17bea1c) Co-authored-by: RomneyDa <[email protected]> * test(gateway): prewarm history worker before composed SDK request budgets (#172745) (cherry picked from commit 2051055) Co-authored-by: RomneyDa <[email protected]> * fix(android): prepare focused proof before running Gradle (#172668) * fix(android): prepare focused proof before running Gradle * test(android): reach proof prerequisites on Linux ARM * test: remove duplicated Android job structure assertion * fix: seed stored inference account for Docker cron cleanup (cherry picked from commit 404b708) Co-authored-by: RomneyDa <[email protected]> * fix: preserve bound Codex history after app-server restart (#172705) (cherry picked from commit 9fe4372) Co-authored-by: RomneyDa <[email protected]> * fix(release): Linux channel promotion fails after a withdrawn Windows companion (#173615) (cherry picked from commit c58afa2) Co-authored-by: RomneyDa <[email protected]> * ci(release): temporarily disable Windows companion publication (#173656) (cherry picked from commit 99ce3ea) Co-authored-by: RomneyDa <[email protected]> * fix(qa): Telegram live lane fails scenarios when the stale-update drain hits a transient Bot API error (#173465) * fix(qa): retry Telegram stale-update drain through transient Bot API failures * fix(qa): cancel Telegram drain waits on proxy stop and cap attempts by budget * test(qa): prove the Telegram drain abandons a stalled attempt at its deadline * test(qa): drop timing-dependent upstream count from Telegram drain deadline test (cherry picked from commit 387ebd6) Co-authored-by: RomneyDa <[email protected]> * fix(release): validate shipped release provenance markers against main (#173781) (cherry picked from commit eee5b40) Co-authored-by: RomneyDa <[email protected]> * fix(sqlite): settle peer closes after shared worker refusal (#173813) A refused opener stops its shared worker, so queued peer closes receive the slot's existing operation failure without running. Join native exit without recording that exact failed-slot error as a second cleanup failure. Distinct close, termination and lease-cleanup failures still propagate. Update and Doctor teardown can finish retiring peer agent stores after another opening is revoked. The rejected opening retains its error, exact lease cleanup remains owned, and uncertified native exit cannot publish a clean-close seal. The real-worker regression fails on main with native retirement failed and passes with all peer leases removed. The original intermittent sessions-tail case passed six pre-fix replays; the forced owner boundary proves this repair. Proof: sessions-tail/creation-owner/cleanup 62 passed; broker/client/reply, close-wedge and retention siblings 54 passed; final integrity owner 27 passed, one existing Linux-only skip. pnpm test src/state/openclaw-agent-execution.integrity.test.ts --maxWorkers=1: 76.57s wall, 26.00s Vitest, new regression 2.66s. Scoped types, lint, formatting, line-cap and independent P2 reviews pass. PR CI supplies broad proof. (cherry picked from commit 6d51bb2) Co-authored-by: RomneyDa <[email protected]> * fix(gateway): restore 2026.10.4 startup memory by keeping cold start from opening every memory index (#174718) * perf(agents): bound catalog worker young-generation heap Keep the catalog worker's existing 512 MiB old-generation allowance while bounding its young generation to 32 MiB. Forward-port of the release/2026.10.4 fix; main moved the catalog pool into prepared-model-catalog-worker.pool.ts, so the limit now lives on that pool's single resource-limit object. (cherry picked from commit a3510e8) * fix(memory): keep cold Gateway start from opening every agent's index #167756 started Memory Core's index service eagerly on every Gateway start, opening each configured agent's memory manager right after readiness. On an idle Gateway that startup catch-up touches every session-transcript read lane, so each lane spawns its own worker isolate (plus a memory-search worker): the 2026.10.5 Gateway startup peak RSS rose from ~1.1 GB to ~1.8 GB. Cold start is demand-driven again, as before #167756: the first search, flush, or turn that needs an agent's index opens it. Once a watched manager has run in the process (a process-wide fact that survives plugin instance replacement and resets with a Gateway restart), every later service start reopens all configured indexes, so plugin reloads, provider-only reloads, rollback recovery, and memory/agent config restarts still resume watching without a search or turn. * perf(sqlite): bound broker and transcript worker young-generation heaps Cap the SQLite broker carriers and session-transcript reader workers at a 32 MiB young generation, matching the catalog worker bound, while keeping the existing 512 MiB old-generation allowance. Worker counts, lanes, admission, and lifecycle custody are unchanged. V8's default nursery grows to ~63 MiB per worker after a startup allocation burst and stays resident on idle workers. On the 2026.10.5 Gateway (fresh state, forced 16 CPUs) the broker's heap total at startup peak fell 125 -> 91 MiB and the transcript reader 81 -> 34-66 MiB; with the Memory Core cold-start fix, max Gateway peak RSS over the runs fell 1152 -> 1117 MB. Tradeoff: more frequent scavenges during large allocation bursts in these workers. (cherry picked from commit 6c050f8) Co-authored-by: RomneyDa <[email protected]> * fix(ui): start a fresh model catalog read after invalidation (#174812) (cherry picked from commit 919e835) Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes: Control UI model pickers (for example the automation draft model picker) can keep showing the previous model list after a model catalog change, when the change notification arrives while an earlier catalog read is still in flight.
User Impact
User impact: after
config set models.providers...(or any other catalog publication), open model pickers update to the new catalog instead of staying on the previous one until something else triggers a reload.Why This Change Was Made
Readers that started after a catalog invalidation joined a
models.listrequest sent before it, and that request's reply was then cached as current. The store's own comment noted this ("may display the older list until its next refresh"). Now an invalidation retires matching in-flight requests: their original readers still settle, readers that arrive later send a fresh request, and a retired reply is never published to the cache. Retired requests stay tracked until they settle, so connection clears still abort them andsettleModelCatalogRequestsstill waits for them. Two existing tests that expected sharing across an invalidation now expect a second request.This is the cause of the intermittent
checks-ui-e2e-real-gateway (2/2)failurecron-duration-save.real-gateway.e2e.test.ts > Automation catalog publication with a real Gateway, where thefixture/publishedpoll times out withexpected +0 to be 1. That failure appeared 9 times between 2026-10-13 and 2026-10-15, including Full Release Validation runs and the 2026.10.10-beta.2 candidate.Evidence
ui/src/lib/model-catalog-store.test.ts› "reads again after an invalidation instead of joining the earlier request" fails on the base commit (one transport request; the reader that arrived after the invalidation gets the reply from before it) and passes with the fix.models.listreplies delayed 1.5s to mimic a loaded runner):config.changedand twochat.metadata.changed{modelCatalogChanged:true}all arrived during one in-flightmodels.list, and every read after those invalidations joined it (1 request for 4 invalidations).pnpm test ui/src/lib/model-catalog-store.test.ts ui/src/lib/model-catalog-store.lifecycle.test.ts ui/src/lib/chat/chat-metadata-store.test.ts ui/src/lib/chat/chat-metadata-refresh.test.ts ui/src/pages/cron/cron-page.lifecycle.test.ts ui/src/pages/cron/cron-page.test.ts: 131 passed. Widerui/src/lib ui/src/pages/{cron,model-providers,agents} ui/src/app: onlydev-gateway.node.test.tsfailed once, and it passes on rerun (unrelated dev proxy).ui/src/e2e/cron-duration-save.real-gateway.e2e.test.ts(whole file, real Gateway) with this commit cherry-picked ontorelease/2026.10.10: 6/6 passed.pnpm check:changed: typecheck UI/core tests, lint, and format pass. The max-lines ratchet flags 3 untouched files (chat-message.test.tsx,config-page-state.ts,sessions-page-state.ts). The dead-export scan flags only untouched files.pnpm test ui/src/lib/model-catalog-store.test.ts --maxWorkers=1takes 7.9s wall (3.1s vitest). The two updated lifecycle files take 7.7s wall together. No timers or sleeps were added.