Repository navigation
refactor(plugins): reuse scoped loader for capability discovery - #117373
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 11:15 AM ET / 15:15 UTC. ClawSweeper reviewWhat this changesThe PR routes bundled capability discovery through the canonical scoped plugin loader, adds an optional Merge readinessCurrent main does not contain this scoped-loader refactor or the Discord discovery repair, and the PR has no concrete correctness finding. Because it adds a documented public Plugin SDK lifecycle callback and carries the protected Priority: P2 Review scores
Verification
How this fits togetherOpenClaw discovers bundled plugins into a registry that later supplies provider and channel capabilities to runtime workflows. This PR replaces a parallel discovery loader with the shared scoped loader and separates inert capability registration from channel activation. flowchart LR
A[Bundled plugin manifests] --> B[Capability discovery]
B --> C[Scoped plugin loader]
C --> D[Channel entry registration]
D --> E[Capability registry]
E --> F[Provider and channel workflows]
Decision needed
Why: This is an additive public Plugin SDK contract, not merely an internal refactor; its future compatibility lifecycle requires maintainer intent even though the current implementation and tests are coherent. Before merge
Agent review detailsSecurityNone. PR surfaceSource -406, Tests +155, Docs +8, Generated 0. Total -243 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Accept the additive callback only as a documented stable SDK lifecycle, then rebase onto current main and repeat the focused discovery/registry proof plus required checks on the resulting head. Do we have a high-confidence way to reproduce the issue? Yes, by source and supplied exact-head proof: a nonactivating scoped load of Discord previously used the setup entry and omitted the transcript provider; the branch test and reported cold-load output establish the intended current branch behavior. This read-only review did not execute the test. Is this the best way to solve the issue? Yes, conditionally: routing discovery through the existing scoped loader removes a large duplicate implementation, while the separate callback keeps inert capability registration out of full activation. The remaining question is whether maintainers accept this public SDK lifecycle permanently. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 71a59512ba47. LabelsLabel 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) |
1f0290d to
eef23d9
Compare
|
Merged via squash.
|
* origin/main: (44 commits) fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486) fix(doctor): reject contradictory lint check selectors (openclaw#117495) fix(anthropic): honor configured model pricing (openclaw#117275) refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373) refactor(test): derive changed tooling routes (openclaw#117407) fix(kova): clarify extension memory attribution (openclaw#117500) fix(imessage): sanitize private context on every outbound path (openclaw#117501) fix(ci): align release validation fixtures (openclaw#117494) fix(talk): preserve owner authorization in realtime consults (openclaw#114163) fix(ui): surface aborted-run diagnostics (openclaw#117497) perf(models): skip Ollama row runtime loading (openclaw#117465) fix(cli): report user profile command outcomes (openclaw#117466) fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419) fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412) fix(models): avoid waiting on promotions before listing models (openclaw#117322) refactor(plugins): inherit shared package boundary settings (openclaw#117474) fix(systemd): parse all inline environment assignments (openclaw#117484) feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545) fix(qa): Slack progress lane misses successful delivery (openclaw#117391) refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476) ...
* origin/main: (41 commits) fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486) fix(doctor): reject contradictory lint check selectors (openclaw#117495) fix(anthropic): honor configured model pricing (openclaw#117275) refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373) refactor(test): derive changed tooling routes (openclaw#117407) fix(kova): clarify extension memory attribution (openclaw#117500) fix(imessage): sanitize private context on every outbound path (openclaw#117501) fix(ci): align release validation fixtures (openclaw#117494) fix(talk): preserve owner authorization in realtime consults (openclaw#114163) fix(ui): surface aborted-run diagnostics (openclaw#117497) perf(models): skip Ollama row runtime loading (openclaw#117465) fix(cli): report user profile command outcomes (openclaw#117466) fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419) fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412) fix(models): avoid waiting on promotions before listing models (openclaw#117322) refactor(plugins): inherit shared package boundary settings (openclaw#117474) fix(systemd): parse all inline environment assignments (openclaw#117484) feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545) fix(qa): Slack progress lane misses successful delivery (openclaw#117391) refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476) ...
…claw#117373) * refactor(plugins): reuse scoped loader for capabilities * fix(plugins): retain channel capabilities during discovery
* origin/main: (44 commits) fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486) fix(doctor): reject contradictory lint check selectors (openclaw#117495) fix(anthropic): honor configured model pricing (openclaw#117275) refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373) refactor(test): derive changed tooling routes (openclaw#117407) fix(kova): clarify extension memory attribution (openclaw#117500) fix(imessage): sanitize private context on every outbound path (openclaw#117501) fix(ci): align release validation fixtures (openclaw#117494) fix(talk): preserve owner authorization in realtime consults (openclaw#114163) fix(ui): surface aborted-run diagnostics (openclaw#117497) perf(models): skip Ollama row runtime loading (openclaw#117465) fix(cli): report user profile command outcomes (openclaw#117466) fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419) fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412) fix(models): avoid waiting on promotions before listing models (openclaw#117322) refactor(plugins): inherit shared package boundary settings (openclaw#117474) fix(systemd): parse all inline environment assignments (openclaw#117484) feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545) fix(qa): Slack progress lane misses successful delivery (openclaw#117391) refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476) ...
* origin/main: (27 commits) fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486) fix(doctor): reject contradictory lint check selectors (openclaw#117495) fix(anthropic): honor configured model pricing (openclaw#117275) refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373) refactor(test): derive changed tooling routes (openclaw#117407) fix(kova): clarify extension memory attribution (openclaw#117500) fix(imessage): sanitize private context on every outbound path (openclaw#117501) fix(ci): align release validation fixtures (openclaw#117494) fix(talk): preserve owner authorization in realtime consults (openclaw#114163) fix(ui): surface aborted-run diagnostics (openclaw#117497) perf(models): skip Ollama row runtime loading (openclaw#117465) fix(cli): report user profile command outcomes (openclaw#117466) fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419) fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412) fix(models): avoid waiting on promotions before listing models (openclaw#117322) refactor(plugins): inherit shared package boundary settings (openclaw#117474) fix(systemd): parse all inline environment assignments (openclaw#117484) feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545) fix(qa): Slack progress lane misses successful delivery (openclaw#117391) refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476) ...
* origin/main: (41 commits) fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486) fix(doctor): reject contradictory lint check selectors (openclaw#117495) fix(anthropic): honor configured model pricing (openclaw#117275) refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373) refactor(test): derive changed tooling routes (openclaw#117407) fix(kova): clarify extension memory attribution (openclaw#117500) fix(imessage): sanitize private context on every outbound path (openclaw#117501) fix(ci): align release validation fixtures (openclaw#117494) fix(talk): preserve owner authorization in realtime consults (openclaw#114163) fix(ui): surface aborted-run diagnostics (openclaw#117497) perf(models): skip Ollama row runtime loading (openclaw#117465) fix(cli): report user profile command outcomes (openclaw#117466) fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419) fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412) fix(models): avoid waiting on promotions before listing models (openclaw#117322) refactor(plugins): inherit shared package boundary settings (openclaw#117474) fix(systemd): parse all inline environment assignments (openclaw#117484) feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545) fix(qa): Slack progress lane misses successful delivery (openclaw#117391) refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476) ...
What Problem This Solves
Bundled capability discovery had a 545-line parallel plugin loader that duplicated root containment, module loading, registration capture, diagnostics, rollback, and provider projection. It also ran a nonactivating snapshot in
fullregistration mode and treated manifest declarations as proof that runtime capabilities actually existed.The canonical-loader migration exposed a genuine cold-start Discord regression: an unconfigured channel selected its setup-runtime entry, which cannot publish capability providers, while Discord registered
discord-voiceonly from its full-runtime callback. Operators therefore got a loaded plugin advertising voice transcripts while the actual transcript provider registry was empty.Canonical Owner-Boundary Repair
cache: false,activate: false, and a narrow fail-closed registration runtime.forceFullRuntimeForChannelPlugins: trueonly to select the real channel runtime entry;activate: falsekeeps registration in nonactivatingdiscoverymode. Existing CLI and middleware loaders already use this exact option pair.registerCapabilities(api)callback to both existing channel-entry helpers. It runs exactly once indiscovery,full, andtool-discovery, after the existing full callback where applicable, and never in CLI-metadata or either setup mode.Public Plugin SDK: one documented, optional additive callback on two existing helpers; no new subpaths, aliases, removed signatures, or compatibility breaks. Exactly three generated API manifest records change:
channel-core,channel-entry-contract, andcore. No config/default, dependency, storage, SQLite schema, or protocol changes.User Impact
Discord voice transcripts remain discoverable from a genuine cold start without activating Discord activities or hooks. Other bundled capabilities, including Codex, retain canonical trust checks, scoped registration, artifact ownership, and fail-closed configuration mutation.
Handwritten LOC compared with current main:
+155 / -561, net -406.+239 / -84, net+155.+34 / -26, net+8.+428 / -671, net -243.Exact-Head Verification
Tested head:
eef23d95a2fb9a41de1f73feb5ee28af052cff35.Blacksmith Testbox:
tbx_01kyywbpsntt374abna6qzzt7e(coral-crab-7d6f), fresh lease bound to the rebased exact head.pnpm build: passed, including all 148 public SDK subpaths, bundled Discord/Codex artifacts, CLI bootstrap guards, and Control UI packaging.pnpm plugin-sdk:api:check: passed; all unrelated current-main API manifest records preserved.pnpm plugin-sdk:surface:check: passed; no extra public entrypoints.pnpm check:changed: passed every selected core/core-test/extension/extension-test typecheck, lint (zero warnings), zero dead exports, zero import cycles, max-lines, formatting, dependency, SDK, state-schema, database-first, webhook, and pairing guards.gpt-5.6-solautoreview atxhigh, explicitly including P0/P1/P2: no accepted/actionable findings.{"status":"loaded","declared":["discord-voice"],"actual":["discord-voice"],"hooks":0,"diagnostics":[],"activePreserved":true,"snapshotPreserved":true,"livePreserved":true,"registrationContextPreserved":true}The focused tests also prove discovery does not run full-only providers or replace the active registry; source-first and built-first loads remain isolated per registry after the latest ownership refactor; pinned registries, direct registration context, provider rollback, middleware, embedding, compaction, and hook live views retain their current-main behavior.
Direct Upstream Codex Contract Inspection
Personally inspected sibling
../codexat07490c75234ed3c63291a8eb7629f04f647038fabefore changing or approving Codex-adjacent behavior:../codex/codex-rs/app-server-protocol/src/protocol/common.rs:481defines distinctinitialize,thread/start, andthread/resumeRPCs.../codex/codex-rs/app-server-protocol/src/protocol/common.rs:2343verifies initialization capability serialization.../codex/codex-rs/app-server/src/message_processor.rs:761handles initialization explicitly and rejects all other requests before initialization.extensions/codex/harness.ts:178defers app-server runtime imports untilrunAttempt; canonical capability registration does not start an app server, initialize a session, or spawn a thread.AI-assisted: yes. I understand and verified the loader ownership, nonactivation/security boundary, additive SDK contract, real Discord behavior, registry lifecycle, and upstream Codex dependency contract.
ClawSweeper Rank-Up Dispositions (exact head)
registerCapabilities(api)callback on the two existing channel-entry helpers and the three necessary SDK API hashes. There are no new SDK subpaths, removed signatures, aliases, or breaking changes.successoneef23d95a2fb9a41de1f73feb5ee28af052cff35, with 58 successful jobs and zero failures. The official exact-head watcher filtered superseded historical check contexts and returnedGREEN.../codexat07490c75234ed3c63291a8eb7629f04f647038fa, includingcodex-rs/app-server-protocol/src/protocol/common.rs:481,codex-rs/app-server-protocol/src/protocol/common.rs:2343, andcodex-rs/app-server/src/message_processor.rs:761; an independent reviewer corroborated the initialized-first contract. The automated review worker lacked its own sibling checkout/DNS, but the required human/acting-agent source proof is present above.ClawSweeper reported zero code findings and zero security findings. Its generic stored-data heuristic does not represent a storage change: the touched cache is process-local registry state, and this PR introduces no SQLite schema, persisted-data format, or migration changes.