Repository navigation
fix(plugins): ask the activation resolver instead of reading plugin policy by hand - #207238
Conversation
…olicy by hand - /tools browser notice and OpenShell File Transfer gate call resolveEffectiveEnableState (#205672). - Doctor's Codex bwrap check reads each resolved sandbox's docker.network.
|
🦞👀 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 replaces handwritten plugin-policy checks with the activation resolver and makes Doctor inspect resolved per-agent sandbox networks. Example: Sandbox defaults specify network "bridge", while agent "work" enables sandboxing with network "none".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses source-confirmed inconsistencies still present on current main, and no definite introduced correctness bug was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin activation and sandbox configuration resolvers own effective settings; tool inventory, OpenShell workspace setup, and Doctor consume those settings to produce notices, configuration candidates, and health checks. flowchart TD
A[Operator configuration] --> B[Plugin activation resolver]
A --> C[Per-agent sandbox resolver]
B --> D[Tool inventory notices]
B --> E[OpenShell workspace setup]
C --> F[Doctor namespace checks]
Technical reviewBest possible solution: Retain the existing activation and sandbox resolvers as decision owners while leaving the broader browser-refusal notice tracked by the linked work. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the empty-allowlist misdiagnosis, raw OpenShell ID comparison, and defaults-only network decision; no target code was executed during this review. Is this the best way to solve the issue? Using the existing resolvers is the smallest complete repair for the PR's stated cases, although suppressing the incorrect browser warning does not provide the broader linked issue's requested refusal explanation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e298b250e1b9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +12, Tests +56. Total +68 across 6 files. Added test files: 1. 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. LabelsLabel 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 Reviewed November 27, 2026, 11:56 PM ET / November 28, 2026, 04:56 UTC. |
…rap probe - Role-required sandboxes count; the hint no longer names one engine for every sandbox.
…st (#207259) ## Problem `security-fast` fails on every PR based on current `main`: ``` Protocol event coverage check failed: - [ios] allowlist entry "session.tool" is now handled; remove it from scripts/protocol-event-coverage.allowlist.json. ``` #206602 (`5b4c5401`) made the iOS chat surface handle `session.tool`, but the allowlist still says iOS does not handle it. On `main`, the push CI does not reach this check, so `main` looks green. PR runs (for example, #207238) fail. ## Solution Remove the iOS `session.tool` allowlist entry. The Android entry stays: Android still does not handle the event. ## Evidence - `node scripts/check-protocol-event-coverage.mts` on `origin/main` `9c9e3c74`: the failure above. - The same check on this branch: `Protocol event coverage OK: 75 gateway events; ios handles 29, allowlists 46; android handles 26, allowlists 49.` - Local ClawSweeper on `b8041413`: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
…st (openclaw#207259) ## Problem `security-fast` fails on every PR based on current `main`: ``` Protocol event coverage check failed: - [ios] allowlist entry "session.tool" is now handled; remove it from scripts/protocol-event-coverage.allowlist.json. ``` openclaw#206602 (`83d7a819`) made the iOS chat surface handle `session.tool`, but the allowlist still says iOS does not handle it. On `main`, the push CI does not reach this check, so `main` looks green. PR runs (for example, openclaw#207238) fail. ## Solution Remove the iOS `session.tool` allowlist entry. The Android entry stays: Android still does not handle the event. ## Evidence - `node scripts/check-protocol-event-coverage.mts` on `origin/main` `704cd214`: the failure above. - The same check on this branch: `Protocol event coverage OK: 75 gateway events; ios handles 29, allowlists 46; android handles 26, allowlists 49.` - Local ClawSweeper on `b8041413`: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
…olicy by hand (openclaw#207238) ## Problem Three places re-derive settings instead of asking the owner the runtime uses (openclaw#205672 cases 2 and 3; openclaw#201988 follow-up). Each one gives a wrong answer when a setting is set only in the per-entry or per-agent config. - **`/tools` browser notice** (`src/agents/tools-effective-inventory.ts`) reads `plugins.allow` by hand. With an empty allowlist and `plugins.entries.browser.enabled: false`, it blames `plugins.allow`, which is not the cause. - **OpenShell File Transfer gate** (`extensions/openshell/src/worker-workspace.ts`) does a hand-made exact-id check. A padded deny entry (`" File-Transfer "`) passes it, so agent workspace binding does not keep the operator's File Transfer restriction. - **Doctor Codex bwrap hint** (`src/commands/doctor-sandbox.ts`) reads only `agents.defaults.sandbox.docker.network`. An agent's own network setting changes how the runtime starts that sandbox, but Doctor ignores it. The result is a wrong network-namespace probe and a wrong hint. ## Solution - The browser notice and the OpenShell gate call `resolveEffectiveEnableState`, the same resolver the plugin loader uses. This is the same fix as openclaw#207215. - The bwrap check reads `docker.network` from every container sandbox that `resolveSandboxConfigForAgent` resolves (already used for the engine since openclaw#207213), including sandboxes a gateway role requires. It probes the network namespace when any of them has no egress. Whether the check runs at all still follows a mode-on sandbox, as before. The hint no longer names one engine for every sandbox. ## Impact - Users with an empty allowlist see a correct `/tools` browser notice; a padded File Transfer deny entry now keeps its restriction. - Users with a per-agent sandbox network get the correct Codex bwrap check on Linux. - No config, schema or wire change. ## Evidence - New tests are red on `main` and green on this branch (inventory blame rows, the OpenShell padded-deny row, and the bwrap resolved-network rows). Controls pass on both. - The plugin-activation diff is the one Fable 5.2 reviewed (no finding). It applies to current `main` without change. - The bwrap change had two Fable 5.2 rounds. Round 1 found three issues: role-required sandboxes were skipped, the test did not prove "any", and the hint named one engine. All three are fixed. Round 2 found no regression. - Accepted edge case (round 2): when a gateway role requires a sandbox, openclaw#207213 counts the defaults entry as a sandbox. Its network (`none` unless set) can start the network-namespace probe when every listed agent has egress. The result is an extra check, not a missed one. A warning appears only on hosts that deny the network namespace. Co-authored-by: Ayaan Zaidi <[email protected]>
…olicy by hand (#207238) ## Problem Three places re-derive settings instead of asking the owner the runtime uses (#205672 cases 2 and 3; #201988 follow-up). Each one gives a wrong answer when a setting is set only in the per-entry or per-agent config. - **`/tools` browser notice** (`src/agents/tools-effective-inventory.ts`) reads `plugins.allow` by hand. With an empty allowlist and `plugins.entries.browser.enabled: false`, it blames `plugins.allow`, which is not the cause. - **OpenShell File Transfer gate** (`extensions/openshell/src/worker-workspace.ts`) does a hand-made exact-id check. A padded deny entry (`" File-Transfer "`) passes it, so agent workspace binding does not keep the operator's File Transfer restriction. - **Doctor Codex bwrap hint** (`src/commands/doctor-sandbox.ts`) reads only `agents.defaults.sandbox.docker.network`. An agent's own network setting changes how the runtime starts that sandbox, but Doctor ignores it. The result is a wrong network-namespace probe and a wrong hint. ## Solution - The browser notice and the OpenShell gate call `resolveEffectiveEnableState`, the same resolver the plugin loader uses. This is the same fix as #207215. - The bwrap check reads `docker.network` from every container sandbox that `resolveSandboxConfigForAgent` resolves (already used for the engine since #207213), including sandboxes a gateway role requires. It probes the network namespace when any of them has no egress. Whether the check runs at all still follows a mode-on sandbox, as before. The hint no longer names one engine for every sandbox. ## Impact - Users with an empty allowlist see a correct `/tools` browser notice; a padded File Transfer deny entry now keeps its restriction. - Users with a per-agent sandbox network get the correct Codex bwrap check on Linux. - No config, schema or wire change. ## Evidence - New tests are red on `main` and green on this branch (inventory blame rows, the OpenShell padded-deny row, and the bwrap resolved-network rows). Controls pass on both. - The plugin-activation diff is the one Fable 5.2 reviewed (no finding). It applies to current `main` without change. - The bwrap change had two Fable 5.2 rounds. Round 1 found three issues: role-required sandboxes were skipped, the test did not prove "any", and the hint named one engine. All three are fixed. Round 2 found no regression. - Accepted edge case (round 2): when a gateway role requires a sandbox, #207213 counts the defaults entry as a sandbox. Its network (`none` unless set) can start the network-namespace probe when every listed agent has egress. The result is an extra check, not a missed one. A warning appears only on hosts that deny the network namespace. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 9bbd5f5) Release adaptation: Ported the effective plugin resolver changes. Adapted Doctor’s network selection to the release sandbox resolver instead of importing the main-only backend inventory. Co-authored-by: RomneyDa <[email protected]>
Release adaptation: restore extensions/openshell/src/worker-workspace.ts and its test to their 2026.12.1-beta.2 bytes, reverting only the OpenShell part of the #207238 backport (a36063b). The rebuilt OpenShell worker chunk changes the whole-file hash that the exact-npm-artifact scanner binds its reviewed dangerous-exec finding to, so @openclaw/openshell-sandbox fails publication qualification (FRV 46311795797, preview_plugin_pack openshell) until a reviewer records the new chunk on main. The /tools browser notice and Doctor bwrap parts of #207238 stay. Behavior returns to beta.2 for padded File Transfer deny entries (exact-id match); no regression versus beta.2. Re-admit in beta.4 once the scanner review is recorded. Co-authored-by: RomneyDa <[email protected]>
…olicy by hand (#207238) Three places re-derive settings instead of asking the owner the runtime uses (#205672 cases 2 and 3; #201988 follow-up). Each one gives a wrong answer when a setting is set only in the per-entry or per-agent config. - **`/tools` browser notice** (`src/agents/tools-effective-inventory.ts`) reads `plugins.allow` by hand. With an empty allowlist and `plugins.entries.browser.enabled: false`, it blames `plugins.allow`, which is not the cause. - **OpenShell File Transfer gate** (`extensions/openshell/src/worker-workspace.ts`) does a hand-made exact-id check. A padded deny entry (`" File-Transfer "`) passes it, so agent workspace binding does not keep the operator's File Transfer restriction. - **Doctor Codex bwrap hint** (`src/commands/doctor-sandbox.ts`) reads only `agents.defaults.sandbox.docker.network`. An agent's own network setting changes how the runtime starts that sandbox, but Doctor ignores it. The result is a wrong network-namespace probe and a wrong hint. - The browser notice and the OpenShell gate call `resolveEffectiveEnableState`, the same resolver the plugin loader uses. This is the same fix as #207215. - The bwrap check reads `docker.network` from every container sandbox that `resolveSandboxConfigForAgent` resolves (already used for the engine since #207213), including sandboxes a gateway role requires. It probes the network namespace when any of them has no egress. Whether the check runs at all still follows a mode-on sandbox, as before. The hint no longer names one engine for every sandbox. - Users with an empty allowlist see a correct `/tools` browser notice; a padded File Transfer deny entry now keeps its restriction. - Users with a per-agent sandbox network get the correct Codex bwrap check on Linux. - No config, schema or wire change. - New tests are red on `main` and green on this branch (inventory blame rows, the OpenShell padded-deny row, and the bwrap resolved-network rows). Controls pass on both. - The plugin-activation diff is the one Fable 5.2 reviewed (no finding). It applies to current `main` without change. - The bwrap change had two Fable 5.2 rounds. Round 1 found three issues: role-required sandboxes were skipped, the test did not prove "any", and the hint named one engine. All three are fixed. Round 2 found no regression. - Accepted edge case (round 2): when a gateway role requires a sandbox, #207213 counts the defaults entry as a sandbox. Its network (`none` unless set) can start the network-namespace probe when every listed agent has egress. The result is an extra check, not a missed one. A warning appears only on hosts that deny the network namespace. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 9bbd5f5) Companion audit: Select only OpenShell File Transfer activation and its regression. Other doctor and browser diagnostics are intentionally excluded. Release adaptation: Use stable public activation resolver only in OpenShell workspace binding; keep browser and native diagnostics unchanged. Co-authored-by: RomneyDa <[email protected]>
Problem
Three places re-derive settings instead of asking the owner the runtime uses (#205672 cases 2 and 3; #201988 follow-up). Each one gives a wrong answer when a setting is set only in the per-entry or per-agent config.
/toolsbrowser notice (src/agents/tools-effective-inventory.ts) readsplugins.allowby hand. With an empty allowlist andplugins.entries.browser.enabled: false, it blamesplugins.allow, which is not the cause.extensions/openshell/src/worker-workspace.ts) does a hand-made exact-id check. A padded deny entry (" File-Transfer ") passes it, so agent workspace binding does not keep the operator's File Transfer restriction.src/commands/doctor-sandbox.ts) reads onlyagents.defaults.sandbox.docker.network. An agent's own network setting changes how the runtime starts that sandbox, but Doctor ignores it. The result is a wrong network-namespace probe and a wrong hint.Solution
resolveEffectiveEnableState, the same resolver the plugin loader uses. This is the same fix as fix(doctor): Codex asset reminder follows plugin activation #207215.docker.networkfrom every container sandbox thatresolveSandboxConfigForAgentresolves (already used for the engine since fix(doctor): check sandboxes the runtime enables per agent #207213), including sandboxes a gateway role requires. It probes the network namespace when any of them has no egress. Whether the check runs at all still follows a mode-on sandbox, as before. The hint no longer names one engine for every sandbox.Impact
/toolsbrowser notice; a padded File Transfer deny entry now keeps its restriction.Evidence
mainand green on this branch (inventory blame rows, the OpenShell padded-deny row, and the bwrap resolved-network rows). Controls pass on both.mainwithout change.noneunless set) can start the network-namespace probe when every listed agent has egress. The result is an extra check, not a missed one. A warning appears only on hosts that deny the network namespace.