Skip to content

feat(plugins): discover provider setup from the ClawHub catalog - #135997

Closed
steipete wants to merge 1 commit into
mainfrom
codex/dynamic-provider-catalog
Closed

steipete wants to merge 1 commit into
mainfrom
codex/dynamic-provider-catalog

Conversation

@steipete

@steipete steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Provider plugins could be installable on ClawHub but absent from OpenClaw setup until another core catalog entry was maintained. The app's Add provider form also bypassed provider-owned setup and could not handle installation consent or multi-step authentication.

Companion publisher change: openclaw/clawhub#3573.

Why This Change Was Made

Setup and plugin management now share the accepted ClawHub catalog snapshot. Provider choices come from release-bound feed hints plus installed manifests; installed owners win, and the existing hosted model catalog or small feed previews supply display hints only. The redundant compiled provider index is removed. There is no new catalog JSON, registry, operator setting, environment variable, database schema, or Gateway protocol.

A shared preparation path installs the exact advertised package and reconciles the installed plugin/provider/auth-method identity before requesting credentials. Interactive CLI, non-interactive CLI, and guided setup use that owner. Gateway setup admits one fresh metadata generation and pins it through the wizard without replacing the running Gateway's cache. New installs and staged credentials remain subject to the existing consent, cancellation, live-probe, conflict, and persistence owners.

The app uses the existing provider wizard for both manual primary setup and configuration-only Add provider. Configuration-only completion refreshes provider state without claiming a successful inference check or changing the primary model. The old inline key/direct-config path is removed from manual-primary setup and Add provider; editing an existing provider key remains supported.

Dynamic CLI flags cannot shadow core options, implicit help, or inherited object properties. CLI auth inference uses parser-registered flags; programmatic callers retain trusted installed-manifest flags. Choice IDs remain opaque values instead of being reparsed from help text, and replacement commands use terminal-safe shell quoting. Sensitive prompt values are registered for redaction before provider validation or authentication can fail, including normalized pasted values.

User Impact

Eligible official provider releases can appear through normal ClawHub publication without a new OpenClaw provider-registration PR. This does not change publisher admission or authorize runtime behavior from catalog previews. Community packages remain explicitly installable, with their installed manifests supplying setup metadata. Bundled offline discovery, existing CLI choices, and the older manual API-key RPC remain supported.

Evidence

  • Regression-first coverage includes catalog identity drift, CLI collisions and non-interactive consent, prompted-secret redaction, setup snapshot ownership, install retention, and primary-model preservation.
  • Final focused backend/CLI checks: 808 passed across 33 files. UI owner suites: 401 passed. Four mocked browser suites: 16 passed.
  • Full changed-code gate passed for all 87 paths: core/UI/test typechecks, formatting, lint, plugin boundaries, dead exports, i18n, and runtime/storage/security guards. The CI workflow guard passed 238 tests with two expected skips.
  • Independent Codex autoreview: scoped clean at P0; manual source/contract review completed.
  • pnpm build passed, including runtime/plugin packaging, SDK declarations/exports, and UI performance budgets. The tracked source stayed unchanged.
  • Against that fresh build: the real managed-CLI/Gateway browser test passed (one test), followed by both guided inference/custom-provider E2E suites (nine tests). Both phases verified unchanged source/runtime artifacts and completed process cleanup. The dedicated real-Gateway CI lane now builds its canonical runtime/UI artifacts and includes the new test.

Browser evidence

Synthetic mocked-browser captures of the primary-provider flow. The inline key field is replaced by the provider-owned wizard.

Before After
Inline credential field before setup refactor Provider selection delegates authentication to its wizard

Provider-owned masked credential prompt

Real managed-Gateway proof

The browser exercised a real built CLI/Gateway and a locally installed synthetic provider: capability consent, its masked credential wizard, exact persisted credential readback, managed restart/reconnect, and the final configured card. The primary model stayed unchanged, and the fixture received zero inference requests. The existing public ClawHub feed was reachable with HTTP 200; this is not a production deployment of the companion feed changes.

