Repository navigation
fix(openclaw): migrate plugins.allow/deny/installs too, not just entries (#305 follow-up) - #308
Conversation
…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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe plugin ID migration now centralizes ChangesPlugin ID migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to 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: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
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 migrateplugins.allow— and per OpenClaw's own documentation: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
allowclawrouterin that list may now also be permitting OpenClaw's bundled plugin; silently revoking that is not ours to decidedenyclawrouterexistedinstallsAlso collapsed the id into one exported
BLOCKRUN_PLUGIN_IDso 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
allowbranch 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.jsonlocally instead of the repo'snpm run typecheck(plaintsc --noEmit, which covers*.test.ts). Everything here was verified with the repo's own scripts.Summary by CodeRabbit