Skip to content

fix(models): stop model checks from rediscovering providers - #142375

Merged
obviyus merged 2 commits into
mainfrom
refactor/published-capability-reader
Sep 8, 2026
Merged

obviyus merged 2 commits into
mainfrom
refactor/published-capability-reader

Conversation

@obviyus

@obviyus obviyus commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #136257, #125969, #142100.

What Problem This Solves

Fixes an issue where an ordinary session model-selection command started provider discovery even though browsing should use published inventory.

Why This Change Was Made

Turn capability, subagent/hook validation and probe planning read the published catalog. Remove separate live and manifest fallbacks for missing facts, retain catalog ownership through asynchronous projection, and reuse configured rows already captured by visibility policy.

User Impact

Model selection saves the requested model without unrequested discovery. Explicit Refresh still acquires new inventory. Existing route checks, tool refusals and authentication boundaries remain.

Consumers: model selection, capability validation and public cached catalog reads use published facts.

Evidence

A real Gateway reproduced two unrequested discovery calls before the fix. The candidate saved the exact selection with no catalog or inference requests; explicit Refresh then published the model. Fifty-nine focused controls passed. Compiled public-interface checks confirmed passive getters; standalone installation and external inference were not tested.

@obviyus obviyus self-assigned this Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 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 docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Sep 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 8, 2026, 3:18 PM ET / 19:18 UTC (Revision 4).

ClawSweeper review

What this changes

Model selection, capability checks, and probe planning reuse published model inventory instead of acquiring additional provider catalogs.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: current main still needs this repair, and no blocking code defect was established. The previous startup-test finding is resolved; the remaining concern is acceptance of the shipped capability-fallback change.

Priority: P2
Reviewed head: 7d956f25bf180ce4aea6f2885e495bff17f270a5
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-based repair with useful real Gateway observations and no established blocking code defect; upgrade acceptance remains outstanding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body reports the real CLI/Gateway selection path saving the exact model with zero discovery requests, followed by explicit Refresh acquiring and publishing capability facts in a qualified compiled checkout. This supports the central repair, while stable-upgrade acceptance remains a compatibility question.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body reports the real CLI/Gateway selection path saving the exact model with zero discovery requests, followed by explicit Refresh acquiring and publishing capability facts in a qualified compiled checkout. This supports the central repair, while stable-upgrade acceptance remains a compatibility question.
Evidence reviewed 9 items Introduced passive capability reader: The introduced delta replaces manifest and scoped-discovery fallbacks with an owner-held read, preserves input-route matching, and makes the nonblocking getter prefer completed inventory.
Still necessary on current main: Fetched main retains manifest, scoped-static, and scoped-live fallback acquisition in the capability reader. The merged browsing repair at #142063 does not remove this remaining path.
Released fallback contract: The v2026.9.3 capability reader also falls through to scoped live discovery when published and static capability facts are missing. The release source was recovered through GitHub after local blob inspection failed.
Findings None None.
Security None None.

How this fits together

OpenClaw’s prepared model catalog combines configured models and completed provider inventory. Chat selection, subagent validation, and model probes consume its capability facts before choosing or running a model.

flowchart LR
  A[Configured models] --> C[Published catalog owner]
  B[Explicit provider refresh] --> C
  C --> D[Model selection]
  C --> E[Capability checks]
  E --> F[Thinking and image support]
  D --> G[Selected session model]
Loading

Decision needed

Question Recommendation
Is the compiled Gateway evidence sufficient to accept removal of v2026.9.3 capability fallback discovery, or should stable-upgrade and SDK-reader evidence precede landing? Verify the upgrade boundary: Confirm existing runtime-only models and SDK cache-only readers before and after Refresh on an upgrade from v2026.9.3.

Why: The central workflow is demonstrated, but the submitted evidence explicitly excludes stable upgrades and does not demonstrate the public SDK getter’s changed results.

Before merge

  • Resolve merge risk (P1) - Models whose thinking or image capabilities previously came from automatic discovery can retain missing capability facts until explicit Refresh. The compiled Gateway demonstration does not establish behavior when upgrading existing v2026.9.3 state, including public SDK cache-only consumers.
  • Complete next step (P2) - Record acceptance of the shipped capability-fallback and SDK-reader cutover, preferably backed by v2026.9.3 upgrade results before and after Refresh.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source -71, Tests -3, Docs +2. Total -72 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 6 56 127 -71
Tests 6 232 235 -3
Docs 1 4 2 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 292 364 -72

Review metrics

Metric Value Why it matters
Public reader semantics 1 exported getter changes catalog preference SDK cache-only consumers now receive completed inventory ahead of configured inventory.

Merge-risk options

Maintainer options:

  1. Establish capability continuity (recommended)
    Record upgrade results for configured and runtime-only capabilities plus public SDK cache-only reads before accepting the cutover.
  2. Accept explicit-refresh recovery
    Accept that previously automatic capability discovery now requires Refresh and record that rollout decision.

Technical review

Best possible solution:

Keep one published inventory with explicit Refresh, and establish an accepted upgrade path that preserves configured capabilities and makes missing capability recovery understandable.

Do we have a high-confidence way to reproduce the issue?

Yes: current main falls through to provider-scoped live discovery when selected-model capability facts are missing; the submitted baseline Gateway observations report the corresponding tags/show requests. This review did not execute target code.

Is this the best way to solve the issue?