Configured provider after managed restart; original primary preserved

real-gateway-setup-video.webm

The untrimmed video retains the brief restart/unavailable transition. The persistent “Server updated” toast comes from the E2E UI fixture's fixed version metadata; the final auth state is configured with one API-key profile and no auth-unavailable warning.

Rollout and boundaries

The companion ClawHub PR must be deployed before production feeds contain the new setup hints. Existing feeds remain usable through installed manifests and the bundled metadata overlay. No production deployment, release, or merge is part of these PRs.

Production delta: +1,628 / −1,756 (net −128); tests/test support: +2,235 / −1,328 (net +907); docs: +29; CI/tooling: net zero; generated i18n baseline: +7. The reduction removes the redundant provider index and duplicate setup paths. Added tests cover dynamic metadata, installer/credential ownership, and the real managed-Gateway browser flow.

Share the accepted plugin feed snapshot across setup and management, and
replace the compiled provider index with release hints and installed manifests.

Use one provider-owned preparation path for CLI and browser setup, reconcile
installed identities before collecting credentials, and preserve primary models
during configuration-only setup.
@clawsweeper

clawsweeper Bot commented Sep 2, 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 app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes commands Command implementations size: XL maintainer Maintainer-authored PR labels Sep 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 7, 2026, 11:43 AM ET / 15:43 UTC (Revision 3).

ClawSweeper review

What this changes

The PR discovers provider setup choices from the accepted ClawHub catalog and routes CLI and browser setup through provider-owned installation and authentication.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 5 items remain

This PR still provides distinct setup functionality absent from current main. The previously reported workspace-suppression defect remains unchanged, so the patch is not ready to merge.

Priority: P2
Reviewed head: acc89931442a7e6adffff93374abc3185ed3c4f2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong supplied runtime evidence supports the feature, but the unchanged provider-choice defect prevents merge readiness.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Preserved the supplied real managed-CLI/Gateway proof for provider-owned configuration: consent, masked authentication, persisted credential readback, restart/reconnect and primary-model preservation, supported by inspected images and the production-path harness. Catalog publisher deployment remains outside that demonstrated scenario. Existing storage representations are unchanged, and the existing-config proof supports the no-migration case.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Preserved the supplied real managed-CLI/Gateway proof for provider-owned configuration: consent, masked authentication, persisted credential readback, restart/reconnect and primary-model preservation, supported by inspected images and the production-path harness. Catalog publisher deployment remains outside that demonstrated scenario. Existing storage representations are unchanged, and the existing-config proof supports the no-migration case.
Evidence reviewed 11 items Introduced suppression defect: The introduced installedProviderIds set collects every registry record before workspace eligibility checks. Its later membership check skips catalog providers even when the contributing workspace record was excluded.
Caller and sibling eligibility: Guided setup discovery explicitly excludes workspace plugins. The manifest-choice sibling applies that exclusion before producing choices, leaving no replacement for an official provider suppressed by the catalog owner. Existing catalog tests cover disabled workspace install metadata, but not a different plugin ID contributing the same provider ID.
Review continuity: Both recorded review cycles examined acc8993, which remains the current head. The previous workspace-suppression finding and integration rank-up move remain applicable; the source comparison is empty.
Findings 1 actionable finding [P2] Exclude workspace records before collecting provider suppression IDs
Security None None.

How this fits together

Provider setup combines catalog metadata and installed plugin manifests into selectable authentication methods. CLI and browser wizards then install or enable the selected owner and persist credentials through existing setup boundaries.

flowchart TD
 A[ClawHub catalog] --> C[Eligible provider choices]
 B[Installed manifests] --> C
 C --> D[CLI or browser wizard]
 D --> E[Installation and capability consent]
 E --> F[Installed owner validation]
 F --> G[Provider authentication]
 G --> H[Credentials and configuration]
Loading

