refactor: add a replaceable node runtime and sidecar adapter proof - #1068
refactor: add a replaceable node runtime and sidecar adapter proof#1068giodl73-repo wants to merge 32 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 4:00 AM ET / 08:00 UTC. ClawSweeper reviewWhat this changesThe branch makes the Windows node runtime injectable, moves native capability execution into a shared dispatcher, and adds a non-selectable C# conformance implementation of a proposed authenticated Rust sidecar contract. Merge readiness⛔ Blocked until stronger real behavior proof is added - 6 items remain This draft remains necessary because current main has neither the runtime seam nor the sidecar adapter. Its large architecture change is not ready for ordinary merge review: the upstream sidecar contract is still proposed, and the PR has no current-head real process, IPC, Gateway pairing, or MCP proof for the new boundary. Priority: P2 Review scores
Verification
How this fits togetherThe Windows node receives Gateway invocations, registers Windows-native capabilities, and returns results through the node connection. This PR separates the transport/runtime client from Windows capability execution so the existing C# client remains the default while a future sidecar could dispatch through the same native-handler path. flowchart LR
A[Gateway commands] --> B[Node connection]
B --> C[Selected node runtime]
C --> D[Windows capability dispatcher]
D --> E[Native Windows handlers]
E --> F[Responses and telemetry]
G[Non-selectable sidecar adapter] --> D
Decision needed
Why: The branch itself says production selection remains blocked and that the upstream protocol is only proposed. Source review can assess local structure, but it cannot decide whether this duplicated conformance implementation is the intended product investment. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: First obtain explicit approval for the Windows adoption boundary, then land the runtime seam and sidecar integration in independently reviewable slices with a real selectable-process proof only when the upstream contract is accepted. Do we have a high-confidence way to reproduce the issue? Not applicable as a conventional bug reproduction. This PR proposes a new runtime architecture and sidecar conformance path rather than repairing a reported current-main failure. Is this the best way to solve the issue? Unclear. The dispatcher extraction is internally coherent, but accepting a parallel C# implementation of an unapproved external sidecar contract is not yet the narrowest maintainable product path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ac00c5f4977. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (35 earlier review cycles; latest 8 shown)
|
69fe021 to
194928f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Adds one replaceable Windows node-runtime boundary, one shared Windows capability
dispatcher, and a non-selectable C# conformance consumer of OpenClaw's proposed
authenticated Rust sidecar contract. It is independent contract proof, not a
second production runtime.
This consolidated Windows adopter PR now:
INodeRuntimeClientand an injectable factory while keepingWindowsNodeClientselected by default;NodeServiceand A2UI consumers behind that runtime contract;cancellation, telemetry, and completion into the transport-independent
NodeCapabilityDispatcher;cancelled candidates without blocking later reconnects;
configuration, admission, invocation, cancellation, result, and status
contracts proposed by OpenClaw PR3; and
NodeCapabilityDispatcher, without adding a second Windows policy orexecution path.
The former stacked fork proof
#2 has been
fast-forwarded into this branch. The C# runtime remains the production default.
Position in the series
Gateway client, bounded node-host foundation, headless binary, and Linux
Tauri convergence.
lifecycle/reconnect, duplex invocation, admission, Gateway authority,
connection manifests, and shared conformance.
authenticated/versioned sidecar framing, handshake, immutable configuration,
and the bounded ordinary-command runtime bridge.
independent C# adopter proof.
OpenClaw and
openclaw-windows-nodeare separate repositories, so this PRcannot be Git-rebased onto #116863. The dependency is contractual: this branch
pins and reproduces #116863's three fixture corpora at OpenClaw head
8d0a1b013ea83b1726e284d71791002260eac3c6. Production Rust selection remainsblocked until that contract is accepted and the remaining adoption gates close.
Ownership boundary
RFC #54 proposes that OpenClaw own the reusable protocol, Gateway authority
semantics, Rust runtime, and conformance corpora. Under that boundary, Windows
retains WinUI, operator behavior, MCP, approvals, native capability handlers,
process/artifact verification, protected bootstrap, concrete IPC, audit,
packaging, rollout, and rollback.
WindowsNodeClientstill owns production Gateway wire parsing and responseframing.
NodeCapabilityDispatcherowns Windows capability execution. Thesidecar adapter can only deliver authenticated, admitted ordinary invocations
into that dispatcher; it is not an
INodeRuntimeClient, launches no process,chooses no transport, and cannot be selected.
The generic Rust runtime still rejects the reserved
system.*namespace. Theexisting Windows
system.runfamily therefore stays on C# until OpenClaw ownsan explicit authorization mechanism.
Remaining adoption gates
Before Rust can become selectable, Windows still needs verified artifact/process
launch, protected credential handoff, concrete local IPC, live Gateway pairing
and issued-token lifecycle, duplex sidecar input/progress/heartbeat transport,
process/crash supervision, health and resource proof, product audit export,
packaging, rollout, and rollback.
Validation
./build.ps1— all Debugwin-x64projects built successfullydotnet test tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~RustSidecar"— 60 passedOPENCLAW_REPO_ROOT=<checkout> dotnet test tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore— 3,462 passed, 32 existing environment-gated skipsdotnet test tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore— 2,023 passeddotnet test tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore— 519 passed./scripts/validate-mxc-e2e.ps1on the runtime-seam head — 2/2 live Gateway MXC tests passedgit diff --check— passedsecurity reviews — all findings resolved; exact combined-head passes clean
The combined Windows head is
3ca913a43a62957b8aca0448667facff3290fbc6. The adapter review fixedcancellation/registration races, response ordering, admission lifetime,
handshake role/version binding, result/envelope bounds, serde-compatible typed
and untyped number handling, and bounded canonicalization across
JsonElement,JsonNode, andJsonDocument.Real behavior proof
Behavior or issue addressed:
Windows needs one migration-safe execution boundary that preserves current
Gateway-to-native behavior while proving that the OpenClaw sidecar contract can
be consumed independently without bypassing Windows policy or handlers.
Real environment tested:
Windows 11, .NET SDK 10.0.302, combined head
3ca913a43a62957b8aca0448667facff3290fbc6, OpenClaw sidecar fixtures from8d0a1b013ea83b1726e284d71791002260eac3c6, and the existing live Gateway/MXCproof collected on runtime-seam head
c0cfa8ba66802e601de23875b07caf941209e554. The sidecar proof is an in-processsource harness; it does not launch an external Rust binary.
Exact steps or command run after this patch:
cancellation, result, and status flows.
NodeCapabilityDispatcher.cancellation, and resource-bound failures.
for successful contained
system.runand denied tray-data writes.Evidence after fix:
The combined head passes 60 focused sidecar tests, 3,462 Shared tests, and 2,023
Tray tests. The retained live MXC transcript reports 2/2 passed: contained
system.runreturnedOPENCLAW_GATEWAY_SYSTEM_RUN_MXC_OK, and a write outsidethe sandbox failed with
Access is deniedandfileExists=False.Observed result after fix:
The incumbent C# runtime still executes real Gateway commands through the shared
dispatcher. Independently, the non-selectable adapter accepts the exact
OpenClaw sidecar contracts, routes ordinary admitted commands into that same
dispatcher, and fails closed on authentication, ordering, identity, admission,
cancellation, serialization, and output/work-bound violations.
What was not tested:
No Rust process was launched; no concrete IPC or protected bootstrap was used;
no live Gateway session selected the Rust runtime; and no
system.*sidecarcommand, crash recovery, production audit, resource measurement, packaged
artifact, rollout, or rollback was exercised. Production selection remains the
existing C#
WindowsNodeClient.