Repository navigation
fix(models): relist provider model lists older than 15 minutes on picker reads - #200988
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. What this changesThis PR makes ordinary model-picker reads trigger background renewal of expired provider listings after a minimum of 15 minutes. Example: A provider initially lists fake-1, then starts advertising fake-2.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused, supported freshness improvement that current main lacks, with no actionable correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway model-list handler reads published catalogs from the prepared model runtime, whose existing inventory owner acquires provider listings and publishes updated picker rows. flowchart LR
A[Model picker or CLI] --> B[Gateway models list]
B --> C[Prepared catalog owner]
C --> D[Published model rows]
D --> A
C --> E[Expiry check]
E --> F[Provider discovery worker]
F --> C
Technical reviewBest possible solution: Keep renewal in the existing catalog owner, using the shared 15-minute floor while preserving longer provider lifetimes and immediate explicit Refresh. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the passive-read limitation, and the supplied isolated Gateway comparison demonstrates it through ordinary models.list calls; this review executed no target code. Is this the best way to solve the issue? The patch is the smallest complete implementation using existing owners: it changes the shared successful deadline, invokes existing renewal, updates the established Gateway regression, and documents the policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ff7e2772eb1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +9, Tests -4, Docs +5. Total +10 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 November 17, 2026, 11:40 PM ET / November 18, 2026, 04:40 UTC. |
…ker reads A saved live model listing never aged after #167008, so a newly launched provider model stayed out of the picker until a restart, config change, hosted catalog revision or explicit Refresh. - A successful live listing expires at the later of its response-cache deadline and 15 minutes after acquisition. The floor keeps short TTLs from renewing on almost every read (#167008); a longer TTL still wins (#168050), so the relist always reaches the provider. - models.list asks the catalog owner to relist expired providers in the background; the read still returns published rows at once. - Expiry and failure-retry relists no longer mark providers pending, so pickers and chat /models show no loading state for them.
41ee4d3 to
3fd0cae
Compare
|
Landed as 2f658fc. Provider model lists now go stale after 15 minutes (or the provider's own cache lifetime, when longer). The next picker open refetches the stale list in the background with no loading state, so a newly launched model appears without a restart, Refresh or release. Proof: a regression test that fails on the base commit and passes here, base vs fix Gateways with a fake listing, Control UI screenshots taken during a held refetch, a clean local review and green CI on the exact head. |
|
Maintainer routing question — narrow follow-up to #200988, not a fix for #194240. This PR intentionally makes expiry-driven provider relists silent (no picker-visible We prepared a source-only follow-up that tracks silent in-flight provider scope separately from picker-visible pending state, without adding a scheduler or changing the renewal cadence. On pinned upstream This is not a reproduction or solution for #194240's startup/catalog-adoption inventory loss, which is marked Would maintainers welcome a separate focused PR for silent-renewal failure accounting, prefer it tracked elsewhere, or prefer no PR pending further investigation? |
…ker reads (openclaw#200988) ## What Problem This Solves A model that a provider launches does not appear in the Gateway model picker until the Gateway restarts, its config or credentials change, the next 6-hourly hosted catalog revision is adopted, or the user presses **Refresh**. Example: OpenAI launched `gpt-6.2-astra` and `gpt-6.2-sol` on 2026-11-17. Typed `openai/gpt-6.2-sol` turns worked on every release, but the picker kept the OpenAI listing saved before the launch. Cause: openclaw#167008 stopped ordinary `models.list` reads from renewing an expired provider listing, because that expiry was the provider's 60-second HTTP response-cache TTL and almost every picker open rebuilt the catalog. Nothing replaced it, so a saved live listing never ages on its own. ## Why This Change Was Made - A successful live listing now expires at the later of its response-cache deadline and 15 minutes after acquisition (`discoveryDeadline`). The floor keeps short TTLs from renewing on almost every read (openclaw#167008). A longer TTL still wins (openclaw#168050, ClawRouter's one hour), so the expiry relist, which honors each feed's cache, always reaches the provider instead of re-stamping a cached response as fresh. - `models.list` calls the catalog owner's existing `refreshExpiredModelCatalog`, which relists only expired providers in the background. The read returns the published rows at once; open pickers update through the existing catalog publication push. - Expiry and failed-discovery retry relists no longer mark providers pending. They revalidate rows the user already sees, so pickers show no loading state and chat `/models` adds no `checking models…` line for them. First sign-in, changed credentials and explicit **Refresh** still report progress. - The listing still decides which models a signed-in provider shows (openclaw#114356). This change only keeps that listing fresh. Accepted cost: at most one background relist per live-listed provider per 15 minutes (or per its cache TTL, when longer), and only while someone opens a picker. Providers whose listing is not retained in the live response cache (`ttlMs: 0`, self-hosted discovery) keep the previous behavior. ## User Impact A newly launched provider model appears in the picker within about 15 minutes of the provider listing it, on the first picker open, with no restart, no **Refresh**, no loading indicator and no OpenClaw release. ## Evidence - **Regression (vitest-source):** `models-list.freshness.integration.test.ts` keeps the real live response cache (500 ms TTL, no cache clearing). It asserts that the listing ages out on the 15-minute floor rather than the short TTL, and that an ordinary `models.list` read on an aged listing serves saved rows with no `pendingProviders`, relists once in the background, then publishes the new model. Fails on merge base `9decc8090873` (3/3, deadline equals the cache TTL); the no-pending assertion also fails on this PR's previous head `41ee4d30` (3/3, provider listed as pending); passes on this head (3/3). - **Renewal contract (vitest-source):** `server-chat-metadata-lifecycle.catalog-renewal.test.ts` now asserts that an expiry renewal never publishes a pending provider and that settling it sends only the real catalog change, with no refresh-status broadcast. An explicit refresh in the same file still reports refresh status. - **E2E, CLI reads (fix: source tier; base: `9decc8090873` dist-nodts):** two isolated Gateways, each with a fake LiteLLM proxy as its live listing and hosted catalog refresh disabled. At 04:03:46Z each proxy starts listing `fake-2`; an ordinary `gateway call models.list` (no refresh) runs once a minute. | Time (UTC) | Fix Gateway picker | Base Gateway picker | |---|---|---| | 04:03:41 (before) | `fake-1` | `fake-1` | | 04:04 to 04:17 | `fake-1` | `fake-1` | | 04:18:58 | `fake-1`, `fake-2` | `fake-1` | | 04:23:58 | `fake-1`, `fake-2` | `fake-1` | Proxy request logs: the fix Gateway listed at startup and once more at 04:17:58, the first read after the listing aged; no other requests. The base Gateway never listed again. - **E2E, Control UI (dist-nodts, real browser):** this head and the previous head `41ee4d30`, each with a fake LiteLLM listing whose `/models` response is held for 25 s after a new model is added. The picker is opened once the listing aged (proxy logs show the relist request at that moment), then again after release. During the relist both pickers render the saved models immediately with no loading state; the new model appears after the relist publishes. The visible difference from the previous head is the pending flag (`pendingProviders`, and chat `/models` `checking models…`), which the tests above pin as absent. Screenshots: openclaw#200988 (comment) - **Affected suites (vitest-source, exact head):** freshness, renewal, worker recovery, publication events, auth-login catalog, prepared-runtime sources, native picker failures and configured catalog index: 52 tests across 5 shards pass. - **Review and CI:** local ClawSweeper review (`gpt-6.1-sol`) on `3fd0cae6` found no issues; required CI is green on the same head. Co-authored-by: Ayaan Zaidi <[email protected]>


What Problem This Solves
A model that a provider launches does not appear in the Gateway model picker until the Gateway restarts, its config or credentials change, the next 6-hourly hosted catalog revision is adopted, or the user presses Refresh. Example: OpenAI launched
gpt-6.2-astraandgpt-6.2-solon 2026-11-17. Typedopenai/gpt-6.2-solturns worked on every release, but the picker kept the OpenAI listing saved before the launch.Cause: #167008 stopped ordinary
models.listreads from renewing an expired provider listing, because that expiry was the provider's 60-second HTTP response-cache TTL and almost every picker open rebuilt the catalog. Nothing replaced it, so a saved live listing never ages on its own.Why This Change Was Made
discoveryDeadline). The floor keeps short TTLs from renewing on almost every read (perf(models): keep inventory reads on published catalogs #167008). A longer TTL still wins (fix(models): avoid needless ClawRouter catalog refreshes #168050, ClawRouter's one hour), so the expiry relist, which honors each feed's cache, always reaches the provider instead of re-stamping a cached response as fresh.models.listcalls the catalog owner's existingrefreshExpiredModelCatalog, which relists only expired providers in the background. The read returns the published rows at once; open pickers update through the existing catalog publication push./modelsadds nochecking models…line for them. First sign-in, changed credentials and explicit Refresh still report progress.Accepted cost: at most one background relist per live-listed provider per 15 minutes (or per its cache TTL, when longer), and only while someone opens a picker. Providers whose listing is not retained in the live response cache (
ttlMs: 0, self-hosted discovery) keep the previous behavior.User Impact
A newly launched provider model appears in the picker within about 15 minutes of the provider listing it, on the first picker open, with no restart, no Refresh, no loading indicator and no OpenClaw release.
Evidence
Regression (vitest-source):
models-list.freshness.integration.test.tskeeps the real live response cache (500 ms TTL, no cache clearing). It asserts that the listing ages out on the 15-minute floor rather than the short TTL, and that an ordinarymodels.listread on an aged listing serves saved rows with nopendingProviders, relists once in the background, then publishes the new model. Fails on merge basee235b2b983b6(3/3, deadline equals the cache TTL); the no-pending assertion also fails on this PR's previous head41ee4d30(3/3, provider listed as pending); passes on this head (3/3).Renewal contract (vitest-source):
server-chat-metadata-lifecycle.catalog-renewal.test.tsnow asserts that an expiry renewal never publishes a pending provider and that settling it sends only the real catalog change, with no refresh-status broadcast. An explicit refresh in the same file still reports refresh status.E2E, CLI reads (fix: source tier; base:
e235b2b983b6dist-nodts): two isolated Gateways, each with a fake LiteLLM proxy as its live listing and hosted catalog refresh disabled. At 04:03:46Z each proxy starts listingfake-2; an ordinarygateway call models.list(no refresh) runs once a minute.fake-1fake-1fake-1fake-1fake-1,fake-2fake-1fake-1,fake-2fake-1Proxy request logs: the fix Gateway listed at startup and once more at 04:17:58, the first read after the listing aged; no other requests. The base Gateway never listed again.
E2E, Control UI (dist-nodts, real browser): this head and the previous head
41ee4d30, each with a fake LiteLLM listing whose/modelsresponse is held for 25 s after a new model is added. The picker is opened once the listing aged (proxy logs show the relist request at that moment), then again after release. During the relist both pickers render the saved models immediately with no loading state; the new model appears after the relist publishes. The visible difference from the previous head is the pending flag (pendingProviders, and chat/modelschecking models…), which the tests above pin as absent. Screenshots: fix(models): relist provider model lists older than 15 minutes on picker reads #200988 (comment)Affected suites (vitest-source, exact head): freshness, renewal, worker recovery, publication events, auth-login catalog, prepared-runtime sources, native picker failures and configured catalog index: 52 tests across 5 shards pass.
Review and CI: local ClawSweeper review (
gpt-6.1-sol) on3fd0cae6found no issues; required CI is green on the same head.