Skip to content

fix(ui): clarify permission changes apply to the next run - #126893

Merged
vyctorbrzezowski merged 9 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/approval-mode-mid-run
Aug 23, 2026
Merged

vyctorbrzezowski merged 9 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/approval-mode-mid-run

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Operators can change a session permission mode while work is already running, but the UI did not explain when that change takes effect. The saved mode applies when the next run is admitted; it does not replace the permission context already owned by the active run.

Fixes #126888.

Why This Change Was Made

The permission picker remains compact and free of a persistent footer. After a successful permission change during an active run, the Control UI now shows one dismissible notice: “New permissions apply to the next run.” Idle-session changes remain silent.

The lifecycle boundary is explicit in current Codex: thread permission settings apply to subsequent turns (codex-rs/app-server-protocol/src/protocol/v2/thread.rs:223-242), steering exposes no permission mutation (codex-rs/app-server-protocol/src/protocol/v2/turn.rs:175-197), and the active turn retains its existing context (codex-rs/core/src/session/turn_input.rs:129-137).

The closeout also keeps virtualized transcript disclosures stable when a widget menu closes: the controller captures the interacted row before the top-layer menu changes geometry, then reconciles after the control queues its render.

User Impact

  • Changing permissions during an active run shows a compact next-run notice after the patch succeeds.
  • The current run continues under its admitted permissions; the next run uses the saved mode.
  • Changing permissions while idle shows no notice.
  • Existing permission and operator.admin gates are unchanged.
  • The notice is dismissible, replaces earlier notices, exits automatically after 5 seconds, and preserves the correct dismissal reason when replaced during exit.

Evidence

Captured against the real Control UI /chat route with the repository mock Gateway. The flow asserted an active run, the sessions.patch request, the visible next-run notice, completion of the current run, a new chat.send, and Workspace selected for that next run. The final rebase preserved the UI diff and reran the focused proof on head df590ad339f50f0ea563178bd9478ded3672e578.

Desktop

Theme Before: changed mid-run, no notice After: notice After: next run uses Workspace
Light Before desktop light After desktop light notice After desktop light next run
Dark Same pre-fix behavior After desktop dark notice After desktop dark next run

Mobile

Theme Before: changed mid-run, no notice After: notice After: next run uses Workspace
Light Before mobile light After mobile light notice After mobile light next run
Dark Same pre-fix behavior After mobile dark notice After mobile dark next run

Full Flow

approval-mode-next-run-flow.mp4

Validation

  • OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/lib/toast.test.ts ui/src/pages/chat/chat-pane-session-controls.test.ts ui/src/lib/session-run-state.test.ts ui/src/pages/chat/components/chat-transcript-invalidation.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/chat/chat-send.test.ts — 563 passed on the rebased head.
  • OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-transcript-disclosure-anchor.e2e.test.ts — 3/3 passed; full-file run passed three consecutive times after the ordering fix.
  • OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/check-changed.mjs — passed, including formatting, typecheck, UI style lint, i18n, dead-export scan, and repository guards.
  • Pre-fix proof: copying the new toast/session-control tests onto main fails the anchored exit assertion and both active-run notice cases for the intended missing behavior. The unrelated current-main model refresh assertion was excluded from that proof.
  • Automated review: codex --dangerously-bypass-approvals-and-sandbox review --base origin/main converged to zero actionable findings after fixing dismissal-reason preservation and capture/update ordering.

Scope

Production: +222/-19 (net +203). Tests: +96/-1 (net +95). The production growth adds the reusable anchored toast presentation/lifecycle and carries exact disclosure geometry through the existing virtualizer owner; no fixture or demo code is included.

The latest ClawSweeper rank-up suggestion to restore a pre-selection picker note is intentionally skipped. The approved product behavior keeps the picker free of persistent explanatory copy and presents the timing boundary only after a successful mid-run change.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 21, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 23, 2026, 12:26 PM ET / 16:26 UTC.

ClawSweeper review

What this changes

The PR adds a Control UI confirmation that a permission change made during an active run applies to the next run, with shared toast and transcript-anchor updates.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open. The Gateway lifecycle boundary is verified, but the prior P2 blocker remains: the picker does not expose the active-run scope before selection, while the notice appears only after saving. A maintainer should confirm the intended interaction contract.

Priority: P3
Reviewed head: df590ad339f50f0ea563178bd9478ded3672e578
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The underlying lifecycle model is sound, but the intended moment for disclosing it remains unresolved.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable because this is MEMBER-authored; the PR body also supplies a described Control UI mock-Gateway flow and visual evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable because this is MEMBER-authored; the PR body also supplies a described Control UI mock-Gateway flow and visual evidence.
Evidence reviewed 7 items Current-main session boundary: The Gateway patch operation only stores or removes the session permission mode.
Current-main admission boundary: A reply run receives permissionMode from the prepared session entry at admission, rather than through a mutation of an active run.
Current-main authorization remains server-owned: Gateway sessions.patch independently rejects full permission mode without operator.admin.
Findings 1 actionable finding [P2] Explain the active-run boundary before a permission is selected
Security None None.

