Repository navigation
refactor(plugins): consolidate provider registration flows - #129117
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 4:07 AM ET / 08:07 UTC. ClawSweeper reviewWhat this changesThis 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 readinessNo 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 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherPlugin 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -81. Total -81 across 1 file. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
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
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).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).