Skip to content

improve(ui): show exec policy by host and agent, edited in place - #191382

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/settings-devices-exec-policy
Nov 3, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/settings-devices-exec-policy

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Exec approvals asks you to pick a target, then maybe a node, then a scope, before it shows anything, and only ever shows one scope. To learn what an agent may run you had to select each agent in turn. The allowlist sat in a separate section under a Save it didn't sit beside, every pattern was printed twice, and Remove was red on every row. A failed load appeared at the top of the page, next to nothing. After a target switch the section read "Load exec approvals to edit allowlists." as if that were a setting. On a phone, Save dropped to its own line above the group.

Exec node binding repeated what each select already said: "agent · uses default (any)" beside "Use default". With no eligible node it showed a disabled select per agent, and a failed read replaced the section with a raw Error: ….

User Impact

  • Which policy applies: a host holds one policy. Host is now one select, Gateway and each node together, and choosing one loads it. No nodes means plain text saying so.
  • At a glance: Defaults and every agent are rows showing what they set, named without an id that only repeats the name. An agent reads as what it changes, like "Security: Full", "Ask: Off" or "3 patterns", or "Uses defaults".
  • Edit: open a row to change its fields. The allowlist lives in its agent's row: each pattern is one field that wraps to show a long path, with its last use under it when it has one, and Add pattern where the next one will appear. Under Deny the patterns dim, because no pattern is read there.
  • Save: appears only with a draft, beside a quiet note, in line at every width, and stays in reach down a long allowlist. A rejected save keeps the draft and says why beside the button, and Saved confirms in the same place.
  • Failure: a failed load shows in its section with Retry, and no longer clears or crowds the page's other errors.
  • Binding: one row per agent, with "Use default (Any node)" naming what it inherits. With no eligible node and nothing bound, the section is one line. Bindings keep autosaving.

Read-only users no longer see an empty Exec approvals section that repeated the page's browsing-only notice. Host-native policies stay read-only, without the duplicate "Native" and rule count.

Why This Change Was Made

The data is a small table of scope by setting with inheritance, stored per host, so a list of scopes that states their difference replaces the picker that hid it. Exec approvals keeps an explicit Save because it writes a separate file against a hash and an edit spans several fields. Its confirmation stays in its own row because the shared save status reports config autosaves, and this file doesn't go through them.

The row is the disclosure from the Devices rows, reused. The agent picker and its avatars are gone from this section, since every agent is now on screen.

Landing order: #191329, then #191356, then this. It is stacked on #191329, so the base is that branch. #191356 removes the same binding Save, and this change matches its action owner, so any conflict there is mechanical. #191354 makes the binding outcome visible on phones and doesn't overlap this Save.

Evidence

Mock Gateway responses, Absolutely light, a draft open on the Ops agent with Security set to Deny.

Before After
1440 Before After
390 Before After

Closed rows, then a failed load:

Closed rows

Failed load

42 patterns at 390, with a long path wrapping and Save in reach:

Long allowlist

CRT keeps square corners and its own primary:

CRT

Also checked at 1440 and 390: no nodes, rejected save, Saved and host-native policy. At 1440: a failed config read. No horizontal overflow. Pattern fields grow through field-sizing: content, and Playwright WebKit renders them and the sticky Save the same at 390; a browser without it scrolls the line instead. The new browser tests cover the discard prompt with auto-load, saving an allowlist edit with the row staying open, and retrying a failed load.

Checks run locally: oxfmt, stylelint, oxlint, pnpm tsgo:ui, pnpm ui:i18n:verify, unit tests in ui/src/pages/devices, and the exec approvals, device binding, Settings reload, device alias and platform browser tests.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR groups execution policies by host and agent, with expandable editors, inline allowlists, save feedback, and local retry controls.

Example: Inspect the Ops agent’s Gateway policy at a 390px viewport.

  • Before: Choose Ops in a scope picker and edit its allowlist in a separate section.
  • After: Open the Ops row to see Security: Deny, three patterns, and an inline Save action.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Clear visual evidence and a useful design, with a concrete asset-budget blocker and a documentation correction remaining.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected desktop and phone before/after screenshots show the changed Devices renderer with synthetic Gateway responses, including expanded agent policies, inline allowlists, and the draft Save row; this establishes the visible behavior without claiming live persistence or execution enforcement coverage.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators must repeatedly switch scopes to compare policies, and allowlist editing and save feedback are separated from their context.
Reason: The maintainer-authored direction improves scanning and editing at desktop and phone widths while retaining existing policy semantics.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-authored PR open: the UI improvement is useful, but its CSS growth fails the asset budget and the editing guide still describes the removed picker.

Priority: P3
Reviewed head: a6ccf24f4bb640c5a7aa72c7b40e70854e7e45b4

