Repository navigation
fix(plugins): resolve mixed-case plugin IDs through canonical identity - #164683
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. Reviewed October 4, 2026, 1:55 AM ET / 05:55 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR makes plugin toggles, uninstall, startup, settings validation, LLM policy, and memory selection use canonical policy keys while preserving declared runtime and package IDs. Merge readiness✅ Ready for maintainer review This PR remains useful: pinned current main still contains the mismatched identity lookups. The reviewed patch has no concrete blocking correctness or security finding. Priority: P2 Review scores
Verification
How this fits togetherPlugin management combines installed manifest metadata with operator configuration to determine which plugins activate and which settings apply. Canonical policy keys govern eligibility, while declared IDs identify runtime registrations and installed packages. flowchart TD
A[Plugin manifests] --> C[Identity resolver]
B[Operator configuration] --> C
C --> D[Canonical policy keys]
D --> E[Activation and settings checks]
C --> F[Declared runtime and package IDs]
E --> G[Plugin operations]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +40, Tests +312, Docs +11, Other +1. Total +364 across 30 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use one canonical policy identity throughout the plugin lifecycle while retaining declared runtime IDs, authored settings, and exact package ownership. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure: main compares a lowercase CLI selection with an exact mixed-case installed ID and uses raw runtime IDs to index canonical policy entries. This review did not execute the failure. Is this the best way to solve the issue? Yes, reusing the existing metadata resolver and config writers is a focused repair that preserves runtime identity and policy precedence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dac9277a4126. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
bfdd6d6 to
4041b6b
Compare
4041b6b to
3dc0d1e
Compare
Use the prepared registry resolver for installed identity while keeping config writes and policy refreshes on canonical keys. This repairs mixed-case IDs after f94a7dc made config policy normalization lowercase. Regression: the real CLI installed MiXeD-demo but both enable and disable exited 1 with Plugin not found. The CLI-boundary regression fails before this repair and passes afterward; all 15 policy tests and remote formatting passed on Blacksmith Testbox. Real offline enable and disable now succeed without losing plugin settings.
…owners Reuse the existing policy writers for staged disable and cleanup. Mixed-case manifest IDs now leave a single canonical disabled marker instead of an enabled entry plus a differently cased marker. Keep install owner IDs exact and preserve unrelated settings. Regression: real CLI uninstall left mixed-demo enabled before the fix; afterward the managed directory is gone and only mixed-demo enabled:false remains. The regression failed on both staged and final config before repair. All 78 original uninstall cases passed remotely; the focused two-case policy sibling preserves coverage without growing the oversized test file. Blacksmith formatting passed. The normalization mismatch dates to f94a7dc.
Keep manifest and runtime identities intact while canonicalizing resolved allow, deny, and entry keys at the shared policy producer. Carry runtime scope IDs through the metadata resolver and use policy keys in startup consumers. Remote AWS proof: dispatcher regression failed with unknown method before the fix; passes live enablement, cold bootstrap, disablement and deny policy after. Focused file wall time: 13.565s. Local hooks disabled to honor the remote-only execution boundary; formatting ran remotely.
…tity Reuse the metadata identity resolver without loading runtime. Validate case-normalized settings and retain the authored settings owner for errors and defaults, including overlapping entry spellings. Remote AWS proof: eight regressions failed before and pass after, including rejecting 42 for a string field, avoiding false missing-plugin warnings, and preserving default ownership. Focused file wall time: 10.555s. Formatting ran remotely.
Project manifest-backed runtime owners through the shared metadata policy-key normalizer without rewriting caller attribution or introducing runtime discovery. Cover both configured model grants and completion restrictions with mixed-case runtime owners.
Use the shared policy identity key when checking deny and disabled entries, while preserving the declared memory owner for runtime loading. Regress both mixed-case deny and explicit-disable paths before registry acquisition.
Repair the reproduced TS2352 Gateway context assertion with the typed context factory and supply the manifest fixture cliBackends required by TS2322. Both graphs and the four identity regression suites pass on Blacksmith.
3dc0d1e to
46afadf
Compare
|
Landed on the exact reviewed head
|
openclaw#164683) ## What Problem This Solves Plugins whose manifest ID contains uppercase letters (for example `MiXeD-demo`) behaved inconsistently across the plugin lifecycle, because some code paths looked them up by their case-preserved manifest ID in maps keyed by the canonical lowercase policy ID: - Offline `openclaw plugins disable/enable` failed with "Plugin not found". - Uninstall succeeded but left a conflicting enabled policy entry behind. - Enabling the plugin reported success, but its runtime methods were never registered ("unknown method"), both on live enable and on cold start. - Invalid plugin settings (for example a number in a string field) validated as `valid: true`. - Per-plugin LLM overrides/allowlists and memory-slot enablement settings were not applied to such plugins. ## Why This Change Was Made Since `9526913a671`, plugin policy entries are keyed by a canonical lowercase identity while manifests keep their original casing; several consumers kept indexing with the raw manifest ID. This change routes every one of those lookups through the existing canonical metadata identity resolver (one shared policy-key helper), while preserving the exact case-sensitive runtime and package IDs: - offline toggles (`src/plugins/management-mutations.ts`) - uninstall policy cleanup (`src/plugins/uninstall-package-config.ts`, `uninstall-package-plan.ts`) - Gateway startup/activation policy (`src/plugins/config-normalization-shared.ts` and consumers) - settings validation (`src/config/validation-plugin-config.ts`) - LLM policy lookup (`src/plugins/runtime/runtime-llm.runtime.ts`) - memory slot policy (`src/plugins/memory-runtime.ts`) ## User Impact Plugins with mixed-case IDs now toggle, uninstall, activate, validate, and receive their configured LLM and memory settings exactly like lowercase-ID plugins. ## Evidence - Each site has a regression with a mixed-case plugin ID that fails before and passes after (toggles, uninstall, live and cold-start activation including disabled/denied plugins staying unavailable, eight validation cases, LLM overrides/allowlists, memory slot enablement). - Final head: 540 tests across 27 related files, core typecheck, all 27 test TypeScript graphs, formatting, and oxlint pass on Blacksmith Testbox; earlier: full build, 503 unit, 124 Gateway, and 46 browser E2E tests, plus live CLI install/update/uninstall flows across copy/link/archive/git/npm/bundled sources. - Full `check-changed` was cancelled by the Testbox provider during its last phase; exact-head CI is the final gate. - Production +165/-114 LOC (mostly moving lookups onto the shared resolver); tests +386/-74. Not changed here: a concurrent enable/disable pair can surface only a generic "The CLI command failed" message (`src/cli/failure-output.ts`); improving that copy is a separate product change.
What Problem This Solves
Plugins whose manifest ID contains uppercase letters (for example
MiXeD-demo) behaved inconsistently across the plugin lifecycle, because some code paths looked them up by their case-preserved manifest ID in maps keyed by the canonical lowercase policy ID:openclaw plugins disable/enablefailed with "Plugin not found".valid: true.Why This Change Was Made
Since
f94a7dc183c, plugin policy entries are keyed by a canonical lowercase identity while manifests keep their original casing; several consumers kept indexing with the raw manifest ID. This change routes every one of those lookups through the existing canonical metadata identity resolver (one shared policy-key helper), while preserving the exact case-sensitive runtime and package IDs:src/plugins/management-mutations.ts)src/plugins/uninstall-package-config.ts,uninstall-package-plan.ts)src/plugins/config-normalization-shared.tsand consumers)src/config/validation-plugin-config.ts)src/plugins/runtime/runtime-llm.runtime.ts)src/plugins/memory-runtime.ts)User Impact
Plugins with mixed-case IDs now toggle, uninstall, activate, validate, and receive their configured LLM and memory settings exactly like lowercase-ID plugins.
Evidence
check-changedwas cancelled by the Testbox provider during its last phase; exact-head CI is the final gate.Not changed here: a concurrent enable/disable pair can surface only a generic "The CLI command failed" message (
src/cli/failure-output.ts); improving that copy is a separate product change.