Skip to content

fix(gateway): keep rootless sessions usable after permission changes - #128149

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-128039-rootless-session-permission
Aug 26, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-128039-rootless-session-permission

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #128039

Summary

  • Enforce one persisted session invariant: a non-default permission mode requires a canonical session root.
  • Apply that invariant at the two authoritative persistence owners: the shared session patch/create projector and reset lifecycle commit.
  • Reject impossible reset requests before interrupting admitted work, running hooks, cleanup, or writing state.
  • Surface Gateway rejection text in the Control UI's rendered error state.
  • Preserve current main authorization checks, active-run behavior, and contributor credit.

What Problem This Solves

The public sessions.patch path could store permissionMode without sessionRoot. Later agent setup rejected that tuple before model execution. A fallback model/auth error could then obscure the primary session-state failure.

The reset lifecycle is a second persistence owner, so fixing only the shared patch projector was incomplete. It could also preserve or request a rootless non-default mode, and the earlier PR revision validated after active work had already been interrupted.

Canonical behavior

  • Rootless full, guarded, or workspace requests return INVALID_REQUEST with: permission mode requires a session root; choose Default or a rooted session.
  • Rejection is side-effect free: no row write, hook, cleanup, or active-work interruption.
  • permissionMode: null remains the recovery path for a legacy invalid row and does not require transcript deletion.
  • Rooted creation and reset continue to persist the selected mode.
  • Upgrades do not silently rewrite legacy rows. Validation occurs when the tuple is mutated or reset, avoiding an automatic permission-policy change during update.

Review findings resolved

  • P1 active-run interruption: validation now happens before admission interruption whenever lifecycle preparation cannot establish a root. A regression installs a real admission and proves its interrupt callback is not invoked.
  • Persisted legacy tuple: reset validates the effective mode (requested ?? persisted), preventing a legacy rootless override from being re-committed unchanged.
  • Security/rebase risk: the branch was rebuilt from current canonical main; authenticated missing-session creation checks remain intact.
  • Dirty branch: final head is mergeable and contains current canonical main.

Evidence

Final head: d5d72cd276f5a16bcc461be018ef5168fd3cdbca
Canonical base: c841a9958abc8344b37ce5c6c5a06bec4cfa6b91

  • Final-head focused Gateway suite: 9 passed, 203 skipped by the permission filter.
  • Targeted lint/format and git diff --check: passed.
  • Autoreview: clean, no actionable findings, 0.97 correctness confidence; secret scan clean.
  • Production diff: +69/-15 across five files. Regression coverage: +197 lines across three test files.

Blacksmith Testbox tbx_01m0xvmycd6p161xnqgpwyyb41 (stopped after proof), using official Crabbox v0.46.0:

The Testbox proof ran on the identical patch tree at 4bf8e72b9265ea93755630eb4a867aa01bc6816a. Canonical main then added three commits. Only restart/session-lifecycle recovery was adjacent; it did not touch the permission persistence owners. After rebasing, the full focused Gateway permission suite, including the active-admission case, passed again at final head d5d72cd276f.

Source-blind runtime contract

An isolated real Gateway and the public openclaw gateway call CLI exercised the final patch tree:

reject_status=1 reject_has_canonical_error=1 before_count=0
default_ok=true default_has_mode=false after_count=1 after_has_mode=false
contract=PASS clauses=rootless_rejected,no_write_on_reject,default_recovers,no_mode_persisted

Anti-cheat probes repeated the rejection with both full and workspace, reopened state through sessions.list, and verified Default performed a real write without a permission override.

Original contributor evidence

The contributor's earlier exact-head browser proof remains useful visual confirmation of the same user-facing contract:

Those recordings were captured at the superseded b728365abab7 head. Current-head correctness is established by the tests, builds, lifecycle regression, and black-box Gateway/CLI state proof above.

Scope

No protocol, configuration, database schema/version, migration, provider, channel, dependency, or permission-default change.

@clawsweeper

clawsweeper Bot commented Aug 23, 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 gateway Gateway runtime size: S labels Aug 23, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 26, 2026, 12:02 AM ET / 04:02 UTC.

ClawSweeper review

What this changes

The PR prevents rootless sessions from persisting non-default permission modes and surfaces the Gateway validation error in the Control UI.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

The source repair covers the documented patch, create, and reset persistence owners, but the current head moved after the recorded proof and this checkout cannot read the exact current-main objects.

Priority: P1
Reviewed head: a8b71aa61d086fe0a3cf30d7897398de6de8d6c6

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and well-covered in source, but its current head lacks demonstrably exact-head real-behavior proof.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The PR has strong Gateway/CLI output and visual evidence for d5d72cd276f, but the current head is a8b71aa61d; add a redacted exact-head transcript or recording, then a PR-body update should trigger fresh review automatically (or ask a maintainer for @clawsweeper re-review). After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR has strong Gateway/CLI output and visual evidence for d5d72cd276f, but the current head is a8b71aa61d; add a redacted exact-head transcript or recording, then a PR-body update should trigger fresh review automatically (or ask a maintainer for @clawsweeper re-review). After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Patch persistence owner: The shared patch projector applies the root/mode invariant before returning the entry, so a rejected patch is not persisted.
Runtime failure boundary: Agent setup rejects a permission mode without a session root, establishing the pre-fix invalid-state consequence.
Reset lifecycle owner: Reset validates the effective permission/root tuple before draining admitted work when lifecycle preparation cannot create a root, and validates the prepared root before commit otherwise.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

$ node scripts/run-node.mjs --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 122.49 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 13.4s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4995ms (slowest: built plugin control-plane loads 3030ms)

OpenClaw 2026.8.1 (a8b71aa) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)
  --no-color           Disable ANSI colors
  --profile ‹name›     Use a named profile (iso
… output truncated …

Assertions:

  • PASS expect_output: Usage:

How this fits together

The Control UI sends permission selections to Gateway session persistence, and later agent runs consume that stored session state. The persistence boundary must reject permission modes that require a session root when no root exists.

flowchart LR
  A[Operator selects permission] --> B[Control UI request]
  B --> C[Gateway patch or reset]
  C --> D{Session root exists?}
  D -->|No| E[Visible validation error]
  D -->|Yes| F[Persist session mode]
  F --> G[Agent run]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR has strong Gateway/CLI output and visual evidence for d5d72cd276f, but the current head is a8b71aa61d; add a redacted exact-head transcript or recording, then a PR-body update should trigger fresh review automatically (or ask a maintainer for @clawsweeper re-review). After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR body and recorded proof identify d5d72cd276f, while the current head is a8b71aa61d; the checkout cannot compare those commits to establish whether the later pushes changed behavior.
  • Resolve merge risk (P1) - Production growth is +69/-15 for a bug fix; the shared policy helper and reset guards appear necessary to cover the distinct persistence owners, but the exact-head validation still needs refresh.
  • Complete next step (P2) - No code repair is indicated; the remaining blocker is exact-head proof and current-main/CI confirmation.
Agent review details

Security

None.

PR surface

Source +54, Tests +197. Total +251 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 69 15 +54
Tests 3 197 0 +197
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 266 15 +251

Review metrics

Metric Value Why it matters
Production vs test delta production +69/-15; tests +197/-0 The patch adds a shared session invariant and reset-lifecycle guard with focused regression coverage.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/session-create-service.ts, serialized state: src/gateway/session-permission-policy.ts, serialized state: src/gateway/session-reset-service.ts, serialized state: src/gateway/sessions-patch.test.ts, serialized state: src/gateway/sessions-patch.ts, unknown-data-model-change: src/gateway/session-reset-service.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128039
Summary: This PR is the candidate repair for the documented rootless-session permission-state bug.

Members:

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

Merge-risk options

Maintainer options:

  1. Refresh final-head proof (recommended)
    Compare the current head with the proven head and rerun the focused Gateway/CLI recovery contract if behavior changed.

Technical review

Best possible solution:

Retain one shared root/mode policy at the patch projector and reset lifecycle, then establish that the current head preserves the visible Default recovery path.

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

Yes: the patch owner can persist the tuple, while agent setup rejects a stored permission mode without a root; focused tests cover patch, create, reset, and recovery.

Is this the best way to solve the issue?

Yes, provisionally: shared validation at the patch projector plus reset lifecycle covers the actual persistence owners without adding public configuration.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR has strong Gateway/CLI output and visual evidence for d5d72cd276f, but the current head is a8b71aa61d; add a redacted exact-head transcript or recording, then a PR-body update should trigger fresh review automatically (or ask a maintainer for @clawsweeper re-review). After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P1: An invalid persisted session tuple can block later agent turns until an operator recovers it.
  • merge-risk: 🚨 compatibility: Existing rootless sessions carrying a non-default override will be rejected on a future mutation or reset.
  • merge-risk: 🚨 session-state: The patch changes which permission-mode and session-root combinations may be persisted.
  • merge-risk: 🚨 security-boundary: Permission modes constrain execution authority, so stored-state validation must preserve the existing authorization path.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR has strong Gateway/CLI output and visual evidence for d5d72cd276f, but the current head is a8b71aa61d; add a redacted exact-head transcript or recording, then a PR-body update should trigger fresh review automatically (or ask a maintainer for @clawsweeper re-review). After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Introduced session permission modes and has extensive recent history in the Gateway session persistence and lifecycle paths. (role: feature owner; confidence: high; commits: 4b0d573437b6, 3caf21bdd4c3; files: src/gateway/sessions-patch.ts, src/gateway/session-create-service.ts, src/gateway/session-reset-service.ts)

Rank-up moves

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

  • Post redacted Gateway/CLI or browser proof from a8b71aa61d showing rejection and Default recovery.
  • Complete and inspect exact-head CI before merge.

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-23T11:55:08.067Z sha b196a4cf4a831fab971fab694d1cc85529ee244d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-23T13:45:47.139Z sha 03628b75211401e76202787ec1c3221f634d960e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-23T14:36:07.928Z sha 69498dfd0fd03187dfb3a89068c042c65a5cfcb4 :: needs changes before merge. :: [P1] Guard the main-session reset creation branch
  • reviewed 2026-08-23T18:05:27.270Z sha a8c4171fb779887b14717505085c9da474719fe6 :: needs changes before merge. :: [P1] Preserve the active-run permission notice when rebasing
  • reviewed 2026-08-23T18:47:17.651Z sha a8c4171fb779887b14717505085c9da474719fe6 :: needs changes before merge. :: [P1] Preserve the active-run permission notice when rebasing
  • reviewed 2026-08-23T19:39:00.074Z sha b728365abab70e5e5165fb7241a992a76e38ac80 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T23:43:47.580Z sha b728365abab70e5e5165fb7241a992a76e38ac80 :: found issues before merge. :: [P1] Validate rootless resets before interrupting active work
  • reviewed 2026-08-26T02:11:59.582Z sha d5d72cd276f5a16bcc461be018ef5168fd3cdbca :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 23, 2026
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 23, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 23, 2026
@zhangguiping-xydt
zhangguiping-xydt force-pushed the fix/issue-128039-rootless-session-permission branch from b196a4c to 03628b7 Compare August 23, 2026 13:38
@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. 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 23, 2026
@zhangguiping-xydt
zhangguiping-xydt force-pushed the fix/issue-128039-rootless-session-permission branch from 03628b7 to 69498df Compare August 23, 2026 14:28
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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. labels Aug 23, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 23, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Aug 25, 2026
@fuller-stack-dev
fuller-stack-dev force-pushed the fix/issue-128039-rootless-session-permission branch from b728365 to d5d72cd Compare August 26, 2026 02:04
@fuller-stack-dev

Copy link
Copy Markdown
Member

Addressed the reviewed P1 and rebase/security concerns at d5d72cd276f.

  • Rootless reset validation now runs before active-work interruption whenever lifecycle preparation cannot provide a root.
  • A real admission regression proves the interrupt callback is not invoked.
  • Reset also validates persisted legacy modes, not only newly requested modes.
  • The branch is rebuilt on current canonical main with missing-session authorization intact.
  • Final-head focused Gateway tests pass 9/9; hydrated Testbox check:changed, UI tests/build, runtime build, and black-box persistence proof are recorded in the PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 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.

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 26, 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. and removed 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. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. labels Aug 26, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member

Exact-head CI/review receipt for d5d72cd276f:

  • 280 checks completed successfully or were intentionally skipped.
  • No changed-surface check failed.
  • check-lint failed only in untouched scripts/github/release-validation-campaign.d.mts.
  • check-test-types failed only in untouched extensions/qa-lab fixtures missing providerReadinessArtifactPath.
  • openclaw/ci-gate is the aggregate of those two failures.
  • The earlier PR-context failure used the pre-edit webhook payload; the fresh body-triggered run passed: https://github.com/openclaw/openclaw/actions/runs/32921426679
  • ClawSweeper’s exact-head review found no actionable or security findings and marked the PR ready for maintainer review.

The failing paths are byte-identical to canonical base c841a9958ab; no patch change is warranted for those baseline failures.

@fuller-stack-dev
fuller-stack-dev force-pushed the fix/issue-128039-rootless-session-permission branch from d5d72cd to 23c4721 Compare August 26, 2026 03:38
@fuller-stack-dev
fuller-stack-dev force-pushed the fix/issue-128039-rootless-session-permission branch from 23c4721 to a8b71aa Compare August 26, 2026 03:55
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 26, 2026
@fuller-stack-dev
fuller-stack-dev merged commit ceb074e into openclaw:main Aug 26, 2026
270 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (24 commits)
  fix(gateway): reject rootless session permission modes (#128149)
  docs(memory): document shipped turn-taint propagation for network tool output (#129837)
  fix(ui): pool reply-less wake activity into one chat rollup (#128442)
  fix(package): prevent installs from deleting validated runtime assets (#129724)
  fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795)
  fix(backup): preserve configured agent state roots (#129773)
  fix(ui): own chat history issuance with a closed state machine (#129776)
  fix(cron): preserve cancellation reason after late finalization (#129331)
  fix(cron): prevent run waits from failing after clock changes (#129805)
  fix(telegram): route commentary through one frozen progress owner (#128259)
  fix(release): start approved VCR mirror recovery jobs (#129829)
  test: complete current-plugin-metadata-snapshot mock factories (#129791)
  test(telegram): remove duplicate reaction case (#129848)
  fix(channels): honor supported account reply-threading policies (#129679)
  refactor(cli): deduplicate lazy subcommand registration (#129351)
  fix(ai): report interrupted local-model streams instead of empty success (#129794)
  refactor(cli): consolidate Gateway fallback and hook ownership (#129802)
  fix(qa): reject token confidence lanes without executed evidence (#129830)
  fix(tui): fence session state and delayed actions (#129810)
  fix(control-ui): keep task progress full width on hover (#129832)
  ...
steipete added a commit that referenced this pull request Aug 26, 2026
…e default root

Session permission modes hard-required a recorded sessionRoot, which only the
sessions.create RPC ever records. Channel sessions, pre-#124909 rows, and
exec-node sessions are rootless, so runs failed closed with 'session permission
mode requires a recorded session root' (rows poisoned before the #128149 guards
were permanently bricked) and operators could not set a mode on channel
sessions at all.

The mode semantics are root-free; every containment consumer already falls
back to the workspace, and the remote worker launcher already derives its
containment root from placement.remoteWorkspaceDir. Make that the canonical
rule: a recorded sessionRoot pins worktree/explicit-cwd boundaries, and a
rootless session's boundary is the agent's canonical workspace resolved where
the run is prepared.

- embedded runner + compaction: default policy root to realpath(workspace)
  instead of throwing/dropping the mode; bricked rows self-heal
- gateway: delete the patch/create/reset rejection guards and
  session-permission-policy.ts entirely
- codex plugin: helpers take a required defaultRoot (agent workspace fact,
  never a requested thread cwd); delete the four root throws; sandbox context
  for conversation bindings now derives from the agent workspace
- ui: drop the rootless-rejection surface from the permission picker
- docs: permission-modes boundary contract updated
steipete added a commit that referenced this pull request Aug 26, 2026
…e default root (#129994)

* fix(gateway): permission modes work on rootless sessions via workspace default root

Session permission modes hard-required a recorded sessionRoot, which only the
sessions.create RPC ever records. Channel sessions, pre-#124909 rows, and
exec-node sessions are rootless, so runs failed closed with 'session permission
mode requires a recorded session root' (rows poisoned before the #128149 guards
were permanently bricked) and operators could not set a mode on channel
sessions at all.

The mode semantics are root-free; every containment consumer already falls
back to the workspace, and the remote worker launcher already derives its
containment root from placement.remoteWorkspaceDir. Make that the canonical
rule: a recorded sessionRoot pins worktree/explicit-cwd boundaries, and a
rootless session's boundary is the agent's canonical workspace resolved where
the run is prepared.

- embedded runner + compaction: default policy root to realpath(workspace)
  instead of throwing/dropping the mode; bricked rows self-heal
- gateway: delete the patch/create/reset rejection guards and
  session-permission-policy.ts entirely
- codex plugin: helpers take a required defaultRoot (agent workspace fact,
  never a requested thread cwd); delete the four root throws; sandbox context
  for conversation bindings now derives from the agent workspace
- ui: drop the rootless-rejection surface from the permission picker
- docs: permission-modes boundary contract updated

* fix(agents): split workspace path identity out of the kysely state store

Heals main: #116650 made memory-host-sdk/dreaming.ts import
resolveWorkspaceStateIdentity from workspace-state-store, statically pulling
kysely into the memory-core doctor-contract closure and failing the
doctor-contract-closure-guard lane on origin/main. The identity helpers are
pure path/crypto code; move them to workspace-state-identity.ts and repoint
all importers (dreaming, event-store, onboarding recommendations, workspace
migrations, legacy state).

* fix(ui): drop the unused permission picker sessionRoot prop and dead i18n keys

check-prod-types caught the New Session dialog still passing the removed
sessionRoot picker prop; the prop and the permissionControls.rootLabel /
sessionRoot strings have had no consumers since #124301.

* fix(codex): resolve rootless permission boundaries from agent config, not bind cwd

ClawSweeper P1: /codex bind --cwd stores the requested path as the binding
workspaceDir, which the previous commit then trusted as defaultRoot — letting
a bound thread's requested cwd become (and widen) the rootless permission
boundary. resolveConversationAppServerRuntime now owns the fact: it resolves
the selected agent's canonical workspace from config (falling back to the
plugin's configured default workspace), and the caller-supplied
agentWorkspaceDir parameter chain is deleted so no call site can pass a
tainted value. Recovery of recorded roots is unchanged (pinned roots stay
pinned); the moved-history test now proves the bind-cwd clamp lands on the
agent workspace.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…e default root (openclaw#129994)

* fix(gateway): permission modes work on rootless sessions via workspace default root

Session permission modes hard-required a recorded sessionRoot, which only the
sessions.create RPC ever records. Channel sessions, pre-openclaw#124909 rows, and
exec-node sessions are rootless, so runs failed closed with 'session permission
mode requires a recorded session root' (rows poisoned before the openclaw#128149 guards
were permanently bricked) and operators could not set a mode on channel
sessions at all.

The mode semantics are root-free; every containment consumer already falls
back to the workspace, and the remote worker launcher already derives its
containment root from placement.remoteWorkspaceDir. Make that the canonical
rule: a recorded sessionRoot pins worktree/explicit-cwd boundaries, and a
rootless session's boundary is the agent's canonical workspace resolved where
the run is prepared.

- embedded runner + compaction: default policy root to realpath(workspace)
  instead of throwing/dropping the mode; bricked rows self-heal
- gateway: delete the patch/create/reset rejection guards and
  session-permission-policy.ts entirely
- codex plugin: helpers take a required defaultRoot (agent workspace fact,
  never a requested thread cwd); delete the four root throws; sandbox context
  for conversation bindings now derives from the agent workspace
- ui: drop the rootless-rejection surface from the permission picker
- docs: permission-modes boundary contract updated

* fix(agents): split workspace path identity out of the kysely state store

Heals main: openclaw#116650 made memory-host-sdk/dreaming.ts import
resolveWorkspaceStateIdentity from workspace-state-store, statically pulling
kysely into the memory-core doctor-contract closure and failing the
doctor-contract-closure-guard lane on origin/main. The identity helpers are
pure path/crypto code; move them to workspace-state-identity.ts and repoint
all importers (dreaming, event-store, onboarding recommendations, workspace
migrations, legacy state).

* fix(ui): drop the unused permission picker sessionRoot prop and dead i18n keys

check-prod-types caught the New Session dialog still passing the removed
sessionRoot picker prop; the prop and the permissionControls.rootLabel /
sessionRoot strings have had no consumers since openclaw#124301.

* fix(codex): resolve rootless permission boundaries from agent config, not bind cwd

ClawSweeper P1: /codex bind --cwd stores the requested path as the binding
workspaceDir, which the previous commit then trusted as defaultRoot — letting
a bound thread's requested cwd become (and widen) the rootless permission
boundary. resolveConversationAppServerRuntime now owns the fact: it resolves
the selected agent's canonical workspace from config (falling back to the
plugin's configured default workspace), and the caller-supplied
agentWorkspaceDir parameter chain is deleted so no call site can pass a
tainted value. Recovery of recorded roots is unchanged (pinned roots stay
pinned); the moved-history test now proves the bind-cwd clamp lands on the
agent workspace.
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Permission picker accepts root-dependent modes on rootless legacy sessions

2 participants