Skip to content

fix(plugins): expose blocked hook permissions and recovery - #160899

Open
roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/fix-155227-plugin-permission-diagnostics
Open

roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/fix-155227-plugin-permission-diagnostics

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #155227 (host-observed diagnostics milestone; declared permission requirements remain deferred).

What Problem This Solves

Fixes: operators cannot discover why plugin hooks are blocked when the plugin is enabled and the Gateway remains healthy.

User Impact

Plugin pages now explain Limited functionality and provide Review permissions directly to the highlighted existing control. Current warnings also appear in the Inbox, update results, and selected memory-plugin status. Saved, applied, and failed states remain distinct, with Apply saved settings recovery after a persisted activation failure.

Permission defaults and authorization are unchanged. Explicit denials remain intentional choices; upgrades never grant access automatically. These controls govern host hook registration, not a sandbox for trusted plugin code, and registration is not evidence of execution.

Why This Change Was Made

Implementation scope directed by @jalehman: implement the host-observed diagnostics milestone across the existing Control UI surfaces, defer manifest-declared permission requirements, and validate the requested rebase/CI repair. No merge or deployment is authorized.

The Memory page changes render existing plugin diagnostics only; they do not change persisted memory, vector/embedding metadata, retention, or grant defaults.

The existing hook-policy producer now records structured refusals in its runtime registry. Existing request-owned plugin snapshots and generation-fenced UI readers project those facts; no log parsing or separate permission store is added. Configuration writes, application, and recovery stay with the existing configuration owner. The added production code is the diagnostic contract and its projections across the existing surfaces, rather than a second policy system.

Evidence

Current revision — validation in progress

Head: 8930b07dd8c5b78266ea3acf33d7c5e5fef06114, rebased onto pinned main 72b24670bf7ca5e44ff89e0b681bf9f997d9187a and pushed with an exact lease on the previous head. The conflicts retain main’s MCP sign-in/icon behavior and shared Memory Dreams panel.

  • Integrated regressions passed: 184 tests in 80.45s, including MCP sign-in and Memory page siblings. The final lazy-loading boundary passed a further 8 tests in 4.01s, and Swift protocol parity passed.
  • Fresh autoreview found no P0/P1 behavior or security defect in the final working-tree code. Its two INDEX-only staging findings were resolved by staging and committing those same reviewed fixes.
  • Source-size and environment-name ratchets now pass (476/476 names); full changed-surface checks are running. No ratchet exception, wire-format change, or protocol-version bump was introduced.
  • The new exact-head real Gateway/Chromium and published-updater run is queued on its session-owned Blacksmith Testbox. The installed package’s build commit is asserted against this head. Prior captures/results below are explicitly not a new-head proof or substantive CI result.
  • The PR is ready for review and GitHub reports the branch mergeable. Substantive CI run 36636958804 is attached to this exact head: preflight passed, iOS lanes started, and Linux build/test lanes are awaiting runners. The earlier draft-push run was skipped and is not acceptance. No completed CI result is claimed yet.

Prior-head evidence (c39c7b33dacfd; historical, not current-head validation)

  • Pinned baseline fb503c9e1f25d8c3877881e55e83d4378eda3676: a real external plugin loaded and its allowed startup hook ran, but its conversation hooks were blocked with no Review permissions action. The acceptance assertion failed before the change.
  • Published-driver upgrade: the installed [email protected] updater installed the built 2026.9.6 candidate tarball in an isolated prefix. Existing plugin configuration and absent grants were preserved. Package integrity/import-graph checks passed.
  • Real Gateway + Chromium: review/keyboard navigation, grant and actual before_prompt_build execution via chat.send/agent.wait, unrelated blocked sibling, explicit denial versus inherited default, persisted activation failure and successful reapply, superseding CLI write, 390px layout, and a browser actually admitted with only operator.read all passed. The read-only browser dispatched no configuration writes.
  • Provider inference was a deterministic local Responses fixture, not a live model. Gateway lifecycle, authentication, storage, configuration, plugin activation, and hook execution were real.
  • Focused regressions: 122 tests, 8 files / 3 routed shards, 30.71s wall with --maxWorkers=1; the final lint-repair UI subset passed 34 tests in 7.32s. Core, UI, and core-test typechecks; Swift protocol parity; protocol-since guard; i18n verification/baseline; changed-file formatting; and scoped type-aware lint passed. Full candidate build and package checks passed.
  • Independent autoreview found a misleading runtime-value label. It was corrected to Last inspected policy, with saved-but-failed regression coverage.

Crabbox provider: blacksmith-testbox; lease tbx_01m3nd71rskmdft2dy3x5qw7fa (stopped after proof). Runner allocation. The final installed-candidate scenario exited 0; its command took 94.57s. Delegated lease cleanup can mark the allocation run cancelled; the wrapper terminal receipt owns the proof result.

Inspected before/after screenshots and recovery/read-only states.

