Skip to content

fix: show effective exec approval policy in Devices - #125756

Merged
steipete merged 1 commit into
mainfrom
steipete/competent-northcutt-ae78b4
Aug 18, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/competent-northcutt-ae78b4

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users opening Devices → Exec approvals could see UI fallback values instead of the effective policy reported by the local Gateway, especially for a fresh approvals file. The page could show Deny / On miss while the owner-resolved defaults were Full / Off. It also offered node targets as editable when they advertised only the read or only the write command.

Why This Change Was Made

The approval-state owner now includes canonical resolvedDefaults in local Gateway snapshots, and the Control UI combines those reported defaults with authored defaults, wildcard overrides, and exact-agent overrides in the correct precedence. The shared node-host restores its opt-in includeResolvedDefaults response behavior for Mac node snapshots, while editable node targets now require both system.execApprovals.get and system.execApprovals.set.

This changes reporting and presentation only. Approval authorization, enforcement, and persisted policy semantics are unchanged.

Production LOC: +58/-22 (net +36), including +5/-1 generated Swift protocol projection. Tests: +151/-2 (net +149). The production growth is the new owner-reporting contract, restored node-host protocol behavior, stricter capability gate, and generated cross-language projection.

User Impact

Devices now displays the policy that will actually apply, while preserving authored defaults and wildcard/agent overrides. Operators can select only nodes that support both reading and saving approval policy.

Release-note context: Devices now shows effective exec-approval defaults and limits editable node targets to nodes that support both policy reads and writes.

Evidence

Fresh approval defaults

Before, fresh state rendered UI fallbacks (Deny / On miss). After, it renders the owner-reported effective defaults (Full / Off).

Before After
Before: fresh approvals show Deny and On miss After: fresh approvals show Full and Off

Editable node targets

Before, a read-only node could be selected for editing. After, only the node advertising both read and write commands is offered.

Before After
Before: get-only node is selectable After: only the editable node is selectable

Source-blind browser evidence recorded the failing-before values and node list, then the passing-after values and capability-filtered list. All four captures were visually inspected and sanitized before upload.

Focused proof:

  • node scripts/run-vitest.mjs src/gateway/server-methods/exec-approvals.test.ts — 17/17 passed
  • node scripts/run-vitest.mjs src/node-host/invoke.test.ts — 27/27 passed
  • node scripts/run-vitest.mjs ui/src/pages/devices/view.devices.test.ts — 22/22 passed
  • Scoped node scripts/check-changed.mjs -- <core and UI changed files> — exit 0
  • Protocol generation/checks — clean
  • Fresh uncommitted autoreview — no accepted or actionable findings

Known proof gap: an unrelated broader local macOS packaging shard timed out and is not claimed as passing. Exact-head CI and the repository Testbox prepare gate remain required before landing.

AI-assisted; the maintainer inspected the implementation, proof, and final diff.

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 18, 2026 09:42
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Aug 18, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 5:48 AM ET / 09:48 UTC.

ClawSweeper review

What this changes

The PR adds resolved exec-approval defaults to Gateway and supported node snapshots, uses them in Devices, and limits editable node targets to nodes advertising both read and write commands.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: current main still returns only the authored approval file and the Devices view still substitutes UI fallbacks, while this PR adds an owner-resolved snapshot value and consumes it with the established override precedence. It is a protected maintainer PR and should proceed through exact-head validation rather than auto-cleanup.

Priority: P2
Reviewed head: ba5f9132fa43cf0549c70f885b06361d2783e84c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch follows the approval owner boundary and has focused regression coverage, with exact-head integration gates still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also supplies before-and-after Devices captures and focused validation results.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also supplies before-and-after Devices captures and focused validation results.
Evidence reviewed 5 items Current-main gap: Current main returns only the redacted file snapshot, and its Devices resolver derives defaults from local UI fallbacks; it has neither the reported owner defaults nor wildcard-aware selected-scope defaults.
Owner-boundary repair: The PR derives defaults at the approval-policy owner and exposes them through the additive optional protocol field before the UI consumes them.
Caller and sibling compatibility: Devices loads snapshots through the Gateway RPC helper, while the Gateway requests the extra node field only for the Mac node identity and keeps empty legacy parameters for other identities.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: FAIL (failed) — execution before step 1 run: live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

Assertions:

  • FAIL expect_output: Usage:

How this fits together

Devices reads approval-policy snapshots from the local Gateway or a paired node, then presents editable policy defaults and agent overrides to operators. The snapshot producer resolves persisted policy defaults, while the UI applies authored wildcard and agent-specific overrides for the selected scope.

flowchart LR
  A[Approval policy file] --> B[Policy resolver]
  B --> C[Gateway snapshot]
  B --> D[Node-host snapshot]
  C --> E[Devices page]
  D --> E
  E --> F[Scope precedence]
  F --> G[Editable policy controls]
Loading

Before merge

  • Resolve merge risk (P1) - The additive snapshot field and Mac-only node request cross an independently versioned Gateway/node boundary; retain the tested legacy empty request for other node identities and require exact-head protocol validation.
  • Resolve merge risk (P1) - This bug fix has a production net increase of 36 lines; the added owner-reporting contract and opt-in node parsing appear necessary, but should be retained only if the focused checks and generated projection remain clean.
  • Complete next step (P2) - No discrete repair is needed; this protected maintainer PR should await its exact-head validation gates.
