Repository navigation
refactor(plugins): delete registry compat scaffolding - #117749
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 11:59 PM ET / August 2, 2026, 03:59 UTC. ClawSweeper reviewWhat this changesThe PR deletes legacy multi-registry pinning, compatibility matching, standalone activating loaders, and Gateway binding state now that plugin installation is root-owned and scoped consumers receive non-activating registry handles. Merge readinessKeep this PR open for maintainer review. The supplied exact-head terminal transcripts and successful CI materially satisfy the prior proof request, and the branch appears to complete the already-merged root-owned registry architecture; however, this read-only checkout lacks the PR objects and cannot fetch them, so a full current-head source/diff review is not possible here. The existing Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s plugin loader builds registries from configuration and makes one registry process-active for Gateway and CLI lifecycles. Agents and feature-specific runtime paths should use scoped registry handles so they cannot replace Gateway-owned plugins, hooks, routes, or channel metadata. flowchart LR
Config[Plugin configuration] --> Loader[Plugin loader]
Loader --> Root[Process-root registry]
Loader --> Handles[Scoped registry handles]
Root --> Gateway[Gateway, routes, channels, hooks]
Handles --> Consumers[Agents and feature runtimes]
Gateway --> Shutdown[Gateway shutdown]
Shutdown --> Cleanup[Plugin cleanup and registry clear]
Decision needed
Why: The proof gate appears satisfied, but the protected Before merge
Agent review detailsSecurityNone. Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Review the exact current head against the merged root-owned installation boundary, confirm every remaining process activation is a composition-root operation, and merge only if the three supplied runtime proofs still match that head after any rebase. Do we have a high-confidence way to reproduce the issue? Not applicable as a standalone issue: this is a structural cleanup PR. The contributor supplied high-confidence after-fix runtime evidence for the affected lifecycle, but this reviewer could not independently execute or inspect the exact branch because its Git objects were unavailable locally and network resolution failed. Is this the best way to solve the issue? Unclear: the root-owned registry model is consistent with the repository’s stated plugin boundary and the merged predecessor work, but the best-fix judgment needs the exact branch/merge-result inspection to prove every pinned consumer has been retired safely. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 564c6dee83b4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Exact-head runtime proof (head
|
|
Merged via squash.
|
* refactor(plugins): delete registry compat scaffolding * test(plugins): update CLI registry handle mock * fix(plugins): preserve explicitly initialized hook registries * test(plugins): update registry ownership fixtures * fix(channels): restore registry snapshot memo
What Problem This Solves
The plugin loader carried ~2,300 production lines of defense machinery whose sole reason was that scoped loads could swap the process-wide active registry: three separately pinned surfaces with four competing selection heuristics, cache-key permutation matching (up to eight synthesized variants), 260 lines of hook-runner owner arbitration across divergent registries, a scope ratchet, a standalone activating loader, and the process-global gateway-bindings singleton. Phase 2a (#117372) moved contributions onto the registry value; Phase 2b (#117587) removed the cause by making installation root-owned. This PR deletes the defenses.
Final structural PR of the reviewed architecture series.
Why This Change Was Made
Every deletion target was verified unreachable or redundant before removal:
getActive*accessors are direct root-registry reads. Hot reload no longer pins — it prepares the replacement root without exposing it, preserves the exact drain/stop-channels ordering and stale-generation abort/rollback semantics, and performs a plain root activation at the existing commit boundary; the old root retires only after the new generation commits.getGlobalHookRunnerstays byte-compatible, reading the root registry with contribution-based ALS overlays — the architectural subtlety here is overlaying by actual contribution rather than registry ownership, so a scoped handle contributing one hook family cannot hide unrelated root hooks or fail-closed policies.User Impact
None intended at any external surface. Operationally: one registry, one owner, one truthful lifecycle — the classes of bug this machinery defended against (wrong-registry resolution, hook loss, cross-generation leaks) are structurally unrepresentable.
Evidence
pnpm buildclean; changed-surfacevi.mocksweep clean; iterative autoreview to clean.origin/mainfails identically on this host under the current load (~29-32, unrelated parallel build + Spotlight indexing), while the gateway itself reaches ready in ~2s. Environmental, not the branch; remote executors were unavailable (Blacksmith CLI missing, AWS broker unauthenticated) so the documented trusted-source local fallback applies, and hosted Linux CI on this PR is the authoritative arbiter.🤖 Generated with Claude Code
Exact-head runtime proof (added post-review)
All three artifacts at head 841dc9a: the SQLite flip-proof e2e PASSES 1/1 (108s) through the pinless activation/cleanup/close path — the earlier local timeouts reproduced identically on clean main under host load ~30 and vanished at load ~9; handle-isolation transcript on the real dist (scoped loads leak nothing into the root registry); live ephemeral gateway boot and close on the exact-head dist (3 plugins in 0.6s, readyz 200, clean 32ms shutdown). Transcripts: #117749 (comment)