Prior-head inherited check failures (historical): check:changed stops at the environment-variable budget: both untouched base and candidate contain 477 names against a budget of 476 (no added or removed names). Broad core lint also flags existing line caps in node-launch-adapter.test.ts, talk/relay/session-create.ts, missing-configured-plugin-install.repair.ts, and config-env-vars.ts; all four files are unchanged by this PR. Changed-file lint is clean. No full-repository CI or macOS SwiftLint result is claimed. No merge or deployment is requested.

Requested by @jalehman; co-authored with Josh Lehman. Related blocked-hook health work by @zeroaltitude is tracked in #136474; that PR is unchanged here. Integration must retain a single host-refusal producer rather than parallel policy owners.

Work sessions

Worked on by


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 29, 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.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Plugin permission diagnostics — inspected UI proof

Before

The plugin is enabled, but its blocked conversation hooks have no visible permission diagnosis or review action. Baseline: fb503c9e1f25d8c3877881e55e83d4378eda3676. The inference warning in this capture is separate from the missing permission action.

Before: enabled Conversation Notes plugin without permission diagnostics

After

The published-driver-upgraded candidate shows Limited functionality, the specific blocked hooks and configuration key, and Review permissions. No access is granted automatically.

After: blocked hooks explained with Review permissions

Saved-but-failed recovery and read-only states

Saved, but not applied

A persisted activation failure remains visibly failed. Apply saved settings offers recovery, and Last inspected policy avoids claiming that the saved value is active.

Saved but failed: Apply saved settings recovery and last inspected policy

Read-only

The browser was actually admitted with only operator.read. Permission controls are disabled; the scenario dispatched no configuration writes.

Read-only: disabled permission controls and operator.admin requirement

All four captures are real Gateway/Chromium screenshots, inspected and sanitized before upload (1280 × 900). The installed [email protected] updater installed the candidate while preserving existing configuration and absent grants. The final installed-candidate lifecycle/read-only scenario passed (exit 0; 94.57s command wall time): granted hook execution, blocked sibling isolation, explicit denial/reset, persisted-failure recovery, a superseding CLI write without false applied state, and 390px layout. Gateway authentication/configuration/reload, chat.send/agent.wait, and hook execution were real; inference used a deterministic local Responses fixture, not a live model.

Published head checked: c39c7b33dacfd0454bc38e9ea20c304cedc433d2. Its sole parent is the tested implementation commit 9245c6bcc722549726a9dea8b6814aa77785b410; both have tree cfafc894398453352124dea35de97b54ca473cf7. The native publication commit changes no files and preserves Josh’s coauthor credit. No new test run, full-CI-green claim, or merge is implied.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: L labels Sep 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 6:13 PM ET / 22:13 UTC (Revision 2).

ClawSweeper review

What this changes

The branch records policy-blocked plugin hooks in Gateway responses and adds permission notices, navigation, update warnings, and saved-settings recovery to the Control UI.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open. Current main does not provide the reported Control UI diagnosis, and the branch has useful real-browser proof. The exploratory request has not publicly settled the Gateway diagnostic contract, which overlaps separate health-reporting work.

Priority: P2
Reviewed head: 8930b07dd8c5b78266ea3acf33d7c5e5fef06114
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has strong visible and runtime evidence with no established patch defect, while the shared contract and current-head integration still need resolution.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Prior-head real Gateway and Chromium evidence exercises blocked registration through the plugin UI, permission review, failed-apply recovery, and read-only controls; inspected before/after images show the changed visible states. The current-head repeat was pending in the captured PR body. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Prior-head real Gateway and Chromium evidence exercises blocked registration through the plugin UI, permission review, failed-apply recovery, and read-only controls; inspected before/after images show the changed visible states. The current-head repeat was pending in the captured PR body. No stored-data contract changes.
Evidence reviewed 10 items Current-main gap: The fetched main tree has no blockedHooks projection or Limited functionality and Review permissions UI copy in the searched plugin, Gateway, protocol, and UI paths.
Existing policy boundary: Main already refuses ungranted conversation hooks before registration, but reports them only as warnings.
Introduced refusal record: The existing hook-policy branch now records structured refusal facts without changing its allow-or-deny decisions.
Findings None None.
Security None None.

How this fits together

The plugin loader checks hook registrations against operator policy and publishes its active registry through Gateway reads. The Control UI uses those reads to explain blocked hooks and directs authorized operators to existing configuration controls.

flowchart LR
A[Plugin hook registration] --> B[Gateway hook policy]
B --> C{Registration allowed?}
C -- Yes --> D[Active hook]
C -- No --> E[Blocked-hook registry]
E --> F[Gateway plugin snapshot]
F --> G[Control UI warning and permission link]
Loading

Decision needed

Question Recommendation
Should this host-observed diagnostic shape and the proposed Control UI surfaces become the first milestone, with the open health-view work consuming the same refusal contract? Approve one shared first milestone: Confirm this host-observed contract and UI scope, then align the health-view work to its single refusal producer.

Why: The linked request is exploratory and does not commit to a final API or complete first-milestone scope; a contributor's description of direction does not settle that public contract.