Agent review details

Security

None.

PR surface

Source +32, Tests +149, Other +4. Total +185 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 6 53 21 +32
Tests 3 151 2 +149
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 5 1 +4
Total 10 209 24 +185

Review metrics

Metric Value Why it matters
Production versus test delta production +58/-22 (net +36); tests +151/-2 (net +149) The production increase implements the owner snapshot, opt-in node response, protocol projection, and UI precedence; the tests cover the reported regressions.
Protocol surface 1 optional snapshot field added; 1 opt-in node request parameter added Both additions cross Gateway and node-host versions, so additive compatibility must be preserved before merge.

Merge-risk options

Maintainer options:

  1. Validate the additive rollout (recommended)
    Require exact-head protocol generation, focused Gateway/node/UI checks, and Testbox preparation while preserving legacy empty parameters for non-Mac node identities.
  2. Accept the cross-version risk
    Land based on the existing optional-field and legacy-parameter tests if maintainers explicitly accept residual risk for older Mac node installations.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require exact-head protocol generation, focused Gateway/node/UI checks, and Testbox prepare verification; preserve the legacy empty node parameters for non-Mac identities.

Technical review

Best possible solution:

Keep resolved defaults owner-produced and UI-consumed with the tested precedence, then land only after exact-head protocol, Gateway, node-host, UI, and Testbox gates confirm the additive cross-version behavior.

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

Yes: current-main source reproducibly derives Devices defaults from the approval file alone, so an empty file falls back to UI values instead of the policy owner's resolved defaults.

Is this the best way to solve the issue?

Yes: resolving defaults at the approval-policy owner and passing an additive snapshot fact to Devices avoids duplicating policy resolution in the UI while retaining wildcard and exact-agent precedence.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This corrects bounded but user-visible Devices policy reporting and node edit-target selection.
  • add merge-risk: 🚨 compatibility: The optional approval snapshot field and opt-in node request span independently installed Gateway and node-host components.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also supplies before-and-after Devices captures and focused validation results.

Label justifications:

  • P2: This corrects bounded but user-visible Devices policy reporting and node edit-target selection.
  • merge-risk: 🚨 compatibility: The optional approval snapshot field and opt-in node request span independently installed Gateway and node-host components.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body also supplies before-and-after Devices captures and focused validation results.

Evidence

What I checked:

Likely related people:

  • steipete: The PR head is authored by steipete, and local shortlog history shows the strongest contribution trail across the Gateway, node-host, and Devices approval paths. (role: recent area contributor; confidence: high; commits: ba5f9132fa43, 6afaf82e1ecb, 5e67beb02e93; files: src/gateway/server-methods/exec-approvals.ts, src/node-host/invoke.ts, ui/src/pages/devices/view-exec-approvals.ts)

Rank-up moves

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

  • Complete exact-head CI and the required Testbox prepare gate before landing.

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for ba5f9132fa43cf0549c70f885b06361d2783e84c:

  • Focused owner-boundary tests:
    • node scripts/run-vitest.mjs src/gateway/server-methods/exec-approvals.test.ts — 17/17 passed
    • node scripts/run-vitest.mjs src/node-host/invoke.test.ts — 27/27 passed
    • node scripts/run-vitest.mjs ui/src/pages/devices/view.devices.test.ts — 22/22 passed
    • Scoped node scripts/check-changed.mjs -- <core and UI changed files> — exit 0
    • Protocol generation/checks — clean
    • Fresh uncommitted autoreview — no accepted/actionable findings
  • Exact-head CI: run 32123012689, attempt 2 — success. Attempt 1 had one unrelated markdown-tables.test.ts clipboard-mock failure after 9,922 UI tests passed; the focused file passed 4/4 locally and the job-scoped rerun passed without code changes.
  • Native landing gate: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 125756 passed at 2026-08-18T10:21:21Z in hosted_exact_or_recent_parent mode for this exact head. No separate remote Testbox lease/run was allocated; REMOTE_GATES_LEASE_ID and REMOTE_GATES_RUN_URL are empty because the wrapper accepted the exact-head hosted result.
  • Source-blind browser proof, visually inspected and sanitized:
  • ClawSweeper completed review: no actionable findings. Its only Rank-up move was exact-head CI plus the required Testbox prepare gate; both are now complete. The compatibility concern is covered by the optional snapshot field, legacy empty parameters for non-requesting node paths, focused protocol/Gateway/node/UI checks, and the native prepare gate. Production +58/-22 (net +36, including generated Swift +5/-1); tests +151/-2 (net +149).
  • Authorization/enforcement and persisted approval semantics are unchanged.

Known gap: an unrelated broader local macOS packaging shard timed out and is not claimed as passing. Exact-head CI and the repository-native prepare gate are green. ClawSweeper also could not run its optional pnpm openclaw --help live probe because pnpm installation failed in its worker; the review marked that probe not applicable and found no code issue. A same-head ClawSweeper refresh started automatically, so no manual re-review was requested.

@steipete
steipete merged commit 01811fb into main Aug 18, 2026
465 of 468 checks passed
@steipete
steipete deleted the steipete/competent-northcutt-ae78b4 branch August 18, 2026 10:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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