Skip to content

fix(plugins): ask the activation resolver instead of reading plugin policy by hand - #207238

Merged
obviyus merged 3 commits into
mainfrom
core/plugin-activation-callers
Nov 28, 2026
Merged

obviyus merged 3 commits into
mainfrom
core/plugin-activation-callers

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

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

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, fix(doctor): check sandboxes the runtime enables per agent #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.

…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.
@clawsweeper

clawsweeper Bot commented Nov 28, 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 commands Command implementations agents Agent runtime and tooling extensions: openshell size: S labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This 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".

  • Before: Doctor skips the Codex network-namespace probe because it reads the defaults.
  • After: Doctor requests the probe because the active agent's resolved sandbox disables egress.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-consistent, but required product-path evidence remains incomplete and the failed required check is unclassified.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Users receive misleading browser advice, OpenShell setup accepts normalized plugin restrictions it should reject, and Doctor chooses the wrong namespace check for per-agent networks.
Reason: The maintainer-authored direction repairs concrete inconsistencies with little machinery; the linked issue's explicit-disable and denylist browser explanations remain outside the delivered behavior.

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

Before merge

None.

Findings

None.

Agent review details

How this fits together

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

Technical review

Best 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

  • Browser inventory notice keeps the original intent (f3ba962: Explain why configured browser automation is absent from the effective tool inventory.)
  • OpenShell File Transfer restriction keeps the original intent (38f411f: Compose optional canonical workspace bindings without overriding existing File Transfer policy or node-command approvals.)
  • Codex namespace diagnostics keeps the original intent (43c6c26: Diagnose host namespace denials while probing network isolation only when effective sandbox egress is disabled.)
  • Per-agent Doctor configuration keeps the original intent (563eef9: Make Doctor consume the runtime's resolved sandbox settings for defaults and configured agents.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned change and current-main comparison: The introduced diff removes duplicated policy decisions without adding an API, option, or storage format; the affected production files retain their pre-fix behavior on fetched main. (f35114130c90)
  • Existing activation owner: The loader uses resolveEffectivePluginActivationState; its shared implementation normalizes policy IDs, applies deny and explicit-disable precedence, and restricts only nonempty allowlists, matching https://docs.openclaw.ai/tools/plugin. (src/plugins/config-activation-shared.ts:86, f35114130c90)
  • OpenShell admission and persistence: Workspace setup checks activation before remote workspace verification or mutateConfigFile; the returned File Transfer entry keeps the existing serialized shape and grant-preservation logic. (extensions/openshell/src/worker-workspace.ts:34, f35114130c90)
  • Resolved network selection: Doctor now derives its network-probe decision from active resolved sandboxes; the runtime resolver already owns agent overrides, default network "none", and shared-scope exclusions. (src/commands/doctor-sandbox.ts:257, f35114130c90)
  • Relevant earlier contribution and proof: fix(plugins): read plugin policy through the canonical enable owner #205673 supplies shipped OpenShell CLI output showing padded-deny refusal and unchanged configuration for an equivalent resolver call; its browser implementation emits different notices, so that browser output does not prove this PR's result.
  • Required-check failure remains unclassified: security-fast failed at Check mobile protocol event coverage; the pinned base passed security-fast, but the annotation contains only exit code 1 and the redirected runner-log host is blocked, so neither PR causation nor an external failure is established. (f35114130c90)

Likely related people:

  • Ayaan Zaidi: Raw commit 563eef9 adds src/commands/doctor-sandbox.ts:200 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 563eef98925c; files: src/commands/doctor-sandbox.ts)
  • Peter Steinberger: Raw commit f3ba962 adds src/agents/tools-effective-inventory.ts:143 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f3ba962fd05b; files: src/agents/tools-effective-inventory.ts)
  • Vincent Koc: Raw commit 43c6c26 adds src/commands/doctor-sandbox.ts:98 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 43c6c260deb0; files: src/commands/doctor-sandbox.ts)
  • RoboClaw: Raw commit 38f411f adds extensions/openshell/src/worker-workspace.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 38f411fbe793; files: extensions/openshell/src/worker-workspace.ts)

PR surface

Source +12, Tests +56. Total +68 across 6 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 30 18 +12
Tests 3 56 0 +56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 86 18 +68

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the missing browser and per-agent Doctor product-path evidence.
  • Classify the mobile protocol coverage failure before landing.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

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.
obviyus added a commit that referenced this pull request Nov 28, 2026
…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]>
@obviyus
obviyus merged commit 9bbd5f5 into main Nov 28, 2026
125 of 126 checks passed
@obviyus
obviyus deleted the core/plugin-activation-callers branch November 28, 2026 05:45
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
…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]>
tideclaw-bot added a commit that referenced this pull request Nov 29, 2026
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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations extensions: openshell impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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