Repository navigation
fix(models): retain native model choices during full refresh - #150806
Conversation
Publish full provider and native catalog results with their paired runtime and auth facts only after acquisition settles. Keep the previous complete view available to bounded reads, preserve scoped refreshes and failure recovery, and exercise a held native source through the worker boundary.
|
🦞👀 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 17, 2026, 6:25 AM ET / 10:25 UTC. ClawSweeper reviewWhat this changesThe PR keeps the previous model catalog, executable model choices, and inventory available until a full native refresh finishes, with regression coverage for concurrent reads. Merge readiness✅ Ready for maintainer review This remains a useful fix: pinned main still exposes intermediate refresh results, and neither related PR supersedes it. No actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s prepared model catalog combines provider discovery, native runtime choices, and authentication facts. CLI listings, model pickers, and new agent runs consume its published snapshots. flowchart TD
A[Provider discovery] --> C[Catalog owner]
B[Native discovery and auth] --> C
C --> D{Full refresh complete?}
D -->|No| E[Previous published snapshot]
D -->|Yes| F[New combined snapshot]
E --> G[Model listings and agent runs]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +47, Tests +58. Total +105 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep full native refresh publication atomic within the catalog owner while preserving paired authentication, scoped renewal, and the existing foreground deadline. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a focused path: hold native discovery after provider completion and read the published catalog and runtime models. The PR reports before/after failures and passes; this review did not execute tests. Is this the best way to solve the issue? Yes. Staging results in the existing publication owner addresses the race without adding another cache, configuration option, or discovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d08c80a12609. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Wait for published catalog facts under the existing test signal while preserving exact inventory, request-count, pool, and nonblocking RPC assertions. Remove the worker-only completion shortcut. Controlled provider responses reproduce the old readiness deadlines. Both catalog test files passed 20/20 on main and before #150806 in the attribution comparison; #150806 is not implicated by that comparison.
…51018) Fix intermittent Gateway catalog integration failures when background discovery publishes after foreground refresh returns. Use the existing catalog publication events to wait for observable readiness within each test's lifetime. Preserve exact model, account, request-count, worker-pool, and nonblocking RPC assertions, plus the existing overall deadlines. Controlled provider responses exercise delayed initial discovery and renewal. This changes tests and test support only; production code is unchanged. Validation: controlled pre-fix failures, repaired Linux runs passing 20/20 per complete file, and the post-rebase macOS run passing both files and all four cases without retries. Changed-file checks passed. The exact-head native CI watcher reported GREEN for run 35254235321 with zero pending checks. Codex review was scoped-clean at P1; ClawSweeper's exact-head revision 2 had no findings or Rank-up moves. The attribution comparison passed both complete files 20/20 on main and before #150806; that comparison does not implicate #150806.
…w#150806) Full catalog refreshes could expose provider results before native discovery and its paired auth facts settled, temporarily dropping native model choices. Keep the previous complete catalog, runtime models, and inventory published until the new generation is complete, and restore the previous publication on acquisition failure. Preserve the five-second foreground bound, scoped provider refreshes, and recorded discovery failures. The worker-boundary regression holds native acquisition to exercise concurrent readers and verifies the final merged catalog. Related: openclaw#150427 Validation: forced-ordering regressions reproduced the defect on macOS and Linux, then passed 20/20 serial runs per platform with the fix. Catalog/model-selection suites passed 641 tests across 41 files; build and changed checks passed. Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/35209693054.
…enclaw#151018) Fix intermittent Gateway catalog integration failures when background discovery publishes after foreground refresh returns. Use the existing catalog publication events to wait for observable readiness within each test's lifetime. Preserve exact model, account, request-count, worker-pool, and nonblocking RPC assertions, plus the existing overall deadlines. Controlled provider responses exercise delayed initial discovery and renewal. This changes tests and test support only; production code is unchanged. Validation: controlled pre-fix failures, repaired Linux runs passing 20/20 per complete file, and the post-rebase macOS run passing both files and all four cases without retries. Changed-file checks passed. The exact-head native CI watcher reported GREEN for run 35254235321 with zero pending checks. Codex review was scoped-clean at P1; ClawSweeper's exact-head revision 2 had no findings or Rank-up moves. The attribution comparison passed both complete files 20/20 on main and before openclaw#150806; that comparison does not implicate openclaw#150806.
Related: #150427
What Problem This Solves
Full catalog refreshes could expose provider results before native discovery and its auth facts finished, temporarily dropping native model choices and making the account-scoped worker test timing-dependent. This addresses the failure in run 35194807758.
User Impact
Bounded reads retain the previous complete catalog while a full native refresh is in flight. The five-second foreground bound stays unchanged; scoped provider refreshes and recorded discovery failures retain their existing behavior.
Why This Change Was Made
The existing catalog-access owner now stages the catalog, runtime models, and retained inventory, then publishes them together after native discovery and auth settle. Failed acquisition restores the prior publication. The regression holds the native source at the worker boundary, checks that readers retain the previous generation, and awaits the existing standalone explicit-refresh promise before asserting the complete merged result.
The race predates the shared fleet pool: bounded reads arrived in #145190, after the original assertion. This fixture supplies an explicit environment and uses a direct worker.
Evidence
node scripts/check-changed.mjs, including type-aware lint, core/test types, and all selected guards.--mode branch --base origin/main --max-priority P1: scoped clean, no accepted actionable findings.Production: +67/-20 lines. Tests and test support: +62/-4 lines.