Before merge

  • Exclude workspace records before collecting provider suppression IDs (P2) - The new set includes every registry record before either workspace filter runs. A workspace plugin with a different plugin ID but the same provider ID as an official catalog entry therefore suppresses that entry even when includeWorkspacePlugins: false or the untrusted-workspace filter excludes it. Manifest discovery supplies no replacement, so guided setup loses the provider. Collect suppression IDs from eligible records before filtering for install metadata. This repeats the previously acknowledged late finding; both earlier reviews used this unchanged head.
  • Resolve merge risk (P1) - An excluded workspace plugin can suppress an eligible catalog provider, leaving its setup choice unavailable.
  • Resolve merge risk (P1) - Current-main conflicts must be resolved and the integrated setup paths validated; the pinned branch proof does not cover that future result.
  • Complete next step (P2) - Repair the workspace-suppression ordering, add collision regression coverage, and resolve current-main conflicts with integrated setup validation.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.

Findings

  • [P2] Exclude workspace records before collecting provider suppression IDs — src/plugins/provider-install-catalog.ts:164-166
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test delta production −128 net; tests/test support +907 net The pinned branch consolidates duplicate setup paths, but some deletion already landed separately and the delta must be reassessed after integration.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster

Relationship: canonical
Canonical: #135997
Summary: This branch owns the shared provider-catalog setup feature; linked cleanups and stacked reconnect work do not replace it.

Members:

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

Merge-risk options

Maintainer options:

  1. Repair eligibility before suppression (recommended)
    Collect suppression identities after workspace eligibility checks, cover cross-plugin provider-ID collisions, and validate the conflict-resolved CLI and browser setup paths.

Technical review

Best possible solution:

Keep one catalog-backed, provider-owned setup flow, with suppression identities collected only from eligible records and the merged catalog improvements preserved during integration.

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

Yes, source establishes the PR defect: exclude a workspace plugin whose provider ID matches a catalog provider under a different plugin ID. Its ID still enters the suppression set while its manifest choice is filtered out; no runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

Yes, sharing the existing catalog and provider wizard is the appropriate owner-boundary direction; a separate provider registry or another inline credential path would duplicate existing owners. The eligibility ordering must be corrected before this implementation is ready.

Full review comments:

  • [P2] Exclude workspace records before collecting provider suppression IDs — src/plugins/provider-install-catalog.ts:164-166
    The new set includes every registry record before either workspace filter runs. A workspace plugin with a different plugin ID but the same provider ID as an official catalog entry therefore suppresses that entry even when includeWorkspacePlugins: false or the untrusted-workspace filter excludes it. Manifest discovery supplies no replacement, so guided setup loses the provider. Collect suppression IDs from eligible records before filtering for install metadata. This repeats the previously acknowledged late finding; both earlier reviews used this unchanged head.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a useful bounded setup improvement with a specific provider-choice eligibility defect.
  • merge-risk: 🚨 auth-provider: The introduced suppression ordering can hide an eligible provider's authentication setup choice.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): Preserved the supplied real managed-CLI/Gateway proof for provider-owned configuration: consent, masked authentication, persisted credential readback, restart/reconnect and primary-model preservation, supported by inspected images and the production-path harness. Catalog publisher deployment remains outside that demonstrated scenario. Existing storage representations are unchanged, and the existing-config proof supports the no-migration case.
  • proof: sufficient: Contributor real behavior proof is sufficient. Preserved the supplied real managed-CLI/Gateway proof for provider-owned configuration: consent, masked authentication, persisted credential readback, restart/reconnect and primary-model preservation, supported by inspected images and the production-path harness. Catalog publisher deployment remains outside that demonstrated scenario. Existing storage representations are unchanged, and the existing-config proof supports the no-migration case.

Evidence

