Repository navigation
refactor(plugins): simplify registration lifecycle policy - #133364
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:39 PM ET / 20:39 UTC. ClawSweeper reviewWhat this changesThe PR replaces the plugin lifecycle policy table with a typed set of the eight runtime-callable methods and removes an unreachable duplicate function-export fallback. Merge readinessNo blocking introduced defect was found. The branch preserves the existing registration boundary and supported plugin-export shapes; it should remain open for completed exact-head checks and normal maintainer merge handling. Priority: P3 Review scores
Verification
How this fits togetherPlugin modules are resolved by the loader and synchronously register capabilities into a registry. The registration guard closes afterward, allowing only selected runtime-safe API methods to be retained by plugins. flowchart LR
A[Plugin module] --> B[Module export resolver]
B --> C[Plugin registration]
C --> D[Lifecycle guard]
D --> E[Runtime-safe API methods]
D --> F[Closed registration methods]
Decision needed
Why: The PR is maintainer-owned and carries the protected maintainer label, which requires explicit human merge handling even though no source defect was found. Before merge
Agent review detailsSecurityNone. PR surfaceSource -28, Tests +21, Other -1. Total -8 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the direct set-based policy and single resolver path, then merge after the exact head has completed its required checks. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-neutral internal refactor, not a reported user-facing defect. Is this the best way to solve the issue? Yes. A set directly expresses the sole binary policy decision, and the removed fallback is already covered by the preceding candidate loop; retaining the former policy objects or fallback would add redundant paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 05e9030d7380. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
71bb96e to
8a893db
Compare
8a893db to
3a27672
Compare
|
Merged via squash.
|
…cked-delivery * origin/main: (261 commits) fix(clawdock): keep credentials out of diagnostic output (openclaw#133547) refactor(ui): avoid redundant presence work in avatar lists (openclaw#133548) fix(agents): recognize internal requester completion replies (openclaw#133543) fix: prevent duplicate queued user messages in chat clients (openclaw#133542) chore(ui): refresh control ui locales (openclaw#133544) fix(beam): restart delivery when the receiver changes (openclaw#133533) fix(models): recover /models browse from a replaced prepared catalog (openclaw#133221) perf(terminal): reuse control scans and remove repeated sanitization work (openclaw#133527) perf(agents): prepare only consumed tool and skill diagnostics (openclaw#133512) fix(line): offer the card command only on LINE (openclaw#132895) fix: keep Android publication independent of core release (openclaw#133471) refactor(agents): simplify compaction accounting (openclaw#133521) refactor(plugins): simplify registration lifecycle policy (openclaw#133364) perf(plugins): avoid eager loader imports for active registry reads (openclaw#133518) refactor(ui): consolidate chat rendering ownership (openclaw#133508) test(auto-reply): prepare memory flush model capabilities (openclaw#133532) fix(ui): replace startup hourglasses with capacity-aware rings (openclaw#133470) fix(talk): preserve provider conversation order in browser transcripts (openclaw#133493) fix(ui): deduplicate participant and viewer avatars (openclaw#133519) feat(ui): add CRT terminal theme (openclaw#133495) ...
What Problem This Solves
The plugin registration lifecycle carries an unused policy layer even though its only decision is whether a method remains callable after registration. The nearby module-export resolver also repeats a callable fallback that its earlier candidate walk already handles.
Why This Change Was Made
Use one typed set for the existing eight late-callable methods and remove the unreachable callable fallback. Registration closes at the same boundary; the object-definition fallback and its observable second
registerproperty read remain intact. The assertion baseline only shrinks to record the two removed assertions.This is a bounded, maintainer-requested cleanup. It does not add configuration, change plugin API methods, relax registration ownership, or remove an external compatibility path. The reachability argument assumes ordinary JavaScript intrinsics, not arbitrary mutation of built-in collection methods by a plugin.
User Impact
No intended user-visible change. Plugins retain the same registration-only and runtime-callable behavior with less internal policy machinery to maintain.
Production LOC: +12 / -40 (28 removed). Tests: +21 / -0. Assertion baseline: +1 / -2. Whole change: 8 lines removed.
Evidence
The current candidate is
3a276728a803153a98cfe077b83d267b867539be, based on84fde8560d9ac0269c2fc186fd933bb1f11888d1. The previous candidate's CI run failed the Gateway shutdown admission assertion. Canonical #133466 repairs the non-isolated test runner's between-file cleanup ordering; this candidate incorporates that landed repair rather than adding a duplicate fix. The three cleanup production/test afterimages remain identical; the shrink-only assertion baseline also preserves the upstream model-scan row change.pnpm execattempts failed eight isolated Corepack bootstrap cases. The normal package-scriptnpm_execpathcontract was then verified, and unchanged tests passed throughpnpm test, without enabling networking, weakening assertions, or changing timeouts. Both those setup failures and the later hosted shutdown failure remain recorded.Exact composed commands (pinned Node 24.19.0 and repository pnpm 12.1):
pnpm test test/non-isolated-runner.test.ts src/gateway/worker-environments/computer-transport.shutdown.test.ts src/process/gateway-work-admission.test.ts src/plugins/api-lifecycle.test.ts src/plugins/contracts/run-context-lifecycle.contract.test.ts src/plugins/loader.cli-metadata.test.ts src/plugins/loader.test.ts -- --reporter=verbose node scripts/check-changed.mjs --base 84fde8560d9ac0269c2fc186fd933bb1f11888d1 -- config/assertion-safety-baseline.txt src/plugins/api-lifecycle.test.ts src/plugins/api-lifecycle.ts src/plugins/loader-module-runtime.tsThese are local owner-boundary tests and checks, not a live Gateway, channel, provider, or packaged-plugin run. Exact-head CI33333932606 completed successfully on
3a276728a803153a98cfe077b83d267b867539be; the normal exact-head watcher returned GREEN. Normal native hosted preparation and merge remain unexecuted. No earlier failed or older-head run is treated as green evidence.The watcher retained a raw aggregate FAILURE from six superseded old contexts while the attached current CI run completed successfully. This is the canonical normalized result, not a claim that every historical context passed.
The latest ClawSweeper review, reviewed at 20:39 UTC on the exact candidate, found no actionable source or security defect. Its outstanding exact-head-check item is now satisfied; there was no separate Rank-up moves list. Normal maintainer preparation and merge handling remain. The fixed current-main observation at
661fedfe55e7b9620ef89747c381e5a6fc88622cretained all 38 reviewed owner/context files and the trusted launcher closure; unrelated assertion-baseline changes do not alter the two cleanup reductions. This is a static composition check, not new full-main runtime proof.Final source comparison against
69b819680ba8d38e4717ff91267376164fb57d6aalso preserves the upstream test-runner cleanup from #133368. Its two ordered admission cases were not part of this candidate's recorded 34 nested cases. The plugin owners and other reviewed contexts remain unchanged; this comparison is not a new test execution.