Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe PR makes plugin install persistence use canonical lowercase policy keys for settings, disablement, and denylist handling. Example: Reinstall MyPlug with plugins.entries.myplug containing enabled: true and config.token: abc.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it fixes a source-confirmed plugin reinstall bug with a focused change and no actionable findings; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin installation combines discovered manifests with existing operator policy, then commits plugin records and configuration for inventory and runtime activation. flowchart TD
A[Plugin install request] --> B[Manifest discovery]
B --> C[Install persistence]
D[Existing plugin policy] --> E[Canonical policy helpers]
E --> C
C --> F[Config and install record commit]
F --> G[Inventory and runtime activation]
Technical reviewBest possible solution: Use the existing canonical policy helpers throughout install persistence while preserving settings, explicit disablement, and setup-required staging. Do we have a high-confidence way to reproduce the issue? Main's raw-ID reads establish the failure path, and the contributor supplies matching before/after shipped-CLI output; no target code was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete repair: canonicalize existing policy reads and reuse the toggle owner rather than introducing fallback lookups or another identity mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 34f6f1ba01ce. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +5, Tests +32. Total +37 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 4:59 PM ET / 20:59 UTC (Revision 2). |
…ttings use the lowercase policy key Reinstalling a plugin whose manifest id is mixed case (for example MyPlug) ignored settings stored under the documented lowercase policy key (plugins.entries.myplug), reported that the plugin requires configuration first, and wrote a second MyPlug entry with enabled false that disabled it. Install persistence looked up plugins.entries, the explicit disable flag and plugins.deny by the raw manifest id. Resolve them through the normalized plugin id the loader and enable/disable already use, and stage disabled installs under the canonical lowercase key.
05e3336 to
b0531df
Compare
|
Rebased onto main 34f6f1b; head is now b0531df (no code change beyond the rebase). Both Before-merge items addressed in the PR body:
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Closing in favor of tracking this as an issue: #180071 |
Summary
Reinstalling a plugin whose manifest id is mixed case (for example
MyPlug) ignores settings stored under the documented lowercase policy keyplugins.entries.myplug.openclaw plugins installreports that the plugin "requires configuration first", writes a secondplugins.entries.MyPlugentry withenabled: false, and the loader (which resolves the lowercase key) then sees the plugin as disabled. A plugin that was enabled and configured ends up disabled after a reinstall or update.Root cause
#164683 moved the loader, validation and enable/disable paths to the normalized (lowercase) plugin id, but install persistence still reads policy by the raw manifest id.
src/plugins/plugin-config-enablement.ts, before:src/plugins/install-persistence.ts, before:src/plugins/enable.tsprepareConfigForDisabledInstall, before:With manifest id
MyPlugand settings undermyplug, the required-config check sees no config, so the install is staged disabled under a newMyPlugkey, and the deny/explicit-disable lookups also miss the canonical entry.Fix
Resolve every install-persistence policy lookup through the same normalized id the loader uses.
after:
prepareConfigForDisabledInstallnow goes throughsetPluginEnabledInConfig, the same helperopenclaw plugins disableuses, so a staged disabled install lands on the canonical lowercase key and keeps its existing policy (minusconfig).Why this is the right boundary
Install persistence is the only remaining reader of
plugins.entriesthat keys by the raw manifest id; the loader, config validation, and enable/disable already normalize. Fixing it here aligns install with the canonical identity rather than adding a second lookup. Lowercase ids are unaffected becausenormalizePluginIdis the identity for them, and all existing install-persistence cases keep their behavior.Verification
src/plugins/install-persistence.test.ts: a mixed-case id with settings under the lowercase key is enabled without a "requires configuration" warning and without a duplicate entry, and a mixed-case id with missing settings is staged disabled under the lowercase key with its deny entry cleared. Both fail on pristine main and pass with this patch.Upgrade and existing-data compatibility
The review asked for an upgrade from the current stable release with an existing mixed-case plugin, settings, and an explicit disabled preference. The proof below seeds state with the published
[email protected]npm package only (install,config set,plugins enable,plugins disable), then points the built CLI from this branch at that same state directory with no edits in between.normalizePluginId, the same normalizer the loader andplugins enable/disablealready use since fix(plugins): resolve mixed-case plugin IDs through canonical identity #164683), so a config written by 2026.10.5 loads unchanged;plugins liston this branch reads it before any write.enabled: falseboth survive a reinstall on this branch, and no extra key is written.MyPlug: {enabled:false}next to the configuredmyplugentry) still loads on this branch with every setting intact. This branch deliberately does not auto-delete that raw-caseenabled:falsekey on reinstall, because it is indistinguishable from an operator-authored disable; the existingopenclaw plugins enable MyPlugcollapses the alias and the plugin then stays enabled across reinstalls (shown below). If maintainers prefer an automatic repair, that is a policy call I would rather take as a follow-up than fold into this fix.Real behavior proof
Behavior addressed: Reinstalling or updating a plugin whose manifest id is mixed case (
MyPlug) ignored its settings stored under the canonical lowercase key, staged it disabled, and wrote a duplicate raw-case{enabled:false}entry. The review asked specifically for an upgrade from 2026.10.5 with existing settings and an explicit disabled preference.Real environment tested: macOS, Node 26.9.0. BEFORE: the published
[email protected]npm package (OpenClaw 2026.10.5 (1b58cb9)). AFTER: this PR head b0531df rebased on origin/main 34f6f1b, built to dist and run through the shippednode openclaw.mjsentry point (OpenClaw 2026.10.5 (b0531df)). IsolatedOPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH; two real local plugin directories with manifest idsMyPlugandOtherPlug, each with a configSchema requiringtoken. Placeholder tokens only, no credentials or endpoints.Exact steps or command run after this patch: (1) With 2026.10.5 only:
plugins install --force --accept-capabilities $TMP/src/myplug,config set plugins.entries.myplug.config.token abc,plugins enable MyPlug; same forOtherPlugwith tokenxyz, thenplugins disable OtherPlug. Archive that state dir. (2) BEFORE: restore it, reinstall both plugins with 2026.10.5. (3) AFTER (upgrade): restore the same archived 2026.10.5 state, runplugins list, reinstall both plugins with this branch, printplugins.entries, runplugins list. (4) Existing-damaged-data: restore the state left by step (2), run the same commands on this branch, thenplugins enable MyPlugand one more reinstall.Evidence after fix:
Observed result after fix: Upgrading a 2026.10.5 state to this branch and reinstalling keeps
MyPlugenabled withtoken: abcand keeps the operator-disabledOtherPlugdisabled withtoken: xyz; no "requires configuration first" message and no duplicate raw-case entry is written. The same reinstall on 2026.10.5 disables both and writesMyPlug/OtherPlug{enabled:false}duplicates. State already damaged by 2026.10.5 loads on this branch with all settings intact, is not damaged further by reinstall, andplugins enable MyPlugrestores it so it stays enabled across the next reinstall.What was not tested: npm or ClawHub registry installs (same persistence path, different fetch source); a running Gateway picking up the plugins after restart.