What I checked:

  • Introduced suppression defect: The introduced installedProviderIds set collects every registry record before workspace eligibility checks. Its later membership check skips catalog providers even when the contributing workspace record was excluded. (src/plugins/provider-install-catalog.ts:164, acc89931442a)
  • Caller and sibling eligibility: Guided setup discovery explicitly excludes workspace plugins. The manifest-choice sibling applies that exclusion before producing choices, leaving no replacement for an official provider suppressed by the catalog owner. Existing catalog tests cover disabled workspace install metadata, but not a different plugin ID contributing the same provider ID. (src/system-agent/setup-inference-detect.ts:75, acc89931442a)
  • Review continuity: Both recorded review cycles examined acc8993, which remains the current head. The previous workspace-suppression finding and integration rank-up move remain applicable; the source comparison is empty. (src/plugins/provider-install-catalog.ts:164, acc89931442a)
  • Current-main necessity: Current main still builds external provider choices from the existing official catalog reader and does not contain the new shared official-plugin-catalog-snapshot module. The merged prerequisite perf(plugins): retire the unused compiled provider index #139930 explicitly extracted only the inert compiled-index retirement, leaving this feature's feed, wizard, installation and credential work distinct. (src/plugins/provider-install-catalog.ts:213, 9ff750ce555b)
  • Real Gateway proof and existing-state compatibility: Inspected all four prepared images and the real-Gateway harness. The captured PR body reports successful capability consent, masked provider authentication, exact persisted credential readback and managed restart/reconnect. The final image shows a configured provider with one API-key profile and the existing primary model preserved. The harness checks those persistence facts and zero inference requests. This supports the installed-provider configuration flow; it does not establish deployment of new production feed hints. Existing credential and install-record representations remain unchanged. (ui/src/e2e/model-provider-setup.real-gateway.e2e.test.ts:307, acc89931442a)
  • Installation and authentication boundary: Provider preparation uses existing capability consent and lifecycle ownership, installs the advertised package, and reconciles installed plugin/provider/method identity before authentication. Catalog previews explicitly disable executable discovery authority. Configuration-only UI setup uses the existing admin-scoped wizard rather than direct credential config patches. (src/plugins/provider-auth-choice.ts:598, acc89931442a)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

  • Correct workspace eligibility before provider-ID suppression and cover different plugin IDs sharing one provider ID.
  • Resolve current-main conflicts while preserving merged catalog improvements, then validate the integrated setup paths.

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 (2 earlier review cycles)
  • reviewed 2026-09-02T05:48:51.660Z sha acc8993 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T22:00:14.161Z sha acc8993 :: blocked before merge. :: [P2] Exclude workspace records before collecting provider suppression IDs

@steipete

steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor Author

I have validated a narrow prerequisite cleanup that extracts the unused compiled provider-index retirement already included in this feature. The current index has only preview rows without install metadata or auth choices; its only production consumer therefore contributes no setup entries. The earlier model-list preview consumer was removed in #114393, and the remaining producer/consumer are unchanged from v2026.9.2.

The prerequisite removes 486 production lines and 525 tests tied to that inert source, plus the stale documentation while preserving its anchor. All 41 retained tests, two normal full builds, six complete setup-choice comparisons and 144 built CLI help calls passed. Help bytes remained identical; default onboarding medians improved 9–23% across the two orders, with all adverse controls recorded. The complete normal changed gate also passed. The measurement admission issue and external memory-limit retry are explicitly documented in the focused PR.

This overlaps your retirement intentionally and does not take over the ClawHub feed, wizard, installation, credential or UI work in this 87-file feature. The broader branch can absorb the prerequisite through rebase after it lands; The focused prerequisite is #139930. No feature branch rewrite or closure is requested.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Retiring this stale redesign. Making the ClawHub catalog authoritative for provider install and auth across CLI and UI needs a coordinated publisher rollout (companion openclaw/clawhub#3573). The compiled-index removal already landed separately in #139930.

Closed in a sweep of stale maintainer PRs (no activity for 7+ days). Reopen with a current reproduction if this still matters.

@steipete steipete closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant