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 33 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 3:39 PM ET / 19:39 UTC. ClawSweeper reviewWhat this changesThe branch adds a replaceable Windows node-runtime interface, moves native command execution into a shared dispatcher, and implements a non-selectable C# conformance adapter for a proposed Rust sidecar protocol. Merge readiness⛔ Blocked until stronger real behavior proof is added - 7 items remain Keep this PR open for maintainer direction, but it is not ready to merge: it couples three ownership transfers and lacks current-head MCP and Gateway proof for the production dispatcher path. Priority: P2 Review scores
Verification
How this fits togetherThe Windows node receives Gateway invocations, routes them to native Windows capability handlers, and returns results to Gateway and local MCP clients. This branch changes the runtime-to-dispatch boundary while retaining the C# node client as the default runtime. flowchart LR
A[Gateway events] --> B[Node runtime]
B --> C[Capability dispatcher]
C --> D[Windows capability handlers]
D --> E[Gateway and MCP results]
F[Sidecar conformance adapter] --> C
Decision needed
Why: The branch deliberately stops short of a selectable runtime, while adding a large local protocol implementation that depends on unresolved upstream ownership and rollout decisions. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Choose the sidecar contract upstream, then land the dispatcher extraction, runtime interface, and sidecar adapter as separate reviewable PRs with current-head MCP and Gateway proof for each production-affecting slice. Do we have a high-confidence way to reproduce the issue? Not applicable as a standalone bug report. The branch has fixture and in-process coverage, but it does not provide current-head MCP or real Gateway behavior proof for the changed production route. Is this the best way to solve the issue? No. A staged extraction is safer than merging runtime selection, dispatcher ownership, and a future sidecar protocol proof as one branch. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4206611f2b2e. LabelsLabel 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 (37 earlier review cycles; latest 8 shown)
|
69fe021 to
194928f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3ca913a to
711fe09
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
71c1c8cb23c5647dc07fd4ee1f8663068c92a482. 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
RustSidecar/NodeCapabilityDispatchertests — 63/63 passedNodeConnectorConnection tests — 22/22 passedwin-x64projects built; 60 focused sidecar, 3,462Shared, 2,023 Tray, and 519 Connection tests 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
711fe095028a025fa0649c9b8e20f480644a6967. The rebase preserves the currentfail-closed pre-credential handshake authorization gate through the generic
runtime seam. The adapter review also fixed
cancellation/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
711fe095028a025fa0649c9b8e20f480644a6967, OpenClaw sidecar fixtures from71c1c8cb23c5647dc07fd4ee1f8663068c92a482, 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 rebased head passes 63 focused sidecar/dispatcher tests, 3,701 Shared tests,
and 22 focused Connection tests. Prior-head larger-suite evidence and the
retained live MXC transcript remain recorded; MXC 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.