Skip to content

fix: apply workspace permission changes to active runs - #132407

Merged
steipete merged 9 commits into
mainfrom
openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to
Aug 31, 2026
Merged

steipete merged 9 commits into
mainfrom
openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to

Conversation

@steipete

@steipete steipete commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Changing workspace security during an active task changed the badge immediately while tools and approval prompts retained the old policy. Users had to manually Stop/Continue.

Closes #131947. Related: #131978 (a parallel whole-run restart proposal with distinct pre-backend setup behavior).

Why This Change Was Made

The operator's policy transition now belongs to the serialized session mutation and exact active-run owner:

  • Native OpenClaw replaces its permission-bound tools, catalog, and prompt within the existing run.
  • Codex confirms interruption of the exact native turn, stops its old-policy background terminals, releases attempt resources, then continues in the same thread with trusted application/developer Permission change context.
  • Old-generation tools and pending approval claims are revoked before refreshed capabilities can be used. A saved policy that cannot be applied produces an error and stops only the captured owner.
  • Control UI shows pending application until runtime acknowledgment and synchronizes other views.

This implements the maintainer-requested automatic transition. It does not fabricate user-authored messages, replay the original request, or undo completed effects. Continuation tells the model to inspect interrupted actions before deciding what remains.

User Impact

Changing the workspace picker (or the same Gateway session-patch path) no longer requires a manual restart: native tasks refresh in place; Codex resumes automatically in the same conversation. Old approvals close without being granted; subsequent actions use the selected policy. Active CLI/whole-agent worker runs reject before saving and retain Stop/change/Continue guidance. Pre-backend setup may temporarily require retrying the change rather than restarting automatically.

No new config option, environment variable, database schema, dependency change, or protocol-version bump. The session row's pending-policy field is transient display state, not persisted authorization.

Evidence

AI-assisted implementation; maintainer-directed behavior.

Current landing status

Published rebased candidate f8070ed74d16ceb27361af3e8bf952e5ed821da9. Exact-head CI run 33346610211 is running. The prior live-tested head a8685cc618df passed CI run 33342374536. The earlier mechanical rebase changed only src/cli/update-cli.test.ts across patch payloads. The subsequent archive-lifecycle integration preserves the new main cleanup contract as detailed below; active permission-runtime code remains unchanged. Four updater flag-restoration/output-order tests, config/CLI test types, targeted lint, diff-check and fresh review pass. Native elevation/tightening and Codex elevation passed automated real browser scenarios on that production-identical head. Codex tightening was manually verified against the actual terminal acknowledgment, rollout, filesystem, tool rejection, and visible final answer; its recorder failed only the omitted closing-phrase check. Four inspected live videos and detailed verification. The operator Gateway is untouched.

  • pnpm build:ci-artifacts passed on dcaa2e6, including runtime packaging, SDK declarations/export validation, and Control UI. After the final behavior-neutral registry deduplication/test-fixture correction, pnpm build sourcePerformance and pnpm ui:build passed on exact head a8685cc. Served UI bytes and native Codex0.151.0 were verified by the recorder. No ineffective dynamic-import warning.
  • Final CI repairs reuse canonical admitted-run authority/owner status instead of duplicate matching helpers (production −26 lines), preserving current-main projections. The unchanged 700-line rule fails at725 on the original CI merge tree and passes at700 on the repaired composition. The fake AgentSession now implements the same pre-loop preparation hook as the real session. All79 authority/projection and61 fixture tests pass; core/test types, type-aware lint, and fresh Autoreview pass.
  • Real native browser testing found that a permission change invalidated prepared memory prompt context. The repair reuses canonical memory/watched-section preparation for the new tool generation and publishes only its current renderer/report.
  • The same preparation now runs after SDK startup hooks, before the first model request, and on retry/compaction continuation. Existing post-turn semantics remain intact. Replaced/disposed startup callbacks cannot reopen the core loop; obsolete async preparation cannot hang or fail a newer policy generation.
  • Negative controls reproduce the full-prompt mismatch, obsolete rejection, and a first model request carrying the old prompt/write-tool surface. Repaired boundary proof: 53 tests across four owner/sibling files; another 15-case rerun after a mechanical lint cleanup. Core and affected test types, type-aware lint, and import-cycle checks pass (zero runtime value cycles).
  • Fresh Autoreview of the full async repair is scoped-clean at the repository's configured P0 threshold. Independent lifecycle findings were repaired and covered above; the final loop snapshot/exit reshape is behavior-neutral.
  • Prior broader proof: 556 focused tests across 11 files, 1,380 owner/sibling tests across 44 files, 102 before-tool integration cases, and 17 corrected rebase-fixture cases. Some earlier batches overlapped a build, so exact-head CI and fresh live execution own compiled-runtime proof. All remaining lint, architecture, and Swift protocol checks passed on dee70ae.
  • Stale Code Mode cancellation assertions require the exact authoritative abort reason. The browser collection deadlock was repaired at the OS fixture producer; the formerly stalled 19-case browser suite passed. No production timeout or safety check was weakened.
  • With explicit maintainer approval, both Opengrep workflows adapt only GitHub's upload payload. Raw SARIF artifacts and scanner exit behavior are unchanged; accepted source suppressions produce an unsuppressible count notice, while active/rejected/mixed/external/unknown decisions remain visible. Workflow red/green tests and real Opengrep 1.27.1 positive/negative controls pass. Both hosted scanner checks passed on the earlier heads.
  • Current-main integration preserves asynchronous preparation, Code Mode recovery, staged media, compaction settlement, default-permission labels, and question/Web Push cleanup. Superseded cleanup extraction and duplicate approval tests were removed.