Before merge

  • Resolve merge risk (P1) - The branch and the open health-view PR both define blocked-hook diagnostics. A plugin/Gateway owner needs to settle one shared Gateway contract before either implementation establishes a competing shape.
  • Resolve merge risk (P1) - The published-updater and real Gateway/Chromium run covers an earlier head. The captured PR body says the current-head repeat was pending after the rebase and UI integration.
  • Complete next step (P2) - Confirm the shared first-milestone diagnostic contract and overlap plan with the plugin/Gateway owner, then review the current-head updater and browser evidence.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +418, Tests +433, Docs +24, Other +51. Total +926 across 46 files.

View PR surface stats
Area Files Added Removed Net
Source 37 471 53 +418
Tests 7 435 2 +433
Docs 1 24 0 +24
Config 0 0 0 0
Generated 0 0 0 0
Other 1 52 1 +51
Total 46 982 56 +926

Review metrics

Metric Value Why it matters
Gateway response contract 2 optional blocked-hook fields added The plugin list and UI descriptor responses would expose a shared diagnostic shape to clients.

Stored data model

Persistent data-model change detected: unknown-data-model-change: ui/src/pages/config/memory-page.ts, vector/embedding metadata: ui/src/pages/config/memory-page.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #155227
Summary: This PR is a candidate for the linked proposal's host-observed Control UI milestone; the separate open PR overlaps the refusal producer but targets health and CLI views.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Settle the shared contract before merge (recommended)
    Confirm the Gateway diagnostic shape with the plugin and health-view owners, then record current-head updater and browser results.
  2. Pause for health-view integration
    Wait for the overlapping health work to establish a canonical refusal contract before adapting this UI branch.

Technical review

Best possible solution:

Use one lifecycle-scoped host refusal record for Control UI and health views, preserve explicit operator denials, and keep permission application and recovery with the existing config owner.

Do we have a high-confidence way to reproduce the issue?

No fresh current-main run was performed here. The prior-head real Gateway baseline shows blocked hooks without a UI action, and current-main source still lacks the diagnostic projection.

Is this the best way to solve the issue?

Yes for a host-observed first milestone: it reuses the existing policy and config owners. The final shared Gateway contract needs owner confirmation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c4461b537ce3.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This addresses a concrete plugin-management diagnosis gap with limited affected scope.
  • merge-risk: 🚨 compatibility: The new Gateway diagnostic fields establish a client contract while an open health-view PR proposes overlapping refusal records.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Prior-head real Gateway and Chromium evidence exercises blocked registration through the plugin UI, permission review, failed-apply recovery, and read-only controls; inspected before/after images show the changed visible states. The current-head repeat was pending in the captured PR body. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Prior-head real Gateway and Chromium evidence exercises blocked registration through the plugin UI, permission review, failed-apply recovery, and read-only controls; inspected before/after images show the changed visible states. The current-head repeat was pending in the captured PR body. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Prior-head real Gateway and Chromium evidence exercises blocked registration through the plugin UI, permission review, failed-apply recovery, and read-only controls; inspected before/after images show the changed visible states. The current-head repeat was pending in the captured PR body. No stored-data contract changes.

Evidence

What I checked:

  • Current-main gap: The fetched main tree has no blockedHooks projection or Limited functionality and Review permissions UI copy in the searched plugin, Gateway, protocol, and UI paths. (c4461b537ce3)
  • Existing policy boundary: Main already refuses ungranted conversation hooks before registration, but reports them only as warnings. (src/plugins/registry-registrars-tools-hooks.ts:385, c4461b537ce3)
  • Introduced refusal record: The existing hook-policy branch now records structured refusal facts without changing its allow-or-deny decisions. (src/plugins/registry-registrars-tools-hooks.ts:379, 8930b07dd8c5)
  • Gateway projection: The Gateway publishes blocked hooks in plugin descriptors and per-plugin runtime status; both protocol fields are optional. (packages/gateway-protocol/src/schema/plugins.ts:114, 8930b07dd8c5)
  • Permission write authority: The new permission edit uses the existing config coordinator and a captured Gateway scope; config.patch remains an operator.admin Gateway method. (ui/src/pages/plugins/plugin-settings-controller.ts:42, 8930b07dd8c5)
  • Visual behavior proof: The prepared PR attachment images were inspected: the baseline lacks a permission diagnosis, while the prior-head candidate shows blocked hooks, Review permissions, saved-but-failed recovery, and disabled read-only controls. The PR describes a real Gateway and Chromium run; its exact-head repeat was still pending in the captured body.

Likely related people:

  • Peter Steinberger: Raw commit 0dbd5c8 adds src/plugins/hook-policy-decisions.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0dbd5c81d531; files: src/plugins/hook-policy-decisions.ts)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Record owner agreement on one blocked-hook diagnostic contract shared with the open health-view work.
  • Attach the current-head published-updater and Gateway/Chromium results after the rebase.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-29T02:32:04.020Z sha c39c7b3 :: blocked before merge. :: none

roboclaw-bot and others added 3 commits September 29, 2026 21:45
Worked on by:
- @jalehman

Co-authored-by: jalehman <[email protected]>
OpenClaw-Publication: f745075a-7439-4b9c-830e-525dc0570be4
Resolve integrated source line-cap failures without changing the diagnostic wire shape or connection fencing.

Co-authored-by: jalehman <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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