Skip to content

fix(plugins): resolve mixed-case plugin IDs through canonical identity - #164683

Merged
steipete merged 8 commits into
mainfrom
fix/w5-plugins
Oct 4, 2026
Merged

steipete merged 8 commits into
mainfrom
fix/w5-plugins

Conversation

@steipete

@steipete steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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 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:

  • 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.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes size: L labels Oct 4, 2026
@steipete
steipete marked this pull request as ready for review October 4, 2026 01:45
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 1:55 AM ET / 05:55 UTC (Revision 5).

ClawSweeper review

What this changes

The 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
Reviewed head: 46afadf1c80271a689ccd9c364e0842a5c7c1065

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent repair with meaningful boundary regressions and reported remote validation; no concrete blocking defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: Ordinary contributor proof is exempt under the supplied MEMBER classification. Recorded CLI toggle and uninstall outcomes are supplemental; source and compatibility regressions preserve existing settings, exact install ownership, and canonical policy storage without a new data format.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Ordinary contributor proof is exempt under the supplied MEMBER classification. Recorded CLI toggle and uninstall outcomes are supplemental; source and compatibility regressions preserve existing settings, exact install ownership, and canonical policy storage without a new data format.
Evidence reviewed 9 items Pinned introduction and repository identity: The origin identifies openclaw/openclaw. The reviewed delta is dac9277..46afadf; the original head records b1d6202 as its parent.
Current main still needs the repair: Main lowercases the CLI selection before matching exact installed IDs, and its LLM policy lookup indexes lowercase-normalized entries with the raw runtime ID. These mechanisms establish the mixed-case defect from source; no merged fixing PR or shipped replacement was established.
One metadata identity owner: The new manifest normalizer extracts the existing registry resolver rather than creating competing resolution rules. Startup consumers convert canonical policy keys back to declared IDs when constructing runtime scopes.
Findings None None.
Security None None.

How this fits together

Plugin 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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +40, Tests +312, Docs +11, Other +1. Total +364 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 17 154 114 +40
Tests 9 386 74 +312
Docs 3 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 30 552 188 +364

Review metrics

Metric Value Why it matters
Production and regression growth production net +40 lines; tests net +312 lines Production growth is justified by shared identity resolution and consumer repairs; tests protect distinct lifecycle boundaries.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs bounded plugin lifecycle failures affecting mixed-case manifest IDs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Ordinary contributor proof is exempt under the supplied MEMBER classification. Recorded CLI toggle and uninstall outcomes are supplemental; source and compatibility regressions preserve existing settings, exact install ownership, and canonical policy storage without a new data format.

Evidence

What I checked:

  • Pinned introduction and repository identity: The origin identifies openclaw/openclaw. The reviewed delta is dac9277..46afadf; the original head records b1d6202 as its parent. (46afadf1c802)
  • Current main still needs the repair: Main lowercases the CLI selection before matching exact installed IDs, and its LLM policy lookup indexes lowercase-normalized entries with the raw runtime ID. These mechanisms establish the mixed-case defect from source; no merged fixing PR or shipped replacement was established. (src/plugins/management-mutations.ts:324, dac9277a4126)
  • One metadata identity owner: The new manifest normalizer extracts the existing registry resolver rather than creating competing resolution rules. Startup consumers convert canonical policy keys back to declared IDs when constructing runtime scopes. (src/plugins/plugin-manifest-id-normalizer.ts:20, 46afadf1c802)
  • Existing-state compatibility: Uninstall reuses existing canonical config writers. The focused regression preserves merged settings during staged disablement, retains the exact install owner, preserves unrelated entries, and leaves one canonical disabled marker after uninstall. Validation cases retain authored settings ownership when applying defaults. (src/plugins/uninstall-policy.test.ts:26, 46afadf1c802)
  • Authority and rejection paths: Case-folded manifest collisions are already rejected before registry publication. The patch preserves trusted caller attribution, lifecycle ownership assertions, operator authority checks, and model-policy intersections; mixed-case completion restrictions reject before model acquisition. Gateway regression coverage also checks disabled and denied plugins remain unavailable. (src/plugins/runtime/runtime-llm.runtime.ts:332, 46afadf1c802)
  • Recorded validation and proof scope: The captured body reports 540 tests, production and test typechecks, formatting, and lint on Testbox; commit messages record real offline toggle and uninstall outcomes. These are contributor-reported observations, not reviewer-executed results. Repository State identifies the author as MEMBER, while a live REST read reports CONTRIBUTOR; the supplied trusted-author classification is retained for ordinary proof treatment. (46afadf1c802)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • stevenlee-oai: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-04T01:50:37.767Z sha a4099cf7a177b7e02ade43b8055c1b6dc0baf9d7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T02:46:08.251Z sha bfdd6d6bb5804b50f201649e01635cfb35c9f31b :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T03:08:47.663Z sha 4041b6bfd7348c92c827c89a0ede591a20589c34 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T04:22:49.894Z sha 3dc0d1ef06e24cfae7159d486a906f351b7faad4 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the fix/w5-plugins branch 2 times, most recently from bfdd6d6 to 4041b6b Compare October 4, 2026 03:01
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 4, 2026
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.
@steipete
steipete merged commit 4cdbab7 into main Oct 4, 2026
137 of 140 checks passed
@steipete
steipete deleted the fix/w5-plugins branch October 4, 2026 06:20
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Landed on the exact reviewed head 46afadf1c80271a689ccd9c364e0842a5c7c1065 despite one red check, because the failure was already on main.

check-test-types-core-2 failed only with ui/src/components/mcp-app-bridge.cursor.test.ts(13,57): error TS2559, a fixture type mismatch between two MCP App PRs that landed on main (#164368 and #164277). This PR touches no MCP or UI files. Main has already fixed it in #164795 (42b9aee33a7, "update MCP cursor fixture capabilities"). Every other check on this head passed, including the plugin lane and the eager-import closure test. Codex autoreview reported no actionable findings. The rebase onto #164617 kept main's short-circuit activation chain and applied canonical policy IDs to its allowlist and hook-entry lookups; the related tests passed 806 across 47 files.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant