Repository navigation
fix: honor fresh provider catalog discovery - #130412
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 8:34 PM ET / August 27, 2026, 00:34 UTC. ClawSweeper reviewWhat this changesThe PR makes explicit uncached provider-catalog discovery fetch independently and prevents stale cache work from removing a newer replacement entry. Merge readinessKeep open for normal maintainer landing: the shared cache repair is coherent and has no discrete source-level finding, but exact-head CI and a current-main merge refresh remain outstanding. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherProvider plugins use the shared live-catalog cache while discovering models from endpoints. Discovery results feed plugin setup and model selection, including existing llama.cpp servers. flowchart LR
A[Provider discovery request] --> B[Shared catalog cache]
B --> C{Caching enabled?}
C -->|No| D[Fresh endpoint request]
C -->|Yes| E[Cache entry lifecycle]
D --> F[Discovered models]
E --> F
F --> G[Plugin setup and model selection]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +109. Total +108 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the owner-level cache lifecycle repair and land it once the rebased or merged exact head has green selected checks. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the added deterministic loopback HTTP test warms anonymous discovery, changes the endpoint model, then verifies credentialed and explicit-refresh calls fetch anew. This read-only partial clone did not execute that test. Is this the best way to solve the issue? Yes, subject to exact-head validation: repairing the generic cache owner is more maintainable than restoring a llama.cpp-only bypass, and the stale-entry identity check covers replacement work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0b60846fa421. 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
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix: honor fresh provider catalog discovery * test: use compatible deferred catalog fixture
What Problem This Solves
Fixes an issue where users refreshing an existing llama.cpp server's model discovery could receive the previous anonymous catalog instead of a fresh response. The shared cache reused a warm entry even when the caller explicitly disabled caching. Expired catalog loads could also remove a newer replacement entry when they subsequently failed or were rejected by their cache predicate.
Why This Change Was Made
Resolve the existing cache-expiry policy before reading any cache entry. Uncached loads now run independently and never read, write, or remove a cached entry. Cached loads use one cleanup path bound to the exact entry they created, so late completion cannot discard newer work, even when loaders reuse the same Promise.
This repairs the shared owner instead of restoring a llama.cpp-only bypass. No SDK exports, signatures, configuration, auth policy, positive TTL defaults, or persistent storage change. Production LOC: +18/-19 (net -1); tests: +122/-13 (net +109). The old cold-cache mocked credential test is replaced by stronger real HTTP ordering coverage.
User Impact
Explicit catalog refreshes and credential-scoped llama.cpp discovery fetch their own current model list. Ordinary cached discovery still reuses its original entry; late failures no longer cause unnecessary reloads.
Evidence
Reviewed head:
09c4c344530e6a1f84d51358eea60d8bfde20b59.0569c6ea6b401ac15cbffa171be664d8dcf08f52, seven new shared-cache regressions failed: warm-cache bypass with success, rejection, or synchronous throw; and expired-entry cleanup after rejection, predicate rejection, predicate throw, or a replacement reusing the same Promise.OPENCLAW_OXLINT_SKIP_PREPARE=1avoided regenerating unrelated package-boundary artifacts; it did not disable lint rules. Hosted CI must still verify full selected type/build gates.Promise.withResolversuse in the new test fixture. The follow-up uses the existing shared deferred helper without changing production code or assertions. All 26 focused cache/discovery tests, typed lint, formatting, fresh P2 review (0.96), and independent review passed after correction. The owning local test-type shard no longer reports that error, but still fails on unrelated shared-install dependency-version drift; full local types are not claimed green. Fresh exact-head hosted CI is required.openclaw/ci-gate; all 203 check runs are terminal without failures. The latest ClawSweeper rank-up request is addressed by a fresh clean merge-tree againstmainat35adcc6c6f3band confirmation that the touched owner/caller/test paths have not changed since the reviewed base. No rebase is needed solely for behind-main drift. Its stored-data warning is not applicable: the change affects an in-memory Map and test fixtures, not persisted state or a schema. Its live-proof excerpt reports all five tests passed, although the outer harness marked its output assertion failed; our independently completed loopback runs are the behavior proof.Commands:
Provenance: the generic cache ordering predates stable
v2026.7.1; the external llama.cpp path was not present in that tag. Its explicit bypass was removed in #126434 (0135046830ae6887996dc35e91594077cfbe5745, authored and merged by @steipete on August 19, 2026), exposing the older shared-cache defect. The shallow history does not establish the original introduction of the generic defect.AI-assisted.