Repository navigation
fix(plugins): read plugin policy through the canonical enable owner - #205673
SunnyShu0925 wants to merge 2 commits into
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: passed. What this changesThis PR routes Doctor, browser inventory notices, and OpenShell workspace admission through the existing normalized plugin-enablement owner. Example: Configure plugins.allow as [] and plugins.entries.codex.enabled as true, with two personal Codex skills present.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs three current plugin-policy inconsistencies with no actionable correctness findings; required CI has not completed successfully. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin configuration enters the shared normalization and activation owner, whose decisions govern diagnostic output and OpenShell workspace configuration admission. flowchart TD
A[Plugin configuration] --> B[Canonical normalization]
B --> C[Canonical activation policy]
C --> D[Doctor asset reminder]
C --> E[Browser inventory notice]
C --> F[OpenShell workspace admission]
Technical reviewBest possible solution: Retain the focused caller changes so the existing activation owner consistently governs diagnostics and workspace admission. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the empty-allowlist skip, incomplete browser diagnosis, and raw OpenShell deny comparison; supplied before-and-after CLI evidence corroborates those paths, without reviewer execution. Is this the best way to solve the issue? Reusing normalization and activation APIs is the smallest complete repair because it removes competing policy decisions while preserving existing owners and configuration contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d6d318d2514. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +16, Tests -1. Total +15 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 26, 2026, 12:35 AM ET / 05:35 UTC (Revision 2). |
Three call sites decided plugin enablement by hand instead of asking the existing policy owner, so they disagreed with what actually loads: - OpenShell workspace binding compared raw allow/deny/entry ids, so a policy entry like " File-Transfer " never blocked the binding. - The doctor Codex asset scan treated any allow array as authoritative, so an empty allowlist skipped the entries check and skipped the scan. - The /tools inventory notice blamed plugins.allow for every missing browser, even when the plugin was disabled elsewhere, and stayed silent for a deny. Each now calls normalizePluginsConfig + resolveEffectiveEnableState, and the notice names the actual reason the plugin is off.
8ec28dc to
eb5e466
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @obviyus. #205672 was fixed on main by #207215 (d1888b8) and #207238 (9bbd5f5), which cover all three call sites this PR touched — the doctor Codex asset reminder, the /tools browser notice, and the OpenShell File Transfer gate now all go through the activation resolver. Closing this PR as superseded to avoid duplicate/conflicting changes. |
Closes #205672
What Problem This Solves
Running
openclaw doctorwithplugins.allow: []and an enabled Codex entry silently drops the personal Codex asset reminder, the/toolsinventory notice tells operators to addbrowsertoplugins.alloweven when the browser plugin was disabled somewhere else entirely, and the OpenShell workspace binding ignores a padded denylist entry and enables File Transfer against the operator's policy.allowarray as authoritative and never consultedentries, so an empty allowlist (which restricts nothing, as established in fix(diffs): honor empty plugin allowlists for language packs #191708) turned the scan off. The/toolsnotice blamedplugins.allowfor every missing browser and produced no notice at all when the plugin was denylisted. The OpenShell workspace binding compared raw ids inallow/deny/entries, so" File-Transfer "never matched the denylist and the binding enabled File Transfer anyway.normalizePluginsConfigand asksresolveEffectiveEnableStatefor the decision, which returns bothenabledand the reason (plugins disabled/blocked by denylist/disabled in config/not in allowlist). The notice now names that reason and only suggests editingplugins.allowwhen the allowlist is actually the cause.extensions/openshell/src/worker-workspace.ts,src/commands/doctor/shared/codex-native-assets.tsandsrc/agents/tools-effective-inventory.tsreplace their hand-rolled checks with the shared owner; the new scenarios are folded into three existing test cases (net test line delta -1).resolveEffectiveEnableState; no new option, schema, or config surface was added, and the two notices keep their existing ids and severities.Why This Change Was Made
normalizePluginsConfig+resolveEffectiveEnableState) rather than teaching each site the policy rules again. The owner already encodes the order deny -> entry -> allowlist and the empty-allowlist rule, and the repo already uses it this way fromextensions/browser/src/plugin-enabled.tsandextensions/codex/index.ts, so this removes duplicated policy instead of adding a fourth variant.allow.length > 0guard, add a deny check, normalize the ids inline) was rejected because it leaves three copies of the same policy that can drift again; writing a new shared helper for these three callers was rejected because the owner already exists.enabledByDefault) as well as the config, so a Codex config block or an explicit allowlist entry counts as opt-in even with an empty allowlist. That matches what the Codex plugin itself gates on, and the widest supported case (nopluginssection at all) still skips the scan, as before. The notice's accessory sentence changed for non-allowlist causes, so any doc that quoted the old sentence needs a look.User Impact
Operators who keep an empty
plugins.allownow still see the personal Codex asset reminder, and when the browser tool is missing the reason reported matches the reason the plugin is actually off. Following that advice no longer means widening plugin policy for a plugin that was disabled on purpose. An operator who denylisted File Transfer (even with padded whitespace in the id) no longer gets it silently re-enabled by an OpenShell workspace binding.Evidence
Every cell below states its full
pluginsinput. Doctor cells share oneHOMEfixture containing two personal skills (.codex/skills/tweet-helper/SKILL.mdand.agents/skills/agent-helper/SKILL.md); the count isgrep -c 'Personal Codex CLI assets found'ondoctor --non-interactiveoutput. Everytools.effectivecell also hasbrowser: { enabled: true }in the config; the notice column quotes thebrowser-plugin-not-allowedmessage.pluginsinput1342a4e)eb5e466){"allow":[],"entries":{"codex":{"enabled":true}}}2 skills{"entries":{"codex":{"enabled":true}}}2 skills2 skills{"allow":[" CODEX "]}2 skills2 skills{"allow":[],"deny":[" Codex "]}{"allow":["slack"]}{"allow":[],"entries":{"browser":{"enabled":false}}}plugins.allow does not include browserdisabled in config{"enabled":false,"allow":[]}plugins.allow does not include browserplugins disabled{"deny":["browser"]}blocked by denylist{"entries":{"browser":{"enabled":true}}}{"allow":[]}{"allow":["slack"],"entries":{"browser":{"enabled":true}}}1342a4e)eb5e466)plugins.deny: [" File-Transfer "]+ agent workspace binding{"allow":[],"entries":{"codex":{"enabled":true}}}doctor --fixthendoctor: 1 line,2 skills;pluginssubtree preservedBoth arms were built with
node --import ./scripts/tsx.mjs scripts/build-all.mts cliStartupand driven by the shipped launcher, each case in an isolatedOPENCLAW_STATE_DIRandHOME. The base arm is frozen at1342a4e, an ancestor of this PR's basedd89642; the three touched production files are byte-identical between those two commits (git diffempty), so the base arm exercises exactly the base behavior of every changed line.Doctor scan, real
openclaw doctorBoth arms report their own commit, so the cells cannot be confused:
Counts across the six doctor configs are the first six rows of the table above: base
0 1 1 0 0 0, head1 1 1 0 0 0; only the empty-allow-plus-entry cell changed./toolsinventory, real Gateway + real RPCA real Gateway (
node openclaw.mjs gateway --port <port> --auth token ...) served the cells, the session came fromsessions.create, and each cell is a fullgateway call. Five cells ran as config hot-reloads on one Gateway per arm; theplugins disabledcell ran as a cold Gateway start on both arms (its base notice only fires whenallowis an array, which is why its input includesallow: []).OpenShell binding, real shipped
openshell worker configureConfig:
plugins.deny: [" File-Transfer "]plus an agent workspace binding (agentId: main,remoteRoot: /sandbox/agent-main) and the worker profile/model settings the command requires. The OpenShell sandbox peer is a synthetic executable that answers only the node-identity and workspace-check sandbox calls; every OpenClaw step — config snapshot, plugin policy decision, binding composition, config mutation — runs from the shipped bundle. No real OpenShell device is available locally.Upgrade path, latest stable -> head on the same state
One state dir, config
plugins: {"allow":[],"entries":{"codex":{"enabled":true}}}, the same two-skillHOMEfixture throughout:Built bundle form
The bundles the two arms actually executed:
Focused tests
The new scenarios are folded into the existing cases, so the test line delta is -1 (
+19 / -20):Red on base: with only the three production files reverted to base and the tests kept, exactly the four new scenarios fail:
What was not tested
The OpenShell binding has no real sandbox device here; the shipped run above uses a synthetic sandbox peer (disclosed in that section), backed by the red-on-base
worker-clitest. Local verification ran the targeted vitest lanes and the shipped builds; the repository-wide typecheck runs in CI.Open PR collision check
Searched open PRs by file name and by changed-file list:
#199068(roboclaw-bot) and#194876(saariuslystoned) both touchsrc/agents/tools-effective-inventory.ts, but only around the gateway/metadata scope in the middle of the file and around the notices assembly at the end; this change is confined tobuildToolInventoryNotices, which neither edits. No open PR touches the other two files. Rechecked on 2026-11-26 against the current open-PR snapshot:#205688,#205657and#205659share no file with this change.