Repository navigation
feat(ui): label the configured default in the session permissions picker - #132989
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 29, 2026, 11:13 PM ET / August 30, 2026, 03:13 UTC. ClawSweeper reviewWhat this changesThe PR projects a display-only configured permission mode from Gateway agent metadata and renders it in the Control UI chat and new-session permission pickers. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessThe prior P1 remains: role-derived sandbox requirements are not represented in the new agent-wide label, so a sandbox-required session can still display “Default (Full access)”. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway supplies agent metadata to Control UI clients, which use it to describe inherited session settings. Session creation and execution resolution can independently impose a sandbox requirement for an operator role. flowchart LR
A[Agent exec configuration] --> B[Gateway agent listing]
C[Operator role] --> D[Sandbox-required session]
B --> E[Default permission label]
D --> F[Execution policy resolution]
E --> G[Control UI picker]
G --> H[Operator sees inherited default]
F --> I[Sandbox deny base]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The display-only change does not grant access, but it can falsely communicate a more permissive execution boundary to an operator. PR surfaceSource +47, Tests +208, Docs +2, Other +4. Total +261 across 13 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make the displayed inherited label session-aware, or suppress it whenever a role-created or otherwise sandbox-required session could use it, with an end-to-end role-create-to-picker regression test. Do we have a high-confidence way to reproduce the issue? Yes, from source: create a session as a role whose sandbox is required while the agent sandbox is off, leave permissionMode unset, and the picker receives the agent-wide label while execution resolves the session as sandboxed. Is this the best way to solve the issue? No. The current agent-level projection cannot truthfully describe a session-specific role sandbox; the label needs session-aware policy context or conservative omission. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 36180924a062. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
Confirmed and fixed in 1c92c6dac0e — good catch, and the cause was an instruction in my own work order telling the implementation to avoid approvals/sandbox reads for hot-path cost. That was wrong, and it is withdrawn. The defect. The fix. The projection now calls the canonical Pre-fix evidence for the new regression case, verbatim: Ten regression cases now assert the emitted label always equals what |
Expose the configured exec posture as optional agent display metadata and show it in the chat and New Session permission pickers. Preserve plain Default for allowlist and non-equivalent security/ask pairs. Keep session modes unset when inheriting config; the label does not affect authorization, execution, filesystem boundaries, or session persistence. Validate protocol parity, 850 scoped tests, both builds, and inspected mocked picker screenshots. The changed gate reaches a stale oxlint 1.78 failure in unchanged plugin code; pinned oxlint 1.79 passes scoped proof.
Resolve agent defaults through canonical exec policy with one approvals snapshot per listing. Omit labels when sandbox scope or noncanonical policy pairs make them inaccurate, and preserve the existing optional picker projection. Refs: #132989
1c92c6d to
54b11a2
Compare
|
Merged via squash.
|
…ker (openclaw#132989) * feat(ui): label configured default session permissions Expose the configured exec posture as optional agent display metadata and show it in the chat and New Session permission pickers. Preserve plain Default for allowlist and non-equivalent security/ask pairs. Keep session modes unset when inheriting config; the label does not affect authorization, execution, filesystem boundaries, or session persistence. Validate protocol parity, 850 scoped tests, both builds, and inspected mocked picker screenshots. The changed gate reaches a stale oxlint 1.78 failure in unchanged plugin code; pinned oxlint 1.79 passes scoped proof. * fix(gateway): keep default permission labels truthful Resolve agent defaults through canonical exec policy with one approvals snapshot per listing. Omit labels when sandbox scope or noncanonical policy pairs make them inaccurate, and preserve the existing optional picker projection. Refs: openclaw#132989
What Problem This Solves
The chat composer's permission picker shows a bare "Default" row whose description ("Follow the agent's configured policy.") never says what that policy actually is. An operator reading it cannot tell whether Default means guarded, workspace, or unrestricted — for a permissions control, that is a bad place to be vague. The row itself is load-bearing and must stay: it means inherit, so the session tracks later config changes, unlike pinning a mode. It should simply name its own resolution, the way the model picker already does with
Default ({model}).Why This Change Was Made
The gateway now projects an optional, read-only
defaultPermissionModeper agent, computed from the same configured exec posture that governs unmoded sessions:listAgentsForGateway(src/gateway/session-utils-store.ts) alongside the existingagentDefaultModelfact — config-metadata preparation, not per-row hot projection and not request-time discovery. It layers globaltools.execthen agenttools.execexactly asresolveExecDefaultsdoes, then maps through the canonicalSESSION_PERMISSION_BY_EXEC_MODEtable.allowlistmode (which has no session-mode twin) and any security/ask pair that is not the canonical form for its mode — includingask: "always", which no permission mode can express. The UI then renders the plain "Default" it renders today.The picker gains an optional
defaultModeprop and rendersDefault ({mode})via a newdefaultWithModei18n key, following the model picker's established pattern.User Impact
The permission picker and its composer trigger now read "Default (Guarded)" when the agent's configured posture maps cleanly, and stay "Default" when it does not. No behavior change: no new config option, no SQLite change, no session ever has a mode materialized into it, and the
sessionRootdisclosure gate is untouched.Evidence
tools.exec.mode: "ask", sendsagents: [{ id: "main", defaultPermissionMode: "guarded" }]over the real WebSocket to the real Control UI — captured from live frames.Default (Guarded)for anask-mode config and the bareDefaultfallback for anallowlistconfig, in both the chat and new-session flows. Each capture was opened and visually confirmed, not merely produced.pnpm check:changedgreen (with the repo-pinned toolchain); protocol parity and Swift codegen green;pnpm buildgreen; scoped protocol/gateway/UI suites pass.Follows #132740 (landed as a151c1e), which retired the legacy per-session exec policy fields.