Skip to content

fix(models): show fetched models after Show all - #146342

Merged
obviyus merged 2 commits into
mainfrom
fix/showall-membership
Sep 13, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/showall-membership

Conversation

@obviyus

@obviyus obviyus commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

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, agentId and normalizeProvider options; 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

  • /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.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 8:23 PM ET / September 13, 2026, 00:23 UTC (Revision 4).

ClawSweeper review

What this changes

Retains 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
Reviewed head: f2b2fe9b8a70115c34d7e15ac3149c82f4b4a2ef

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant reported runtime proof and Gateway regression coverage, with no blocking finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied Telegram before/after observations exercise login, Show all, and model listing through the changed catalog owner: 8 rows become 10 without another fetch, while Keep preserves restrictions. Existing accepted proof remains applicable because the latest commit changes only test cleanup; this review did not independently rerun it.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Telegram before/after observations exercise login, Show all, and model listing through the changed catalog owner: 8 rows become 10 without another fetch, while Keep preserves restrictions. Existing accepted proof remains applicable because the latest commit changes only test cleanup; this review did not independently rerun it.
Evidence reviewed 9 items Current main still has the defect mechanism: Current main constrains discovered membership during the implicit-provider merge, while catalog publication reuses the resulting inventory without recomputing that membership. A later provider wildcard cannot recover rows already discarded.
Shared publication repair: The projection derives membership from current agent policy and captured configured IDs, then filters both catalog entries and executable runtime rows. Acquisition retains discovery through the existing inventory; the added provenance map is process-local.
Established user contract: Documentation says Show all adds the provider wildcard, Keep preserves restrictions, and concurrent restriction changes are preserved. Model-policy documentation separately establishes per-agent policy precedence.
Findings None None.
Security None None.

How this fits together

OpenClaw’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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +127, Tests +193. Total +320 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 11 194 67 +127
Tests 3 193 0 +193
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 387 67 +320

Review metrics

Metric Value Why it matters
Growth allocation Production net +127 lines; tests and support net +193 lines Production growth separates retained discovery from policy projection within the existing owner, with registered Gateway regression coverage.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This repairs a bounded model-list visibility failure after an existing user choice, without evidence of an urgent runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied Telegram before/after observations exercise login, Show all, and model listing through the changed catalog owner: 8 rows become 10 without another fetch, while Keep preserves restrictions. Existing accepted proof remains applicable because the latest commit changes only test cleanup; this review did not independently rerun it.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Telegram before/after observations exercise login, Show all, and model listing through the changed catalog owner: 8 rows become 10 without another fetch, while Keep preserves restrictions. Existing accepted proof remains applicable because the latest commit changes only test cleanup; this review did not independently rerun it.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The repair changes the models visible in Telegram after Show all; the supplied evidence covers that flow.

Evidence

What I checked:

  • Current main still has the defect mechanism: Current main constrains discovered membership during the implicit-provider merge, while catalog publication reuses the resulting inventory without recomputing that membership. A later provider wildcard cannot recover rows already discarded. (src/agents/models-config.providers.implicit.ts:137, 1db6e89d4ead)
  • Shared publication repair: The projection derives membership from current agent policy and captured configured IDs, then filters both catalog entries and executable runtime rows. Acquisition retains discovery through the existing inventory; the added provenance map is process-local. (src/agents/prepared-model-runtime.catalog-projection.ts:25, f2b2fe9b8a70)
  • Established user contract: Documentation says Show all adds the provider wildcard, Keep preserves restrictions, and concurrent restriction changes are preserved. Model-policy documentation separately establishes per-agent policy precedence. Public docs: docs/cli/models.md. (docs/cli/models.md:338, f2b2fe9b8a70)
  • Registered Gateway regression coverage: Four cases exercise models.list and config.patch through a Gateway client and HTTP catalog fixture, checking widening, narrowing, agent overrides, overlapping hooks, and unchanged discovery request counts. These tests were inspected, not executed during this review. (src/gateway/server-methods/models-list.membership.integration.test.ts:8, f2b2fe9b8a70)
  • Existing real-behavior evidence: The supplied PR body reports the same Telegram login/choice flow showing 8 models before and 10 afterward, including two account-only rows without another catalog request. It also reports Keep coverage, startup with 17 sanitized configuration shapes, and an installed old-state configuration passing login and both choices. The captured context includes proof: sufficient; no linked media was supplied for independent visual inspection. (f2b2fe9b8a70)
  • Introduction and re-review continuity: GitHub comparison confirms the supplied merge-base and 14 introduced paths. The latest commit only changes the test cleanup Promise executor; production remains unchanged from the previous completed review, whose retained findings were empty. (src/gateway/server-methods/models-list.membership.integration.test.ts:184, f2b2fe9b8a70)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-12T19:15:37.695Z sha 771b8cdc0b33c60511e99c073785d836fc2182f6 :: blocked before merge. :: none
  • reviewed 2026-09-12T20:17:28.723Z sha 6f8b278 :: blocked before merge. :: none
  • reviewed 2026-09-13T00:08:32.334Z sha 4698199 :: needs maintainer review before merge. :: none

@obviyus
obviyus force-pushed the fix/showall-membership branch from 771b8cd to 6f8b278 Compare September 12, 2026 19:32
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 12, 2026
@obviyus
obviyus force-pushed the fix/showall-membership branch from 6f8b278 to 4698199 Compare September 12, 2026 23:59
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 146342
head: 4698199
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 13, 2026 00:02
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 146342
head: f2b2fe9
scope: owner-review

@obviyus
obviyus merged commit 1bb76a2 into main Sep 13, 2026
180 checks passed
@obviyus
obviyus deleted the fix/showall-membership branch September 13, 2026 00:38
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @obviyus!

Proof: After sign-in, Show all exposes both fetched account models in /models without another catalog request. Keep preserves the existing restrictions.

  • Bug: Show all confirmed success while fetched models stayed hidden.
  • Fix: The catalog retains discovered rows and applies the current visibility rules before publication.
Before After
The tested account listed 8 models after Show all. It lists all 10 models, including both fetched account models.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
## 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]>
obviyus added a commit that referenced this pull request Sep 22, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant