Skip to content

fix(plugins): scope runtime catalog discovery by provider - #129624

Merged
steipete merged 5 commits into
openclaw:mainfrom
ekinnee:codex/provider-runtime-catalog-outcomes
Aug 26, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
ekinnee:codex/provider-runtime-catalog-outcomes

Conversation

@ekinnee

@ekinnee ekinnee commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Recovery note

Restores #128863 after deletion of its source fork caused GitHub to close the original PR. This branch is the exact original head at 7f4c198; no code or history changed during recovery. The original review, comments, and evidence remain at #128863.

Related: #124008

Extracted from #126013. Complements #129307: that PR owns completed-catalog publication and metadata adoption; this PR owns provider-scope isolation before catalog auth and discovery.

What Problem This Solves

Prepared runtime now derives exact provider identities from effective agent references, maps them to owner plugins, forwards hook-local identities, and filters returned provider configs back to that same set.

The repair removes the unconditional union of global models.providers keys. Provider hooks gate work before credential resolution, plugin import, local probing, or network discovery; shared-family helpers filter members before their shared credential is resolved. Canonical IDs and registered/hook aliases take the same path.

This prevents an agent selected for one provider from authenticating against, probing, or publishing another agent's catalog merely because both are globally configured or share a plugin owner.

Compatibility Contract

An unreferenced models.providers.<id> entry is provider configuration, not live-discovery activation. Discovery is activated by an effective agent/default model reference, a provider wildcard, or authenticated-provider selection. Operators who need live discovery must use one of those activation paths.

This is the intended isolation-preserving upgrade contract and matches the documented configured-provider/wildcard model. Maintainer confirmation of that contract is the only remaining requested decision; author text does not represent that approval.

Coverage

Evidence

Current head: 309ff5271bc227c925671d47dad3ba3e1cbd310b; based on main@8bfcdbe884ce9fbdc7bce96b4daec60d8f04a97c.

  • Offline committed-range ClawSweeper: 9 files / 180 tests; no actionable finding.
  • Branch-mode autoreview: no accepted/actionable finding; overall patch correct (0.94); TruffleHog clean.
  • Final focused checks: SDK surface report (10 tests), embedded model-resolution consistency (8), and onboarding custom flow (13) passed.
  • node scripts/check-changed.mjs completed its selected final-head stages through the final pairing-account guard with no reported failure; git diff --check and that final guard passed independently.
  • The prior compact-shard SDK surface failure was a branch-local budget mismatch. Final head verifies public SDK exports = 4340 and the 10-test surface suite passes.

The production patch is unchanged from the linked real-flow proof; later changes were test-only routing adjustments and the non-production SDK budget correction.

Scope and LOC

  • production: +140/-41, net +99 across 9 owner-boundary paths;
  • tests: +407/-1, net +406;
  • docs: +6/-0;
  • raw total: +553/-42 across 19 files.

No Gateway readiness, UI polling, metadata invalidation, config, protocol, storage, migration, or outcome-contract changes remain in this PR.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@ekinnee
ekinnee marked this pull request as ready for review August 25, 2026 21:42
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 25, 2026, 7:46 PM ET / 23:46 UTC.

ClawSweeper review

What this changes

Scopes runtime provider-catalog discovery to each agent’s selected model providers, authenticated providers, and model-policy wildcards so unrelated configured providers are not probed.

Regression provenance

Possible regression — probable (reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep open: the accepted provider-isolation contract is implemented across the catalog owner boundary, but this review found a release-owned changelog edit to remove and could not directly inspect the Codex source contract cited by the PR.

Priority: P1
Reviewed head: 400c999861efe8be3758732cd89743e23eb8402e

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and supplied real-flow evidence are substantial, with a small release-process cleanup and direct Codex-contract verification still needed.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR supplies redacted after-fix real-flow output showing selected OpenAI discovery while unselected Azure identities make no credential or network calls.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies redacted after-fix real-flow output showing selected OpenAI discovery while unselected Azure identities make no credential or network calls.
Evidence reviewed 7 items Current-main defect: Current main still unions every models.providers key into the prepared discovery set; the PR removes that loop so only effective references and authenticated providers select discovery.
Scoped owner boundary: The PR normalizes selected provider IDs, maps them to plugin owners, passes hook-local identities, and filters returned provider rows to that scope.
Catalog hook contract: The generic runner forwards providerIds to hooks and suppresses catalog outcomes outside that selected set.
Findings 1 actionable finding [P3] Remove the release-owned changelog entry
Security None None.

How this fits together

Prepared model catalogs collect provider configuration for an agent before model selection and UI consumers read it. The change passes selected provider identities into plugin catalog hooks so credentials and live discovery are limited to the applicable providers.

flowchart LR
  A[Agent model references] --> B[Selected provider identities]
  C[Authenticated providers] --> B
  D[Model-policy wildcards] --> B
  B --> E[Plugin catalog hooks]
  E --> F[Credential and discovery gate]
  F --> G[Prepared model catalog]
  G --> H[Model selection and UI]
Loading

Before merge

  • Remove the release-owned changelog entry (P3) - CHANGELOG.md is release-owned under the repository policy; retain the user-visible release-note context in the PR body and let the release process generate the changelog entry.
  • Resolve merge risk (P1) - The bug-fix diff is production +167/-47 (net +120); the generic owner-to-hook scope contract explains the growth, but it should remain limited to this single canonical path.
  • Resolve merge risk (P1) - The PR cites Codex catalog/runtime behavior, but direct inspection of the required sibling Codex source could not be completed because ../codex is absent and network resolution failed.
  • Resolve merge risk (P1) - The branch is behind current main; merge should use a current-head rebase and exact-head checks.
  • Complete next step (P2) - A mechanical release-process cleanup is available on this PR branch; the remaining Codex source check is reviewer evidence, not a code repair.

Findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:72
Agent review details

Security

None.

PR surface

Source +120, Tests +489, Docs +7. Total +616 across 23 files.

View PR surface stats
Area Files Added Removed Net
Source 11 167 47 +120
Tests 10 493 4 +489
Docs 2 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 667 51 +616

Review metrics

Metric Value Why it matters
Production versus test delta production +167/-47 (net +120); tests +493/-4 (net +489); docs +6; release notes +1 The production growth carries the new cross-plugin scope contract and early gates; test growth covers selected, alias, family, and outcome paths.

Root-cause cluster

Relationship: canonical
Canonical: #129624
Summary: This PR restores the exact work of the deleted-source-fork PR and remains distinct from the already-merged downstream New Session consumer repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Complete the narrow pre-merge checks (recommended)
    Remove the release-owned changelog entry, directly inspect the cited Codex catalog contract, then rebase and validate the exact merge head.

Technical review

Best possible solution:

Keep the generic scoped-discovery path, remove the release-owned changelog line, directly verify the cited Codex catalog contract, then rebase and validate the exact merge head.

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

Yes, from source: current main adds every configured provider to discovery in src/agents/prepared-model-runtime.configured.ts, including providers absent from the effective agent model references.

Is this the best way to solve the issue?

Unclear: the implementation follows the accepted owner-scoped design and has focused coverage, but the PR’s cited Codex contract still needs direct source verification.

Full review comments:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:72
    CHANGELOG.md is release-owned under the repository policy; retain the user-visible release-note context in the PR body and let the release process generate the changelog entry.
    Confidence: 0.98

Overall correctness: patch is correct
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 80985b966325.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: The PR changes provider discovery and authentication behavior used by agent model catalogs.
  • merge-risk: 🚨 compatibility: Previously configured but unreferenced providers no longer activate live discovery, an accepted but upgrade-sensitive contract change.
  • merge-risk: 🚨 auth-provider: The patch changes which provider credentials and authenticated catalog requests are reachable during discovery.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies redacted after-fix real-flow output showing selected OpenAI discovery while unselected Azure identities make no credential or network calls.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies redacted after-fix real-flow output showing selected OpenAI discovery while unselected Azure identities make no credential or network calls.

Evidence

Acceptance criteria:

  • [P1] git diff --check.

What I checked:

Likely related people:

  • steipete: Authored the current provider-isolation head and recorded the accepted provider-scope contract in the PR discussion. (role: recent area contributor; confidence: high; commits: 400c999861ef; files: src/agents/models-config.providers.implicit.ts, src/plugins/provider-discovery.ts)
  • fuller-stack-dev: The maintainer discussion identifies the unconditional global-provider union as originating with the prepared-runtime work in this commit. (role: introduced adjacent behavior; confidence: medium; commits: a67ad03eea4b; files: src/agents/prepared-model-runtime.configured.ts)

Rank-up moves

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

  • Remove the release-owned CHANGELOG.md entry.
  • Directly inspect and record the cited Codex catalog/protocol contract for the current merge head.
  • Rebase onto current main and confirm required checks on the exact head.

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 (1 earlier review cycle)
  • reviewed 2026-08-25T21:49:08.155Z sha 7f4c198 :: needs maintainer review before merge. :: none

@steipete steipete self-assigned this Aug 25, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer decision: accept provider-scoped discovery. A configured models.providers.<id> entry supplies provider configuration; it does not, by itself, authorize catalog discovery for another agent. Effective agent model references, effective provider wildcards, and authenticated-provider selection determine discovery scope.

The compatibility concern in the earlier automated review does not apply to stable releases: the unconditional global-provider union originated in #116261 (a67ad03eea4b9953af9ccac89173a67d396413b1) and appears only in v2026.7.2-beta.6, v2026.7.2-beta.7, and v2026.8.1-beta.1 through beta.3. Stable v2026.7.1 already documents that explicitly configured Ollama disables automatic discovery and that explicitly configured vLLM needs an effective vllm/* wildcard to activate discovery.

The optional providerIds catalog-hook context field is an additive, backward-compatible SDK contract. Maintainer follow-up also closes the uncovered normal-live discovery, modern modelPolicy.allow wildcard, synthetic-auth, and cross-provider catalog-outcome gaps before landing.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 25, 2026
@steipete
steipete merged commit cbdfede into openclaw:main Aug 26, 2026
450 of 452 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…29624)

* fix: scope provider catalog discovery by selected identities

* fix(plugins): enforce agent-scoped live catalog discovery

Co-authored-by: Erick Kinnee <[email protected]>

* chore: keep provider release notes in pull request context

---------

Co-authored-by: Erick Kinnee <[email protected]>
Co-authored-by: Peter Steinberger <[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 docs Improvements or additions to documentation extensions: anthropic extensions: google extensions: ollama extensions: openai merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

2 participants