Live permission-flow proof is complete; exact-head CI after archive-lifecycle integration is pending. The latest main conflict preserved worker reclaim outside mutation locks, drain handoff/finalization, and exactly-once permission cleanup. All104 focused lifecycle/permission/harness/UI tests, targeted lint, and fresh full-PR review pass. The first lint prerequisite failed its topology-stability guard; an isolated unchanged-source retry passed. The CI-reported label assertions now use canonical translated mode labels, and the host-capability tests share revocation cases without dropping coverage. All 67 focused cases (43 harness, 23 UI, one real-browser E2E), targeted type-aware lint, and fresh review pass. This correction changes no production files. The explicit Codex recorder limitation above remains recorded, not recast as a passing test.

Recovered implementation proof

The original candidate had a successful full build, 1,242 broad permission tests, 263 final owner-split tests, 114 Code Mode cancellation/reconciliation tests, type/lint/SDK/protocol checks, and real isolated native/Codex browser flows. Those historical results do not stand in for the rebased head below.

Rebase and review repairs

  • Preserved current-main model-scoped Code Mode, canonical runtime prompt/tool context, safe parked-wait recovery, host-file rollback, remote patch aliases, and explicit Codex cancellation teardown.
  • Addressed ClawSweeper's cancellation finding by using the existing state.abortCleanup owner for both explicit stop and permission replacement. Restart confirmation occurs only after terminal teardown. Removed the parallel permission-stop waiter.
  • Reproduced missing terminal cleanup (four failures), stale host write/edit/apply_patch mutation (three failures), and inherited service identity in isolated tests (two failures) before repairing each owner.
  • Fixed the macOS test harness's inherited launchd/service identity at its shared environment producer. No production service guard or operator Gateway was changed. The earlier macOS suffix failed 83 tests from this leak; it was not a pass.
  • Two existing startup timing assertions reproduced on the loaded host; replaced them with explicit fixture startup events, without larger timeouts or weaker assertions.
  • Repaired candidate 118b6c223b314c4bc5d70dabff78ad48a91f0679: 225 supervisor/test-environment/launchd/file-write tests and all 401 Codex cancellation, terminal-cleanup, steering, approval, elicitation, and lifecycle tests passed. Core production types passed. Fresh full-diff Autoreview is clean at the repository's default P0 threshold.
  • Remaining native/Gateway/UI regressions: 899 tests across 29 files passed. Full committed-head build passed (8m12s), including UI; no ineffective dynamic-import warnings. Swift protocol generation check passed. Static gates, new live recordings, and exact-head CI are running before landing.