Live Verification

Command: OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/pages/chat/chat-pane-session-controls.test.ts

Result: FAIL (partial) — step 2 expect_output shows the next-run notice only for a running session: expected terminal output was not visible within 30 seconds: "shows the next-run notice only for a running session"

OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/pages/chat/chat-pane-session-controls.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126893-gg4tbb/target$ OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest
.ui.config.ts ui/src/pages/chat/chat-pane-session-controls.test.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126893-gg4tbb/target

OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/pages/chat/chat-pane-session-controls.test.ts
 ✓  ui  ui/src/pages/chat/chat-pane-session-controls.test.ts (10 tests) 122ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  16:27:36
   Duration  3.53s (transform 2.12s, setup 106ms, import 2.22s, tests 122ms, environment 646ms)

runner@runnervm76f27:/tmp/clawsweeper-live-proof-126893-gg4tbb/target$ OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest
.ui.config.ts ui/src/pages/chat/chat-pane-session-controls.test.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126893-gg4tbb/target

 ✓  ui  ui/src/pages/chat/chat-pane-session-controls.test.ts (10 tests) 120ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  16:27:40
   Duration  2.19s (transform 809ms, setup 58ms, import 1.07s, tests 120ms, environment 632ms)

runner@runnervm76f27:/tmp/clawsweeper-live-proof-126893-gg4tbb/target$
























Assertions:

  • FAIL expect_output: shows the next-run notice only for a running session

How this fits together

The Control UI permission picker sends a session update to the Gateway. The Gateway stores that preference, and subsequent run admission copies it into the run’s permission policy without mutating an already admitted run.

flowchart LR
  A[Operator changes permissions] --> B[Control UI picker]
  B --> C[Gateway session update]
  C --> D[Saved session preference]
  D --> E[Next run admission]
  E --> F[Run permission policy]
  G[Active run] --> H[Existing admitted policy]
Loading

Decision needed

Question Recommendation
Should an active-run permission change disclose its next-run-only scope before selection in the opened picker, or is a post-save-only notice the intended product contract? Disclose before selection: Add concise active-run wording to the opened picker and keep the post-save toast as confirmation.

Why: The PR deliberately skips the prior pre-selection recommendation, but the available public record does not establish that post-save-only disclosure is an approved product decision.

Before merge

  • Explain the active-run boundary before a permission is selected (P2) - The changed text is only the trigger’s title; it is absent from the accessible name and opened menu, so keyboard and touch users can select a mode before learning that it cannot affect the active run. The toast arrives only after sessions.patch succeeds. Add concise active-run copy in the opened picker and cover that pre-selection state; this is the remaining P2 from the prior review cycle.
  • Resolve merge risk (P1) - Without an explicit maintainer choice, post-save-only wording still lets an operator select a mode while believing it affects the active run.
  • Complete next step (P2) - A human product choice is required because the remaining fix depends on whether timing guidance must appear before selection.

Findings

  • [P2] Explain the active-run boundary before a permission is selected — ui/src/i18n/locales/en.ts:5715
Agent review details

Security

None.

PR surface

Source +203, Tests +95. Total +298 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 8 222 19 +203
Tests 3 96 1 +95
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 318 20 +298

Review metrics

Metric Value Why it matters
Production versus test delta production +222/-19; tests +96/-1 The small UI clarity feature expands shared toast and transcript behavior, so the selected interaction contract should be explicit before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #126888
Summary: This PR is the candidate implementation for the open Control UI permission-scope request.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Show the next-run boundary inside the opened picker when a run is active, retain the toast as confirmation, and cover the pre-selection keyboard and touch path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Show the next-run boundary inside the opened picker when a run is active, retain the toast as confirmation, and cover the pre-selection keyboard and touch path.

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

Not applicable as a new interaction contract; current main source confirms that permission changes are persisted without a timing notice.

Is this the best way to solve the issue?

No: a post-save toast confirms the result but does not prevent an operator from selecting a mode under an incorrect active-run expectation.

