Repository navigation
fix(models): show fetched models after Show all - #146342
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. Reviewed September 12, 2026, 8:23 PM ET / September 13, 2026, 00:23 UTC (Revision 4). ClawSweeper reviewWhat this changesRetains fetched provider models and reapplies the current agent’s model restrictions when publishing model lists and executable model rows. Merge readiness✅ Ready for maintainer review This remains a useful fix for behavior still present on current main. No blocking defect was found, and the protected maintainer label also precludes cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s prepared model catalog combines configured models with provider discovery. Its published views feed model pickers, Gateway model listings, and new agent runs. flowchart TD
A[Configured provider models] --> C[Provider discovery]
B[Account model results] --> C
C --> D[Retained catalog inventory]
E[Current agent model policy] --> F[Catalog projection]
D --> F
F --> G[Model lists and pickers]
F --> H[Executable models for new runs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +127, Tests +193. Total +320 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep complete discovery in the existing inventory and derive consistent display and executable views from the current agent policy without refetching or rewriting saved settings. Do we have a high-confidence way to reproduce the issue? Yes, from source: acquire a provider catalog under a manual-model restriction, then choose Show all; current main reuses inventory from which additional fetched rows were discarded. No runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes. The patch repairs the existing inventory/publication boundary and reuses the established policy parser without adding a competing cache or changing saved configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1db6e89d4ead. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
771b8cd to
6f8b278
Compare
6f8b278 to
4698199
Compare
|
landpr-approve-admin-merge |
|
landpr-approve-admin-merge |
|
Thanks @obviyus! Proof: After sign-in, Show all exposes both fetched account models in
|
## What Problem This Solves Show all after sign-in reported success while fetched account models stayed missing from `/models` (openclaw#144468). ## Why This Change Was Made Keep complete discovery in the existing inventory and apply current membership before publication. The decision "whether a provider's declared manual IDs constrain discovered membership under the resolved agent policy" is made by exactly one mechanism at `src/agents/provider-model-membership.ts:24`. Production: 194 added / 67 removed (+127). Growth preserves manual metadata and alias provenance while retaining raw discovery without a second cache or fetch. The helper uses named `cfg`, `agentId` and `normalizeProvider` options; this is the only production adjustment since 771b8cdc. Based on openclaw#146317, which updates the same catalog publication owner. ## User Impact Show all exposes fetched models immediately. Keep preserves restrictions. ## Evidence The same Telegram flow shows 8 models before and 10 after the fix, including both account-only rows, without another catalog request. Four Gateway cases cover widening, narrowing, agent overrides and overlapping hooks. All 17 sanitized configuration shapes reached Gateway readiness with fake credentials (one with Tailscale disabled). An installed old-state configuration passed login and both choices. ## Compatibility No stored-state or public API change. Manual lists keep their behavior. No older-host compatibility contract changes. ## Consumers - `/models` and `models.list` adopt recomputed membership. - Prepared model leases receive the same permitted executable rows. - CLI catalog reads and the embedded terminal model list adopt the recomputed membership from the shared catalog owner; their response and display formats are unchanged. This includes the no-Gateway CLI path. ## Invalidation Policy reload rebuilds the projection. Account, provider and plugin changes still invalidate discovery; restart creates a fresh owner. ## Contention No new wait, lock or queue; recomposition stays synchronous. ## Tests Four new cases exercise registered `models.list` and `config.patch`. Existing startup fixtures adopt the internal provenance map. Real Telegram login and choices, catalog, credential-reload and startup checks pass. Co-authored-by: Ayaan Zaidi <[email protected]>
…5420) Related: #146342 ## What Problem This Solves Fixes newly advertised models missing from `/models` and model pickers when an older `models.providers.*.models` list silently caps an otherwise unrestricted catalog. ## User Impact Existing configurations keep their model metadata and request overrides while newly discovered models can appear on catalog refresh. Users do not need to delete old provider model arrays or add each new model manually. Explicit `modelPolicy.allow` restrictions and `models.mode: "replace"` remain effective; defaults and credentials are unchanged. ## Why This Change Was Made Merge configured and discovered inventory instead of treating saved model rows as a second allowlist. Remove the redundant membership filter and its worker/publication bookkeeping, leaving selection restrictions with the existing policy owner. No new configuration fields, storage migration, or provider-specific discovery changes are included. ## Evidence - Live diagnosis: Grok OAuth discovery advertised new models, but the saved provider-model membership filter excluded them before publication. - Negative control: the registered Gateway regression failed three cases before the fix, covering unrestricted startup and transitions back to unrestricted policy. - After the fix, 154 focused tests across 11 files passed. Coverage includes real Gateway listing, exact/wildcard/per-agent policy, a later provider release with unchanged saved model rows, metadata/request ownership, replace mode, and empty/error discovery outcomes. - Changed-file core/core-test typechecks, lint and documentation checks passed. Full `pnpm build` passed. - No live deployment was modified. The user-flow regression uses an isolated Gateway and local provider fixture; no new-model inference claim is made. Co-authored-by: Ayaan Zaidi <[email protected]>
…nclaw#155420) Related: openclaw#146342 ## What Problem This Solves Fixes newly advertised models missing from `/models` and model pickers when an older `models.providers.*.models` list silently caps an otherwise unrestricted catalog. ## User Impact Existing configurations keep their model metadata and request overrides while newly discovered models can appear on catalog refresh. Users do not need to delete old provider model arrays or add each new model manually. Explicit `modelPolicy.allow` restrictions and `models.mode: "replace"` remain effective; defaults and credentials are unchanged. ## Why This Change Was Made Merge configured and discovered inventory instead of treating saved model rows as a second allowlist. Remove the redundant membership filter and its worker/publication bookkeeping, leaving selection restrictions with the existing policy owner. No new configuration fields, storage migration, or provider-specific discovery changes are included. ## Evidence - Live diagnosis: Grok OAuth discovery advertised new models, but the saved provider-model membership filter excluded them before publication. - Negative control: the registered Gateway regression failed three cases before the fix, covering unrestricted startup and transitions back to unrestricted policy. - After the fix, 154 focused tests across 11 files passed. Coverage includes real Gateway listing, exact/wildcard/per-agent policy, a later provider release with unchanged saved model rows, metadata/request ownership, replace mode, and empty/error discovery outcomes. - Changed-file core/core-test typechecks, lint and documentation checks passed. Full `pnpm build` passed. - No live deployment was modified. The user-flow regression uses an isolated Gateway and local provider fixture; no new-model inference claim is made. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Show all after sign-in reported success while fetched account models stayed missing from
/models(#144468).Why This Change Was Made
Keep complete discovery in the existing inventory and apply current membership before publication. The decision "whether a provider's declared manual IDs constrain discovered membership under the resolved agent policy" is made by exactly one mechanism at
src/agents/provider-model-membership.ts:24.Production: 194 added / 67 removed (+127). Growth preserves manual metadata and alias provenance while retaining raw discovery without a second cache or fetch. The helper uses named
cfg,agentIdandnormalizeProvideroptions; this is the only production adjustment since 771b8cdc.Based on #146317, which updates the same catalog publication owner.
User Impact
Show all exposes fetched models immediately. Keep preserves restrictions.
Evidence
The same Telegram flow shows 8 models before and 10 after the fix, including both account-only rows, without another catalog request. Four Gateway cases cover widening, narrowing, agent overrides and overlapping hooks.
All 17 sanitized configuration shapes reached Gateway readiness with fake credentials (one with Tailscale disabled). An installed old-state configuration passed login and both choices.
Compatibility
No stored-state or public API change. Manual lists keep their behavior. No older-host compatibility contract changes.
Consumers
/modelsandmodels.listadopt recomputed membership.Invalidation
Policy reload rebuilds the projection. Account, provider and plugin changes still invalidate discovery; restart creates a fresh owner.
Contention
No new wait, lock or queue; recomposition stays synchronous.
Tests
Four new cases exercise registered
models.listandconfig.patch. Existing startup fixtures adopt the internal provenance map. Real Telegram login and choices, catalog, credential-reload and startup checks pass.