Dependency contract and solution quality

Lead personally inspected sibling Codex source, including current pinned rust-v0.151.0 exact-turn interrupt acknowledgment (codex-rs/app-server/src/request_processors/turn_processor.rs:1590), application-context developer mapping (codex-rs/core/src/state/additional_context.rs:16), and separate thread-terminal lifetime. Current codex-rs/app-server-protocol/src/protocol/v2/turn.rs:47 excludes sandbox/approval from live settings; turn/start carries both. No Codex dependency modification.

Architectural owners: serialized session mutation, admitted-run permission coordinator, generation-bound tool/approval lifecycle, and Codex native-turn cleanup. Reuses canonical constructors and authority boundaries. Keeping next-run-only behavior misses the requested outcome; restarting every harness interrupts native work unnecessarily.

Production/tooling LOC: +2,365/−967 (net +1,398); tests/support: +2,644/−444; docs/generated: +15/−0. Growth implements the explicitly requested live-transition capability, generation revocation/acknowledgment, and prepared-context startup boundary. Canonical constructors preserve policy/metadata ownership; a downstream flag or whole-run restart does not provide the requested native behavior. Test-support moves are not production growth.

Separate follow-ups

  • Codex retains its existing read-only/on-request tuple: new native file-write approvals may still be requested; in the recorded tightening flow the request expired/rejected and no file was written. Approval-policy/label parity needs a separate product decision; this PR changes policy application timing, not the selected tuple.

  • The direct /codex permissions command remains persistence-only. Routing it into live mutation needs an invocation-bound plugin SDK capability preserving the exact caller/lifecycle authority; this PR does not synthesize a privileged Gateway caller. The requested Control UI/session-patch flow is covered here.

  • Live/durable commentary reconciliation can display duplicate progress text; earlier transcript and side-effect counters prove this is not command replay. Preserve exact item identity in a separate repair.

  • Bind optional diagnostic before-tool audit receipts to permission-generation lifetime. Action/grant enforcement is fenced; a cancellation-ignoring hook may still emit an obsolete diagnostic receipt.

  • The related whole-run proposal has a distinct setup-time restart UX; it is not being closed as fully equivalent.

All live proof uses an isolated development Gateway. The operator's running Gateway is untouched.

Final landing head — f8070ed

Exact-head CI run 33346610211 completed successfully, including Node shards and iOS build/screenshots; no pending or failed checks remain. The latest main archive-lifecycle integration passed 104 focused permission/lifecycle/harness/UI tests, targeted type-aware lint, and fresh full-PR Autoreview. It preserves main's worker cleanup outside mutation locks while keeping permission application serialized and finishing each permission change once. The four inspected videos and the disclosed Codex tightening recorder limitation above remain applicable. Current GitHub rules require the passing CI gate and no independent approval.

@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: XL maintainer Maintainer-authored PR labels Aug 29, 2026
@steipete steipete self-assigned this Aug 29, 2026
@steipete
steipete marked this pull request as ready for review August 29, 2026 05:41
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 29, 2026, 1:51 AM ET / 05:51 UTC.

ClawSweeper review

What this changes

The PR applies session permission changes to active runs by interrupting and restarting the exact turn under the selected permission mode, with pending state in Control UI.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open: the new shared abort path removes current-main’s explicit-cancellation teardown, so cancelling a Codex turn can leave its native background terminals running.

Priority: P1
Reviewed head: c3e12174e25fce6381a6fc9e982b5692b16bb312

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The supplied restart evidence is useful, but a concrete cancellation-cleanup regression prevents a higher rating.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer-associated PR includes claimed UI and focused-runtime evidence, but the reviewer could not independently inspect the required sibling Codex runtime contract; no contributor action is requested for that environment limitation.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-associated PR includes claimed UI and focused-runtime evidence, but the reviewer could not independently inspect the required sibling Codex runtime contract; no contributor action is requested for that environment limitation.
Evidence reviewed 5 items Introduced abort-path regression: The PR replaces the explicit-cancellation branch with a shared interrupt completion path that only records permission restart confirmation and completes the turn.
Current-main cancellation contract: Before this PR, explicit cancellation awaited a confirmed interrupt and terminated the thread’s background terminals before completing the turn.
Terminal-cleanup behavior: The removed helper lists each background terminal for the cancelled thread, terminates it, then verifies no terminal remains.
Findings 1 actionable finding [P1] Preserve terminal cleanup for explicit cancellation
Security Needs attention Explicit cancellation no longer tears down native terminals: The introduced shared abort path deletes the explicit-cancellation call that stops background terminals, allowing processes associated with a cancelled Codex thread to continue running.

How this fits together

Control UI patches session permissions through the Gateway, which coordinates an active embedded run and refreshes its visible state. The Codex app-server runtime owns the native thread and its background-terminal lifecycle.

flowchart LR
  UI[Control UI permission picker] --> Gateway[Gateway session patch]
  Gateway --> Coordinator[Active-run permission coordinator]
  Coordinator --> Run[Embedded active run]
  Run --> Codex[Codex app-server turn]
  Codex --> Terminals[Native background terminals]
  Run --> State[Updated session state]
Loading

Before merge

  • Preserve terminal cleanup for explicit cancellation (P1) - This replacement handles every non-timeout abort identically. Before this PR, an explicit cancel waited for the exact turn to stop and then called terminateCodexBackgroundTerminals; that branch is deleted here. A user cancel can therefore leave the native thread’s background terminal processes running after OpenClaw reports the turn complete. Keep that cleanup for terminalState.explicitCancellationObserved, while letting the permission-change path retain its thread.
  • Resolve security concern: Explicit cancellation no longer tears down native terminals - The introduced shared abort path deletes the explicit-cancellation call that stops background terminals, allowing processes associated with a cancelled Codex thread to continue running.
  • Resolve merge risk (P1) - Explicit cancellation can leave native background terminal processes running after the controlling turn completes.
  • Resolve merge risk (P1) - The required sibling Codex checkout is unavailable, so the Codex app-server contract could not be independently inspected beyond OpenClaw’s existing cleanup implementation.
  • Complete next step (P2) - Restore the removed explicit-cancellation cleanup and add a bounded regression test before the permission-change lifecycle can merge.

Findings

  • [P1] Preserve terminal cleanup for explicit cancellation — extensions/codex/src/app-server/run-attempt-active-turn.ts:415-421
  • [high] Explicit cancellation no longer tears down native terminals — extensions/codex/src/app-server/run-attempt-active-turn.ts:415
Agent review details

Security

Needs attention: The changed cancellation path can leave native terminal processes alive after the turn’s authority is explicitly revoked.

Review metrics

Metric Value Why it matters
Production versus test delta production +2,093/-864; tests/support +2,112/-667 This large bug-fix change replaces cancellation lifecycle behavior, so the repair should absorb the regression without additional production growth.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/agents/code-mode.ts, serialized state: packages/gateway-protocol/src/schema/sessions-row.ts, serialized state: src/agents/agent-tools.read.ts, serialized state: src/agents/apply-patch-file-ops.ts, serialized state: src/agents/apply-patch.test-support.ts, serialized state: src/agents/sessions/agent-session-extensions.ts, and 12 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #131947
Summary: This PR is a candidate implementation for the active-turn permission-change issue, but its new abort path also regresses explicit Codex cancellation cleanup.

Members:

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

Merge-risk options

Maintainer options:

  1. Restore explicit-cancel cleanup (recommended)
    Preserve terminal teardown after a user cancellation while retaining the new permission-change restart path, with focused coverage for both outcomes.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Restore the explicit-cancellation terminal teardown while preserving the permission-change restart path, then add focused coverage for both outcomes.

Technical review

Best possible solution:

Retain current-main’s terminal teardown for explicit cancellation and scope retained-thread behavior only to permission-change restarts.

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

Yes—on this branch, start a Codex native background terminal and explicitly cancel the turn; source shows that the current-main terminal-cleanup call is no longer reached.

Is this the best way to solve the issue?

No—the shared non-timeout abort branch is too broad; explicit cancellation must retain terminal teardown while permission changes retain the thread.

Full review comments:

  • [P1] Preserve terminal cleanup for explicit cancellation — extensions/codex/src/app-server/run-attempt-active-turn.ts:415-421
    This replacement handles every non-timeout abort identically. Before this PR, an explicit cancel waited for the exact turn to stop and then called terminateCodexBackgroundTerminals; that branch is deleted here. A user cancel can therefore leave the native thread’s background terminal processes running after OpenClaw reports the turn complete. Keep that cleanup for terminalState.explicitCancellationObserved, while letting the permission-change path retain its thread.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label changes:

  • add P1: The introduced regression can leave native terminal processes active after a user explicitly ends a Codex turn.
  • add merge-risk: 🚨 security-boundary: Explicit cancellation no longer reaches the existing teardown for background terminals associated with the cancelled thread.
  • add merge-risk: 🚨 availability: Unterminated native terminal processes can continue consuming local resources after a turn is cancelled.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-associated PR includes claimed UI and focused-runtime evidence, but the reviewer could not independently inspect the required sibling Codex runtime contract; no contributor action is requested for that environment limitation.

Label justifications:

  • P1: The introduced regression can leave native terminal processes active after a user explicitly ends a Codex turn.
  • merge-risk: 🚨 security-boundary: Explicit cancellation no longer reaches the existing teardown for background terminals associated with the cancelled thread.
  • merge-risk: 🚨 availability: Unterminated native terminal processes can continue consuming local resources after a turn is cancelled.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-associated PR includes claimed UI and focused-runtime evidence, but the reviewer could not independently inspect the required sibling Codex runtime contract; no contributor action is requested for that environment limitation.

Evidence

Security concerns:

  • [high] Explicit cancellation no longer tears down native terminals — extensions/codex/src/app-server/run-attempt-active-turn.ts:415
    The introduced shared abort path deletes the explicit-cancellation call that stops background terminals, allowing processes associated with a cancelled Codex thread to continue running.
    Confidence: 0.95

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs extensions/codex/src/app-server.
  • [P1] node scripts/run-vitest.mjs src/gateway/server-methods/sessions-restart-turn.test.ts.

What I checked:

Likely related people:

  • steipete: Recent current-main cleanup and the reviewed active-turn change both touch this runtime. (role: recent Codex runtime contributor; confidence: high; commits: bff882d7152f, c3e12174e25f; files: extensions/codex/src/app-server/run-attempt-active-turn.ts, extensions/codex/src/app-server/attempt-client-cleanup.ts)

Rank-up moves

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

  • Restore explicit-cancel terminal teardown while retaining the permission-change restart path.
  • Add focused coverage proving explicit cancellation kills a background terminal and permission change retains or reuses its thread.

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
steipete force-pushed the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch from c3e1217 to 118b6c2 Compare August 29, 2026 07:30
@steipete
steipete force-pushed the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch from 118b6c2 to 2697bd3 Compare August 30, 2026 02:37
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations labels Aug 30, 2026
@steipete
steipete force-pushed the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch from 2697bd3 to dbfc0ec Compare August 30, 2026 02:41
@steipete
steipete force-pushed the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch from dbfc0ec to b48b3d0 Compare August 30, 2026 20:25
@steipete
steipete requested a review from a team as a code owner August 30, 2026 20:25
@openclaw-barnacle openclaw-barnacle Bot added security Security documentation scripts Repository scripts labels Aug 30, 2026
@steipete

steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Landing verification — a8685cc618df61a356f6726319c85967dcd183b1

Exact-head CI run33342374536 is green. Fresh Autoreview, final types/lint and140 focused authority/fixture tests pass. Final runtime/UI builds: pnpm build sourcePerformance, pnpm ui:build; full packaging/SDK build pnpm build:ci-artifacts passed before the final behavior-neutral registry/test-fixture correction.

Live isolated Gateway, real providers, actual Control UI:

  • Native elevation: old approval disappears without being granted; command effect exactly once; same outer run.
  • Native tightening: same run, earlier file preserved, later file absent.
  • Codex elevation: same thread, new native turn, trusted developer “Permission change” message; workspace-write/on-request → danger-full-access/never; command effect exactly once.
  • Codex tightening: both old native terminal PIDs were gone synchronously at the permission-patch acknowledgment; same thread/new read-only turn; earlier file preserved, later write rejected and file absent. The recorder exited1 waiting for a closing phrase the model omitted. That failure is preserved; manual verification independently inspected terminal-final events, filesystem, native rollout, tool rejection, and screenshots. It is not reported as an automated pass.

Codex's existing read-only/on-request mapping remains unchanged: a new file-write approval appears and expires/rejects in the tightening recording. This is not stale Full-access authority; approval-policy/label parity is a separate product follow-up.

ClawSweeper finding and both rank-up moves addressed: restored the canonical state.abortCleanup terminal teardown for explicit cancellation and permission replacement, with bounded cancellation regressions. Permission restart retains the thread, not its old-policy terminals. Lead personally inspected pinned Codex0.151.0: exact-turn interrupt in codex-rs/app-server/src/request_processors/turn_processor.rs:1590; terminal list/terminate in thread_processor.rs:2376/2407; application-to-developer mapping in codex-rs/core/src/state/additional_context.rs:16.

All videos below were authentication-trimmed and personally inspected. No operator Gateway/config was changed. Separate follow-ups: direct /codex permissions needs an invocation-bound live-mutation SDK seam; duplicate progress presentation; optional diagnostic receipt generation binding.

Native elevation
https://github.com/user-attachments/assets/4d96f2af-311f-422a-bc40-cf1e4493f1f5

Native tightening
https://github.com/user-attachments/assets/e9ffec90-3d30-4805-ae4d-8664110507fa

Codex elevation
https://github.com/user-attachments/assets/54e61350-9a6d-4a40-be36-b8b067fe3bc4

Codex tightening (recorded/manual proof, phrase-check failure disclosed above)
https://github.com/user-attachments/assets/04cc9636-684c-4e2e-bee1-2794f5d8fb7b

@clawsweeper re-review

Final landing head — f8070ed

Exact-head CI run 33346610211 completed successfully, including Node shards and iOS build/screenshots; no pending or failed checks remain. The latest main archive-lifecycle integration passed 104 focused permission/lifecycle/harness/UI tests, targeted type-aware lint, and fresh full-PR Autoreview. It preserves main's worker cleanup outside mutation locks while keeping permission application serialized and finishing each permission change once. The four inspected videos and the disclosed Codex tightening recorder limitation above remain applicable. Current GitHub rules require the passing CI gate and no independent approval.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch from a8685cc to bb8ea93 Compare August 31, 2026 00:43
@steipete
steipete force-pushed the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch 2 times, most recently from 37de9f5 to f8070ed Compare August 31, 2026 01:07
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 67433ff into main Aug 31, 2026
272 checks passed
@steipete
steipete deleted the openclaw/when-i-switch-the-workspace-security-setting-it-doesn-t-seem-to branch August 31, 2026 01:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
* fix: apply workspace permission changes to active runs

* fix: preserve permission lifecycle invariants and hermetic tests

* test: remove obsolete updater fixture argument

* fix: repair permission-change CI and scanner reporting

* refactor: trim run-loop aliases and validate scanner fixture paths

* fix: prepare permission-bound prompt sections before model continuation

* fix: fence permission prompt preparation across startup and replacement

* fix: align permission fixtures and deduplicate run authority checks

* test: keep permission checks aligned with shared labels and revocation cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security Security documentation 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.

Control UI permission changes do not restart the active turn

2 participants