Full review comments:

  • [P2] Explain the active-run boundary before a permission is selected — ui/src/i18n/locales/en.ts:5715
    The changed text is only the trigger’s title; it is absent from the accessible name and opened menu, so keyboard and touch users can select a mode before learning that it cannot affect the active run. The toast arrives only after sessions.patch succeeds. Add concise active-run copy in the opened picker and cover that pre-selection state; this is the remaining P2 from the prior review cycle.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This is a bounded Control UI clarity improvement with limited blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Not applicable because this is MEMBER-authored; the PR body also supplies a described Control UI mock-Gateway flow and visual evidence.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Commit 4b0d573 introduced the session permission-mode feature and its end-to-end contract. (role: introduced session permission modes; confidence: high; commits: 4b0d573437b6; files: ui/src/pages/chat/chat-pane-session-controls.ts, src/gateway/sessions-patch.ts, src/auto-reply/reply/get-reply-run-execute.ts)
  • vyctorbrzezowski: Prior merged work d91b397 changed the shared toast lifecycle that this PR extends. (role: recent shared-toast contributor; confidence: high; commits: d91b3970b47f, df590ad339f5; files: ui/src/lib/toast.ts, ui/src/styles/components.css)

Rank-up moves

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

  • Add active-run scope text to the opened picker with focused keyboard/touch coverage.
  • Or record explicit maintainer approval that post-save-only disclosure is intentional.

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 (6 earlier review cycles)
  • reviewed 2026-08-21T00:10:17.823Z sha 360d86e24b27f0a2f9933a87e0fef0842c73899a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T03:17:32.881Z sha 3f482d0d0c77d96c8cb795532f8a37cfeebeef3f :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T10:23:24.542Z sha 436226f5dc2a282720b99f9877f5c49927cb4776 :: found issues before merge. :: [P2] Keep the scope explanation in the opened picker
  • reviewed 2026-08-22T11:08:59.579Z sha bc58b55bfa0d1ea24497b17dbc4f0459c7dbc6e4 :: found issues before merge. :: [P2] Keep the scope explanation in the opened picker
  • reviewed 2026-08-22T12:20:31.359Z sha 0e118895be9fbca09cc4687bbe80c62c999f5017 :: found issues before merge. :: [P2] Restore an active-run scope note in the picker
  • reviewed 2026-08-23T16:09:14.090Z sha a56947c3724c57fb19d8c0e0599ed9f7fcfa4de8 :: found issues before merge. :: [P2] Explain active-run scope before selection

@vyctorbrzezowski
vyctorbrzezowski force-pushed the fix/approval-mode-mid-run branch from 360d86e to 3f482d0 Compare August 21, 2026 03:08
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 21, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 22, 2026 10:26
@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added 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 rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 22, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the fix/approval-mode-mid-run branch from bc58b55 to 0e11889 Compare August 22, 2026 12:13
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 23, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the fix/approval-mode-mid-run branch from a56947c to df590ad Compare August 23, 2026 16:18
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 23, 2026
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Land-ready verification on head df590ad339f50f0ea563178bd9478ded3672e578:

  • Product decision: keep the permission picker compact and disclose next-run scope after a successful active-run change. The ClawSweeper pre-selection-copy suggestion is intentionally skipped, not silently ignored.
  • Direct Codex contract proof: thread/settings/update permissions apply to subsequent turns (codex-rs/app-server-protocol/src/protocol/v2/thread.rs:223-242); turn/steer has no permission mutation (turn.rs:175-197); the active turn retains its context (core/src/session/turn_input.rs:129-137).
  • Focused UI proof: 568 tests passed across toast, permission, run-state, transcript invalidation, chat view, and chat send owners; disclosure-anchor Chromium E2E passed 3/3.
  • Anti-slop: removing the notice failed both active-run cases while idle remained silent; removing anchored toast lifecycle failed its timeout/exit contract. The disclosure ordering mutant did not fail in five runs, so no deterministic pre-fix reproduction is claimed for that additional closeout path.
  • Desktop/mobile light/dark notice and next-run Workspace screenshots were inspected.
  • node scripts/check-changed.mjs and fresh autoreview passed on a patch-id-identical rebase over current main (c12c643f).
  • Exact-head CI run 32651275660 passed.
  • Native review-validate-artifacts and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 126893 passed using hosted exact-head evidence.

@vyctorbrzezowski
vyctorbrzezowski merged commit b977ccb into openclaw:main Aug 23, 2026
176 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski
vyctorbrzezowski deleted the fix/approval-mode-mid-run branch August 23, 2026 17:09
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 24, 2026
…26893)

* fix(ui): clarify permission changes apply to next run

* fix(ui): show next-run permission toast

* fix(ui): polish permission toast motion

* fix(ui): match permission toast transitions

* fix(ui): preserve global toast dismissal

* fix(ui): stabilize widget disclosure geometry

* fix(ui): preserve disclosure anchor geometry

* fix(ui): preserve toast dismissal reason

* fix(ui): defer disclosure reconciliation
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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.

[Feature]: Clarify Control UI permission mode changes as next-run only

1 participant