Skip to content

fix(openclaw): migrate plugins.allow/deny/installs too, not just entries (#305 follow-up) - #308

Merged
VickyXAI merged 1 commit into
mainfrom
fix/plugin-id-migration-allowlist
Sep 2, 2026
Merged

VickyXAI merged 1 commit into
mainfrom
fix/plugin-id-migration-allowlist

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Self-review catch on #307, found before it reached npm.

The bug I shipped

#307 renamed the plugin id and migrated plugins.entries. It did not migrate plugins.allow — and per OpenClaw's own documentation:

If plugins.allow is set, the installed plugin id must be in that list before the plugin can load.
plugins.allow is an exclusive allowlist.

So any user who had allow-listed us under the old id would, after the rename, have this plugin blocked from loading outright. That is strictly worse than the collision the rename was fixing: shadowed-by-bundled becomes cannot-load-at-all.

The tell was in our own uninstall code, which already knew all three keys carry the plugin id (entries, installs, allow) while the migration only handled one.

Fix

key action why
allow add the new id clawrouter in that list may now also be permitting OpenClaw's bundled plugin; silently revoking that is not ours to decide
deny add the new id an explicit deny of the old id was a decision to keep this plugin off, made when no other clawrouter existed
installs rename the key install provenance is unambiguously ours

Also collapsed the id into one exported BLOCKRUN_PLUGIN_ID so the manifest, the plugin definition, the uninstall cleanup and the migration cannot drift apart. Added a check that the manifest and the constant agree.

Verification

5 new tests, 9 in the file. Verified red before the fix — disabling the allow branch fails 2 of them.

839 tests pass. npm run typecheck, npm run lint, prettier --check . all clean, dist rebuilt and smoke-checked.

Note on process: #307's first CI failure was a typecheck error I missed because I ran tsc -p tsconfig.json locally instead of the repo's npm run typecheck (plain tsc --noEmit, which covers *.test.ts). Everything here was verified with the repo's own scripts.

Summary by CodeRabbit

  • Bug Fixes
    • Improved migration of legacy plugin configuration to the current plugin identifier.
    • Updated plugin allowlists, denylists, installation settings, and entries consistently during migration.
    • Ensured cleanup removes the correct plugin identifier while preserving unrelated configuration.

…ies (#305)

Self-review catch on #307, before it reached npm.

plugins.allow is an EXCLUSIVE allowlist. OpenClaw's own docs: "if
plugins.allow is set, the installed plugin id must be in that list before
the plugin can load". #307 migrated only plugins.entries, so a user who
had allow-listed us under the old id would have had this plugin BLOCKED
OUTRIGHT after the rename — strictly worse than the collision the rename
set out to fix.

- allow: ADD the new id rather than replace the old one. `clawrouter` in
  that list may now also be permitting OpenClaw's bundled plugin, and
  silently revoking that is not ours to decide.
- deny: mirror it. An explicit deny of the old id was a decision to keep
  THIS plugin off, made when no other clawrouter existed. Honour it.
- installs: rename outright — install provenance is unambiguously ours.

Also collapsed the id into one exported BLOCKRUN_PLUGIN_ID constant so the
manifest, the plugin definition, the uninstall cleanup and the migration
cannot drift apart.

5 new tests (9 total). Verified red before the fix: disabling the allow
branch fails 2 of them. 839 pass, typecheck/lint/prettier clean, dist
rebuilt and smoke-checked.
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 12fcc64e-10a4-4c27-9c5d-f70028ec5599

📥 Commits

Reviewing files that changed from the base of the PR and between 0b1c755 and 528c86c.

⛔ Files ignored due to path filters (5)
  • dist/cli.js is excluded by !**/dist/**
  • dist/cli.js.map is excluded by !**/dist/**, !**/*.map
  • dist/index.d.ts is excluded by !**/dist/**
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (2)
  • src/index.plugin-id-migration.test.ts
  • src/index.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The plugin ID migration now centralizes blockrun-clawrouter in an exported constant, migrates additional plugin configuration fields, updates deactivation cleanup, and adds tests for allowlists, denylists, and installs.

Changes

Plugin ID migration

Layer / File(s) Summary
Canonical plugin ID and cleanup references
src/index.ts
Defines BLOCKRUN_PLUGIN_ID and uses it in the plugin definition and deactivation cleanup logic.
Configuration migration coverage
src/index.ts, src/index.plugin-id-migration.test.ts
Migrates clawrouter across plugin entries, allowlists, denylists, and installs. Tests cover renamed keys, appended IDs, preserved legacy IDs, and unchanged unrelated allowlists.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 528c8

The PR preserves plugin settings across the ID rename, but automatic allowlist repair may occur too late to unblock some installations, and a shared legacy ID could broaden authorization when adding the new ID. The change is mergeable with explicit owner awareness or follow-up on migration ordering and install provenance.

Suggested reviewers: 0xcheetah1, 1bcmax

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: migrating plugins.allow, plugins.deny, and plugins.installs in addition to plugins.entries.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/plugin-id-migration-allowlist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VickyXAI
VickyXAI merged commit 583f94e into main Sep 2, 2026
4 checks passed
@VickyXAI
VickyXAI deleted the fix/plugin-id-migration-allowlist branch September 2, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant