Skip to content

fix(workers): remote sessions preserve destination and access policy - #130148

Merged
steipete merged 2 commits into
mainfrom
codex/remote-node-worker-stress-round-three
Aug 26, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/remote-node-worker-stress-round-three

Conversation

@steipete

@steipete steipete commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users starting a session against a remembered paired node, automatic remote node, or cloud worker could briefly run it locally before their saved destination finished restoring. Fixes an issue where visible and hidden spawned agents silently discarded their parent's read-only, guarded, workspace, or Full Access policy, causing either unauthorized escalation or unexpected approval alerts. Resolves paired-node Docker workers surviving cancellation after claiming capacity, plus incomplete workspace-transfer cleanup when one sibling fails.

Why This Change Was Made

Placement restoration, delegated session authority, node-supervisor cancellation, and workspace-transfer lifetime each have their own canonical owner. This repair carries the already-prepared trusted parent permission policy through both spawn paths, lets each child own its correct workspace root, fences new-session submission until the actual saved remote destination is restored, binds post-claim cancellation to the exact launch identity before opening the worker start gate, and drains all transfer contexts before removing shared scratch. Dead supervisor persistence bookkeeping and duplicate policy fields are removed rather than adding alternate execution paths or suppressing size guards.

User Impact

Saved remote sessions never silently execute on the local machine while their environment catalog is loading. Every delegated child preserves its parent's chosen access level, including Full Access without spurious approval alerts, while cross-agent children remain scoped to their own workspace. Cancelling an in-flight Docker worker launch releases its actual container and capacity, and shutdown no longer strands staged workspace-transfer files after a sibling failure.

Evidence

Failing before the repair:

  • Three real Chromium scenarios proved paired-node, automatic-node, and cloud-worker preferences all enabled Start while the UI still showed Local.
  • Four visible and four hidden subagent permission regressions failed for read-only, guarded, workspace, and Full Access; the cross-agent case also proved the child lost its own canonical workspace root.
  • A real owner-boundary fake-Docker scenario proved an aborted claimed worker remained durably running with a surviving container and occupied slot.
  • Two real workspace-transfer contexts proved shutdown rejected early, skipped sibling cleanup, and left the shared scratch directory behind.

Passing after the repair:

  • 267 Gateway, subagent, node-host, and Docker-supervisor owner tests passed across four Vitest projects; a separate expanded node-supervisor/recovery run passed 58 tests.
  • Exact-head hosted CI also exposed two pre-existing order-dependent agent-deletion mocks that replaced the entire filesystem-safety module; both now use the existing partial-mock owner pattern, and all 90 affected and sibling tests pass without any production change.
  • 22 actual Chromium destination, placement, and Full Access scenarios passed.
  • Focused type-aware lint, core/UI/root-test TypeScript projects, formatting, and independent structured review passed.
  • A complete production build rebuilt the Gateway, remote worker, 63 plugins, and Control UI.
  • The rebuilt real Gateway served Chromium, which selected a real paired remote node, created/dispatched/sent through the actual browser, ran two real Docker workers, synchronized the workspace, produced zero approval requests, and left no worker containers behind.
  • Production: +84/-66 (net +18) across the four independent placement, authority, cleanup, and cancellation boundaries; the Docker-supervisor fix itself is net negative after removing dead ownership state. Tests: +302/-2.

Before selecting the actual paired node:

Real Gateway Control UI showing the available paired worker node

After two actual Docker-backed turns with Full Access and no approval alerts:

Real Gateway Control UI after successful paired-node Docker execution without approval alerts

Complete sanitized real-browser, paired-node, and Docker execution recording:

[email protected]

@clawsweeper

clawsweeper Bot commented Aug 26, 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 app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Aug 26, 2026
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Aug 26, 2026
@steipete
steipete merged commit ba8e03f into main Aug 26, 2026
208 checks passed
@steipete
steipete deleted the codex/remote-node-worker-stress-round-three branch August 26, 2026 14:27
@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 27, 2026
…penclaw#130148)

* fix(workers): preserve remote placement and delegated authority

* test(commands): preserve filesystem exports in deletion mocks
@eleqtrizit eleqtrizit self-assigned this Sep 13, 2026
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 commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants