feat: run OpenClaw in an owned isolated agent session - #46
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 17, 2026, 4:01 PM ET / 20:01 UTC (Revision 28). ClawSweeper reviewWhat this changesAdds owned isolated Windows sessions, setup/status/teardown commands, guest Node installation, and routing of OpenClaw commands into the agent account. Merge readiness⛔ Blocked before merge - 5 items remain This remains useful work absent from main. The directory-relocation finding is addressed, and the pre-release profile transition is explicitly intentional; the remaining blocker is evidence that in-flight session authority cannot survive teardown. Priority: P2 Review scores
Verification
How this fits togetherThe Windows package launcher receives OpenClaw commands and selects host execution or an isolated agent account. Persisted ownership records and the MXC backend coordinate that account, while shared workspace files carry requests to its guest helper. flowchart TD
A[OpenClaw command] --> B[Select execution mode]
B --> C[Direct host execution]
B --> D[Validate setup and session ownership]
D --> E[MXC isolated account]
D --> F[Protected workspace request]
F --> E
E --> G[Guest helper and Node]
G --> H[Command result]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The relocation repair is present; in-flight revocation at the real execution boundary remains an evidence gap, not a confirmed exploit. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the accepted pre-release isolation model and protected workspace writes, with demonstrated rejection of revoked session authority before guest execution. Do we have a high-confidence way to reproduce the issue? Not applicable to the feature itself. The previous relocation defect has a focused regression; no failing current-head execution was established for the remaining revocation uncertainty. Is this the best way to solve the issue? Yes for the overall architecture: package-scoped ownership, guest-side runtime installation, and protected workspace operations fit this boundary. Final-effect revocation evidence is still needed before accepting the security contract. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 685ee93b7ebb. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (27 earlier review cycles; latest 8 shown)
|
7a1ab42 to
cfa5c98
Compare
cfa5c98 to
b812485
Compare
b812485 to
7cfb36c
Compare
7cfb36c to
cc47e30
Compare
|
Correction: the merge conflict is real, not stale cache. Earlier evidence tested #46 head against its immediate base, which is a clean fast-forward, but the full stack has not been replayed onto current main. The stack root is 3a0491c while origin/main is e6cac4e; #46 is the first layer with a Program.cs overlap. Resolving via a full gh stack rebase from #43, preserving the stack relationship. |
3ad576f to
f73046e
Compare
Add synchronization and package-derived writable paths for owned sessions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Provision or reuse owned sessions through the MXC abstraction and route required executions safely. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Dispatch correlated argument vectors through the packaged guest helper with safe cleanup and runtime composition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
f73046e to
16406a7
Compare
16406a7 to
82d2864
Compare
82d2864 to
b934e40
Compare
b934e40 to
d7cfcde
Compare
d7cfcde to
130242b
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
130242b to
47c7de2
Compare
What Problem This Solves
Guest Node installation and persisted session ownership must be reliable before later gateway, recovery, and support workflows can depend on them.
User Impact
clawctl setupinstalls the agent-profile Node runtime, records a ready setup marker, and verifies that the saved sandbox identity belongs to this installation.openclawroutes through that owned session when isolation is selected.Why This Change Was Made
The session lifecycle uses durable
session.jsonandsetup.jsonownership records to provision or reuse the agent session, stage the helper, and make setup, status, and teardown explainable. The agent profile receives Node with PATH precedence; direct execution remains an explicit route.Review fixes addressed
node.exerather than its parent directory.Current validation
Latest hosted follow-up: CodeQL traced the runtime install destination to .NET's environment-sensitive
Environment.GetFolderPathimplementation. The session host now resolves the Windows LocalAppData known folder directly withSHGetKnownFolderPathbefore constructing any install path; focused installer tests, the 628-test suite, the static-analysis quality gate, and an x64 NativeAOT session-host publish pass.Latest review hardening: helper staging now binds source and destination operations to validated handles and the pinned session generation; missing trusted reads preserve their specific diagnostic; existing agent Node is reused only after its executable reports the expected version; status includes recorded detail; and automatic routing performs capability preflight before requiring setup.
Latest authority-chain follow-up: host helper staging and guest diagnostic output now create directories and files relative to validated parent handles with
NtCreateFile, so ancestor replacement cannot redirect a destructive create or truncate an outside sentinel. Automatic direct fallback validates any saved ownership first, and unlaunchable existing Node executables are treated as repairable. Focused authority/runtime/routing tests pass; integrated static analysis is warning-free and the full suite passes 642/642.Product transition decision: this is a pre-release isolation stack with no supported legacy-user migration requirement. Automatic mode intentionally selects isolation on supported packaged hosts and requires explicit
clawctl setup; it does not retain host-profile execution or copy host credentials/configuration into the isolated account. Explicit direct-host mode and unsupported-host fallback remain available, and saved ownership is validated before fallback.Final directory-authority follow-up: trusted workspace roots and descendants now retain share-enforced read/list handles without delete sharing.
CreateNewreturns a stream that owns the complete protected directory chain until the write stream is disposed, so guest code cannot relocate a validated parent between creation and the final host write. Recursive cleanup holds traversal authority separately and obtains delete access only after child traversal. The focused relocation/cleanup set passes 39/39 and the settled integrated tree passes 642/642.Current layer head:
47c7de26076bd91f9d1b8941e4658e479f067ea1. This layer is included in the final integrated stack tipcce2b02f3acd5791654b7a6b1a5a9c27db5ff63brebased onto685ee93b7ebbec1e784205a3544c460bea740e11.Integrated local gates: exact .NET SDK 10.0.100;
Test-DotNetQuality.ps1with 0 warnings/errors; full solution tests 642/642; NativeAOT x64 and ARM64 publishes for both launcher and session host; NativeAOT CLI, deployment, MXC, signing, runtime-input, release-identity, bundle, isolation-plugin, and packaging-relevance policy suites.Live x64 MXC evidence: final-tip Developer Mode deployment registered
OpenClaw.Gateway_0.1.2451.40134_x64__kaa03rpbbqef6from workflow payload run 35191206689;openclaw --versionreturnedOpenClaw 2026.9.4 (3a9d69d);clawctl statusconfirmed the isolated session was running. Earlier final-tip validation also exercised setup, Node.js 24.20.0 reuse, package-qualified activation, detached gateway launch, and redacted diagnostics collection.Signed package evidence: local NativeAOT x64 and ARM64 packages and a multi-architecture bundle were composed and test-signed. Elevated upgrade validation passed all four proof-release transitions (
v0.0.0.0andv0.0.0.1, standalone and bundle), retained package-family LocalState in every transition, and accepted fresh standalone and bundle installs. The temporary certificate and test package were removed, then the Developer Mode registration was restored.Layer 4 of 12. Parent: #45 - feat/session-guest-execution. Child: #47 - feat/session-agent-shell