feat(rust): add authenticated node sidecar bridge - #116863
Conversation
|
Codex review: found issues before merge. Reviewed August 12, 2026, 4:17 PM ET / 20:17 UTC. ClawSweeper reviewWhat this changesThis draft adds a Rust authenticated sidecar protocol and node-command runtime bridge, with Gateway schema and generated Android/Swift model updates. Merge readiness⛔ Blocked by patch quality or review findings - 9 items remain Keep open for an explicit maintainer decision: this is a large, stacked proposal for a second core node runtime, not a bounded bug fix. The earlier nullable-params generator finding is addressed, but the dirty branch must be rebased and its generated native protocol clients refreshed before it can be reconsidered. Priority: P3 Review scores
Verification
How this fits togetherGateway sends authenticated node invocations to paired device runtimes and receives results, progress, and cancellation events. This PR adds a Rust runtime that can place a local authenticated sidecar between that Gateway-facing node session and product-owned command handlers. flowchart LR
Gateway[Gateway node invocation] --> Schema[Gateway protocol schema]
Schema --> Native[Android and Swift models]
Schema --> Rust[Rust node runtime]
Rust --> Sidecar[Authenticated local sidecar]
Sidecar --> Handler[Product-owned command handler]
Handler --> Result[Gateway result and progress]
Decision needed
Why: This is a 12k-production-line parallel runtime stack with future product-owned packaging, artifact verification, bootstrap, and supervision obligations; code review cannot choose that ownership or support commitment. Before merge
Findings
Agent review detailsSecurityNeeds attention: The framing is deliberately fail-closed, but the new sidecar cannot safely become product-selectable until its bootstrap and artifact-verification owner is approved. PR surfaceSource +30, Tests +488, Docs +204, Other +14143. Total +14865 across 42 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Decide whether a core Rust runtime is an endorsed architecture, then land only a rebased, generated-client-clean slice atop merged prerequisites with a named in-tree adopter and bootstrap-trust owner. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this PR proposes a new runtime boundary, while its stated child-process test is evidence for the generic sidecar contract. Is this the best way to solve the issue? Unclear: the existing TypeScript node-host already owns the Gateway node boundary, and whether a parallel Rust core runtime is preferable requires maintainer direction. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c631b1a45edb. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
8ead00a to
71c1c8c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Adds one authenticated, bounded sidecar contract for running
openclaw-node-hostout of process while leaving product policy, native capability ownership, process
launch, and transport selection with the embedding application.
This consolidates the reviewed fork evidence from
#193,
#194, and
#195 into the third OpenClaw
review surface:
features and limits;
failures;
CommandRuntimeand
NodeLifecyclesurfaces; andby the Windows C# adopter; plus
real loopback TCP in both directions and exits cleanly.
Position in the series
openclaw-gateway-client, initialopenclaw-node-host, and Linux Tauriconvergence.
delivery, lifecycle/reconnect, duplex invocation, admission, Gateway
authority, connection manifests, and shared TypeScript/Rust conformance.
ordinary-command runtime bridge.
— independently consumes these contracts through the existing
NodeCapabilityDispatcherwhile retaining C# as the production default.GitHub requires this cross-fork PR to target
main; it is logically stacked onthe exact #116450 head
bfd5c4d14e2730d8e9b2a76a9ad45e52288a3732.After #116050 and #116450 land, their shared ancestry drops out and only this
logical sidecar slice remains.
Ownership boundary
RFC #54 proposes that OpenClaw own the reusable protocol, Gateway authority
semantics, node runtime, and conformance corpora. Under that boundary, the
embedding product remains responsible for:
rollback, packaging, and deployment; and
The reported peer identity is authenticated by the fresh session key but is not
artifact-verification proof. The bridge cannot broaden the authenticated
configuration or introduce commands outside the exact manifest. The reserved
system.*namespace remains unavailable to this generic runtime until OpenClawdefines an explicit authorization contract.
Deliberate exclusions
This PR does not choose a product IPC or launcher, deliver production
credentials, select the Rust runtime by default, implement product approval UX,
MCP/skills, or native handlers, provide an audit sink, or claim production
sidecar readiness. Its child-process TCP harness proves the generic
process/transport contract only.
Full ordered duplex sidecar input/progress/heartbeat transport, verified
process/bootstrap, Gateway pairing/token proof, crash/resource proof, packaging,
rollout, and rollback remain adoption gates.
Validation
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features— 124 tests passedcargo doc --workspace --no-depsoxfmt 0.60.0 --checkon the protocol document and all three JSON corporagit diff --checkfindings resolved; final exact-head passes clean
The cumulative OpenClaw sidecar head is
71c1c8cb23c5647dc07fd4ee1f8663068c92a482. Review fixes cover terminalretirement, bounded serialization, session-specific frame minima, portable
feature/version negotiation, role and delivery binding, immutable configuration,
portable JSON numbers, complete-message budgeting, and bounded stable adapter
errors.
Real behavior proof
Behavior or issue addressed:
The reusable Rust node runtime had no authenticated local process boundary that
an independent product could implement without importing product policy or
creating a second native execution path.
Real environment tested:
Ubuntu 24.04/WSL2 at commit
71c1c8cb23c5647dc07fd4ee1f8663068c92a482, Tokio loopback TCP, a separatelylaunched OS child, RustCrypto HMAC-SHA-256, OS randomness, and the checked-in
language-neutral protocol, handshake, and runtime corpora. The independent
Windows adopter at
711fe095028a025fa0649c9b8e20f480644a6967reproduces thesame corpora in C#. This is process/transport contract proof, not a packaged or
product-supervised Rust runtime.
Exact steps or command run after this patch:
native dispatch, including denial, timeout, cancellation, and status paths.
authenticated negotiation, configuration and exact manifest acknowledgement,
admission, invocation, and result over real loopback TCP; and verify clean exit.
Evidence after fix:
The Rust workspace passes 124 tests, including two focused process-boundary
tests and the complete configured ordinary-command transcript. The rebased
independent C# consumer in Windows #1068 passes 3,701 Shared
tests with 32 environment-dependent skips and 22 focused Connection tests; its
larger prior-head suites remain recorded in RFC #54.
Observed result after fix:
Both implementations agree byte-for-byte on framing, handshake, configuration,
admission, invocation, result, cancellation, and status. Authentication,
ordering, identity, replay, configuration substitution, command-manifest,
portable-number, cancellation, and output-bound violations fail closed before
native work or further transport use. No production runtime selection changes.
What was not tested:
No packaged Rust binary was launched through product-selected IPC; no protected
credential bootstrap, artifact verification, product supervisor, live Gateway
pairing/token session,
system.*command, product audit sink, crash/restartcircuit breaker, resource measurement, packaging, rollout, or rollback was
exercised. Those remain explicit adopter gates rather than implied capabilities
of this PR.