Yes for the core repair: reusing the existing catalog owner removes competing acquisition paths while preserving configured settings and route checks. Upgrade acceptance remains separate from code correctness.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against dcba0d6c580c.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports the real CLI/Gateway selection path saving the exact model with zero discovery requests, followed by explicit Refresh acquiring and publishing capability facts in a qualified compiled checkout. This supports the central repair, while stable-upgrade acceptance remains a compatibility question.

Label justifications:

  • P2: This is a bounded model-selection reliability repair without evidence of an urgent production outage.
  • merge-risk: 🚨 compatibility: The branch removes released capability fallback behavior and changes results exposed through a public SDK getter.
  • 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 captured body reports the real CLI/Gateway selection path saving the exact model with zero discovery requests, followed by explicit Refresh acquiring and publishing capability facts in a qualified compiled checkout. This supports the central repair, while stable-upgrade acceptance remains a compatibility question.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports the real CLI/Gateway selection path saving the exact model with zero discovery requests, followed by explicit Refresh acquiring and publishing capability facts in a qualified compiled checkout. This supports the central repair, while stable-upgrade acceptance remains a compatibility question.

Evidence

What I checked:

  • Introduced passive capability reader: The introduced delta replaces manifest and scoped-discovery fallbacks with an owner-held read, preserves input-route matching, and makes the nonblocking getter prefer completed inventory. (src/agents/prepared-model-catalog.ts:369, 7d956f25bf18)
  • Still necessary on current main: Fetched main retains manifest, scoped-static, and scoped-live fallback acquisition in the capability reader. The merged browsing repair at refactor(models): read published catalog inventory through the Gateway #142063 does not remove this remaining path. (src/agents/prepared-model-catalog.ts:366, dcba0d6c580c)
  • Released fallback contract: The v2026.9.3 capability reader also falls through to scoped live discovery when published and static capability facts are missing. The release source was recovered through GitHub after local blob inspection failed. (src/agents/prepared-model-catalog.ts, 1391f7cd2d40)
  • Observable capability consequence: Image-support resolution honors explicit configured input first, then calls the changed capability reader; missing route-matched input produces no image-support fact. Configured thinking preferences likewise remain ahead of catalog-derived defaults. (src/auto-reply/reply/agent-runner-run-params.ts:75, 7d956f25bf18)
  • Public SDK reader exposure: The SDK exports the changed getter and delegates legacy cache-only reads to it. Existing tests protect nonblocking behavior, while the PR explicitly declares the completed-inventory behavior as intentional. (src/plugin-sdk/agent-runtime.ts:37, 7d956f25bf18)
  • Updated real Gateway evidence: The captured body, source revision b083613c8746559d8b061725b9d587ecc90b2de9987257c83c9c14d27c265f57, reports an authenticated Gateway selection saving the exact model with zero catalog or inference requests, followed by explicit Refresh acquiring tags/show and publishing capabilities. It binds the compiled candidate to artifact 10068864891 and production head 0dcde09, and expressly excludes standalone-install and stable-upgrade claims. (0dcde098a4db)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the stable-upgrade and public SDK-reader acceptance question with capability results before and after explicit Refresh.

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-08T17:42:15.073Z sha 0dcde09 :: blocked before merge. :: [P2] Migrate the startup tests to the surviving catalog getter
  • reviewed 2026-09-08T18:04:57.007Z sha 7d956f2 :: blocked before merge. :: none
  • reviewed 2026-09-08T18:27:48.580Z sha 7d956f2 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 8, 2026
@obviyus
obviyus merged commit bdc55c4 into main Sep 8, 2026
212 of 213 checks passed
@obviyus
obviyus deleted the refactor/published-capability-reader branch September 8, 2026 19:36
@obviyus

obviyus commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

Proof: A real authenticated Gateway model command saves ollama/catalog-probe:latest without starting provider discovery. Explicit Refresh then acquires and publishes its reasoning and text-input capabilities.

Before After
Model selection sends two unrequested catalog requests. Model selection sends no catalog or inference requests; explicit Refresh sends the two catalog requests.
  • The shared capability reader uses published facts and retains temporary ownership through asynchronous projection. Connected fallback and duplicate getter paths are removed.
  • Validation: 59 distinct focused controls, a compiled public SDK getter/cache-only sequence before and after Refresh, qualified independent public acceptance, exact-head local ClawSweeper review, and green required CI.
  • The public run uses the compiled checkout and read-only source plugin overlays. It does not claim a standalone installation or stable-release upgrade. Earlier failed attempts and missing historical receipts remain in the retained evidence.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
…#142375)

Make ordinary model selection and capability readers consume captured published inventory. Keep explicit Refresh as the acquisition path, preserve native harness reads and temporary owner lifetime, and retire the connected manifest/discovery fallback and duplicate getter.

The baseline made two unrequested catalog calls during a normal model selection. The candidate saves the same selection with no catalog or inference calls; explicit Refresh still acquires and publishes capabilities. Validation includes 59 distinct focused controls, the real authenticated Gateway sequence, independent public acceptance, exact-head local review, and required CI. Compiled checkout and source-plugin limits and prior failed proof remain in the PR evidence.

Co-authored-by: Ayaan Zaidi <[email protected]>
steipete added a commit that referenced this pull request Sep 9, 2026
Avoid full provider module loading during cold session resets. Reuse published catalog owners and leave missing thinking/input facts absent without acquiring temporary inventory; preserve native harness observations and explicit catalog acquisition. Follow up on #142375.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
Avoid full provider module loading during cold session resets. Reuse published catalog owners and leave missing thinking/input facts absent without acquiring temporary inventory; preserve native harness observations and explicit catalog acquisition. Follow up on openclaw#142375.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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