Skip to content

refactor(plugins): consolidate provider registration flows - #129117

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-plugins-runtime-b6df91fd
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-plugins-runtime-b6df91fd

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The plugin registry repeated the same provider-registration ceremony across eleven capability families, making ownership bookkeeping, duplicate diagnostics, and synthesized catalog side effects unnecessarily expensive to maintain consistently.

Why This Change Was Made

Replace the eleven near-identical internal wrappers with one strongly typed registrar factory. Each family still owns the same registry bucket, plugin-owned identifier list, diagnostic wording, return values, and success-only voice or media catalog hook; public plugin APIs and provider behavior do not change.

User Impact

No user-visible behavior changes. Plugin developers keep every existing registration method and contract, while the internal implementation shrinks by 81 production lines (+111/-192) without adding abstractions, configuration, dependencies, or tests.

Evidence

  • Existing owner, public registration-capture, and bundled plugin contract suites pass unchanged: OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs src/plugins/registry.provider-like.test.ts src/plugins/captured-registration.test.ts src/plugins/contracts/registry.contract.test.ts (39 tests across three Vitest shards).
  • Changed-file gates pass: OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjs -- src/plugins/registry-registrars-providers.ts (production and test typechecks, formatting, lint, plugin boundaries, database-first and runtime-loader guards, import cycles, and auth guards).
  • Production, full-tree, and script dead-export scans also passed on the identical reviewed source in the initial changed-file run; the rerun skipped only that already-proven scan after fixing linked-worktree UI dependency resolution.
  • Fresh structured Codex autoreview found no actionable findings; independent source review verified all eleven family mappings, exact diagnostics/return values, and synthesized catalog ordering.

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

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 25, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 maintainer review before merge. Reviewed August 25, 2026, 4:07 AM ET / 08:07 UTC.

ClawSweeper review

What this changes

This PR replaces eleven repeated internal provider-registration wrappers with one typed registrar factory while preserving the public plugin registration methods and synthesized catalog hooks.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking correctness or security finding: the factory retains each family’s registration, ownership, duplicate-diagnostic, and catalog-hook behavior. This maintainer-labelled PR should remain open for normal exact-head CI completion and maintainer handling.

Priority: P3
Reviewed head: 9efd466fc03adfb08505fdad277d18794d04242b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, net-negative consolidation that preserves the current registration boundary and has relevant existing behavioral coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal registry refactor is exempt from the external-contributor real-behavior-proof gate; focused behavior tests remain the relevant validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal registry refactor is exempt from the external-contributor real-behavior-proof gate; focused behavior tests remain the relevant validation.
Evidence reviewed 5 items Current-main baseline: Current main still contains the repeated helper and per-family wrappers, so this PR’s central cleanup is not already implemented or obsolete.
Shared behavior preservation: The proposed factory performs the same trimmed-id validation, duplicate diagnostic, ownership update, and registration insertion before invoking only the success-only specialized catalog hook.
Caller and owner boundary: The registry composes this provider registrar with other domain registrars and exposes the same registration methods to plugin APIs.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/plugins/registry.provider-like.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs src/plugins/registry.provider-like.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129117-yRzKfR/target$ node scripts/run-vitest.mjs src/plugins/registry.provider-like.test.ts
node scripts/run-vitest.mjs src/plugins/registry.provider-like.test.ts
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129117-yRzKfR/target

 ✓  unit-fast  src/plugins/registry.provider-like.test.ts (7 tests) 15ms

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  08:08:04
   Duration  8.38s (transform 6.61s, setup 103ms, import 8.12s, tests 15ms, environment 0ms)

[test] passed 1 Vitest shard in 19.53s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129117-yRzKfR/target$ node scripts/run-vitest.mjs src/plugins/registry.provider-like.test.ts



































Assertions:

  • PASS expect_output: Test Files

How this fits together

Plugin packages register provider capabilities into the central plugin registry during loading. The registry records ownership and diagnostics, then supplies provider lookups and synthesized voice or media model catalogs to later runtime flows.

flowchart LR
  A[Plugin package] --> B[Registration methods]
  B --> C[Shared provider registrar]
  C --> D[Registry ownership and diagnostics]
  D --> E[Runtime provider lookup]
  D --> F[Voice and media catalogs]
Loading

Before merge

  • Complete next step (P2) - This is an active maintainer-labelled refactor with no discrete repair for an automated work lane; complete normal exact-head validation and maintainer review.
Agent review details

Security

None.

PR surface

Source -81. Total -81 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 111 192 -81
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 111 192 -81

Review metrics

Metric Value Why it matters
Production versus test LOC production +111/-192 (net -81); tests 0 The refactor materially reduces repeated production code without changing test surfaces or public API shape.

Technical review

Best possible solution:

Land the single canonical registrar after the exact-head validation completes, retaining the existing public registration API and focused behavioral contract tests.

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

Not applicable: this PR is an internal refactor, not a report of failing user behavior.

Is this the best way to solve the issue?

Yes. The factory centralizes the exact shared registration invariant while leaving family-specific catalog metadata at each registration site.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8f243929e42f.

Labels

Label justifications:

  • P3: This is a behavior-preserving internal maintainability refactor with no intended user-visible change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal registry refactor is exempt from the external-contributor real-behavior-proof gate; focused behavior tests remain the relevant validation.

Evidence

What I checked:

Likely related people:

  • steipete: Blame attributes the current provider-like helper and focused registry test to the 2026-08-24 plugin-registry work, and this PR refactors that same owner boundary. (role: introduced current behavior and recent area contributor; confidence: high; commits: 28c9f9abd80b, 9efd466fc03a; files: src/plugins/registry-registrars-providers.ts, src/plugins/registry.provider-like.test.ts)

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-25T07:37:57.166Z sha 9efd466 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review August 25, 2026 08:03
@steipete
steipete merged commit db1b8a1 into main Aug 25, 2026
481 of 483 checks passed
@steipete
steipete deleted the codex/refactor-plugins-runtime-b6df91fd branch August 25, 2026 08:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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