feat: open an interactive shell inside the isolated agent session - #47
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 maintainer review before merge. Reviewed September 17, 2026, 4:01 PM ET / 20:01 UTC (Revision 29). ClawSweeper reviewWhat this changesAdds Merge readiness✅ Ready for maintainer review This remains a useful, distinct addition absent from current main and the latest release. The prior runtime-resolution and host-write concerns are addressed; no blocking introduced defect was identified. Collaborator-authored work is protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherThe Windows package launcher connects operator commands to an owned isolated agent session. This entry point uses the existing session transport to install the command shim and run an interactive shell under the guest identity. flowchart TD
A[Operator invokes clawctl pwsh] --> B[Check setup and recorded session]
B --> C[Resolve packaged runtime and helper]
C --> D[Install command shim as guest]
D --> E[Select available PowerShell]
E --> F[Run attached shell in agent account]
F --> G[Return shell exit code]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the shell as a thin consumer of the owned-session execution path, with command installation and execution confined to the guest account. Do we have a high-confidence way to reproduce the issue? Not applicable: this adds an interactive-shell capability rather than reporting a current-main bug; no Windows execution was performed during this read-only review. Is this the best way to solve the issue? Yes: extending the existing command tree and guest execution transport is a focused approach, and guest-side shim installation addresses the earlier host-authority concern. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 685ee93b7ebb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (28 earlier review cycles; latest 8 shown)
|
acb974f to
f888716
Compare
f888716 to
9398b75
Compare
9398b75 to
1910903
Compare
1910903 to
b959c62
Compare
b959c62 to
c8b5ad5
Compare
c8b5ad5 to
7178e90
Compare
7b668c8 to
af0c3f6
Compare
d8ef914 to
0e2c3e1
Compare
0e2c3e1 to
9ef2813
Compare
9ef2813 to
f3caf03
Compare
72eea89 to
e01efa2
Compare
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
e01efa2 to
6fad787
Compare
What Problem This Solves
After setup, an operator needs an interactive shell in the isolated agent session where typing
openclawresolves to that session rather than the host.User Impact
clawctl pwshopens an interactive agent shell. It prefers PowerShell 7 and falls back to Windows PowerShell, while preserving the interactive environment.Why This Change Was Made
clawctl pwshlaunches the available PowerShell inside the session, choosing PowerShell 7 first and Windows PowerShell only when necessary.An ASCII
openclaw.cmdshim makes theopenclawcommand resolve inside the session without relying on non-ASCII command-file behavior. The shell keeps the interactive environment established by the host.This layer is an interactive entry point only. It does not supervise the gateway, register logon recovery, or collect diagnostics.
Review fixes addressed
Guest-controlled destination can redirect a host write (high). The agent command shim was written by the host into the shared workspace, which the guest also controls. Validating the path and then writing to it by name left the checked object and the written object distinct, so a directory swapped in between could redirect a host-account write.
The shim is no longer written by the host.
openclaw-session-host --install-toolscreates it from inside the agent account, over a typed request/result pair (SessionToolInstallRequest/SessionToolInstallResult) carried through the shared workspace like every other guest operation.AgentToolShimnow only builds the environment the shim consumes, and the host verifies the returned shim path before using it. The host no longer writes into guest-controlled storage at all, so there is no validation-to-use window left to lose.Current validation
Latest hosted follow-up: The shell entry point now validates the installed agent runtime against the packaged archive path, matching the
RequireAgentNodePathcontract; the independent layer and final stack tip compile cleanly under the pinned SDK.Current layer head:
6fad787ca300e2437fd359d3aa3cec1b05e37061. 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 5 of 12. Parent: #46 - feat/session-isolated-lifecycle