Before merge

  • Keep the added policy styles within the CSS asset budget (P2) - The new styles increase an already-over-budget CSS surface beyond its 64-byte variance allowance. The exact-head performance check reports raw CSS at 1613.3 KiB against 1611.7 KiB allowed and gzip at 312.2 KiB against 312.0 KiB allowed. Reduce or consolidate the added rules while preserving the layout, then pass the existing base-relative performance check.
  • Update the guide for editing policies through agent rows (P3) - Replacing the scope picker leaves the Control UI editing instructions telling users to pick a Defaults or agent scope that no longer exists. Update the Control UI editing section in docs/tools/exec-approvals.md to describe choosing a host, opening its Defaults or agent row, editing patterns there, and saving the draft.

Findings

  • [P2] Keep the added policy styles within the CSS asset budget — ui/src/styles/devices.css:230-234
  • [P3] Update the guide for editing policies through agent rows — ui/src/pages/devices/view-exec-approvals.tsx:338-343

Tests

  • Low-value test ui/src/pages/devices/view.execution.test.ts: Remove the stub-only Save and failed-load callback cases duplicated by the mounted page save tests and browser save/retry scenarios; retain their stronger behavioral coverage.
Agent review details

How this fits together

The Devices page projects Gateway policy snapshots and configuration into editable controls; existing owners send hash-checked approval writes and autosave node bindings.

flowchart TD
  A[Devices page] --> B[Host selector]
  B --> C[Approval read owner]
  C --> D[Agent policy rows]
  D --> E[Approval save owner]
  E --> F[Gateway policy RPC]
  A --> G[Config binding owner]
Loading

Technical review

Best possible solution:

Keep the existing policy owners and disclosure design, reduce CSS within the existing budget, and update the editing instructions.

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

The screenshots establish the presentation problem and improvement; GitHub annotations directly establish the CSS budget failure without running target code.

Is this the best way to solve the issue?

Reusing the existing disclosure and policy owners is a coherent solution; the smaller complete change retains these controls while meeting the asset budget and keeping documentation accurate.

Full review comments:

  • [P2] Keep the added policy styles within the CSS asset budget — ui/src/styles/devices.css:230-234
    The new styles increase an already-over-budget CSS surface beyond its 64-byte variance allowance. The exact-head performance check reports raw CSS at 1613.3 KiB against 1611.7 KiB allowed and gzip at 312.2 KiB against 312.0 KiB allowed. Reduce or consolidate the added rules while preserving the layout, then pass the existing base-relative performance check.
    Confidence: 0.99
  • [P3] Update the guide for editing policies through agent rows — ui/src/pages/devices/view-exec-approvals.tsx:338-343
    Replacing the scope picker leaves the Control UI editing instructions telling users to pick a Defaults or agent scope that no longer exists. Update the Control UI editing section in docs/tools/exec-approvals.md to describe choosing a host, opening its Defaults or agent row, editing patterns there, and saving the draft.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 99e521412641.

Provenance checked

  • Policy rendering and inheritance keeps the original intent (fix: show effective exec approval policy in Devices #125756: Display owner-resolved defaults with authored defaults, wildcard settings, and agent overrides in the correct precedence.)
  • Dirty target switching keeps the original intent (24b93de: Prevent a target selection from silently discarding an unsaved execution-policy draft.)
  • Save presentation keeps the original intent (5d0eef6: Present existing owner-controlled policy saves through Solid transitions without transferring write authority.)
  • Binding Save removal changes intended behavior with a stated reason (improve(ui): remove Save from Devices bindings, which autosave #191356: Bindings already autosave through runtime configuration, making their extra Save misleading.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm ui:check-performance:base
  • pnpm lint:ui:styles
  • pnpm tsgo:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5d0eef6 adds ui/src/pages/devices/devices-page.tsx:600 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5d0eef65978f; files: ui/src/pages/devices/devices-page.tsx)
  • Tommy Joseph: Raw commit 24b93de adds ui/src/pages/devices/devices-page.ts:480 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 24b93dea01ea; files: ui/src/pages/devices/devices-page.ts)

PR surface

Source +224, Tests +147. Total +371 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 10 740 516 +224
Tests 11 269 122 +147
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 1009 638 +371

Labels

Label changes:

  • add P3: This is an execution-policy editing and discoverability improvement without an established urgent runtime failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an execution-policy editing and discoverability improvement without an established urgent runtime failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Remove the duplicate stub-only rendering tests while retaining the stronger page and browser scenarios.

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 2, 2026, 1:41 PM ET / 18:41 UTC.

Base automatically changed from brzezowski/settings-devices-redesign to main November 3, 2026 13:59
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/settings-devices-exec-policy branch from 55a2822 to 0b1de53 Compare November 3, 2026 14:49
@vyctorbrzezowski
vyctorbrzezowski merged commit 554115b into main Nov 3, 2026
14 of 15 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/settings-devices-exec-policy branch November 3, 2026 14:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…nclaw#191382)

Edit execution policy by host and agent while preserving approval ownership, target-switch confirmation, and save/retry feedback. Keep bindings on autosave without a redundant Save action.

Validation: 26 focused tests, 4 execution-approval E2Es, and UI typecheck passed. The obsolete mock baseline is already removed in integrated main. Prior CSS-only budget failures are authorized; full CI may remain pending under the batch policy.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant