Skip to content

feat(rust): add shared gateway client and node host - #116050

Merged
giodl73-repo merged 12 commits into
openclaw:mainfrom
giodl73-repo:agent/rust-gateway-client
Sep 16, 2026
Merged

giodl73-repo merged 12 commits into
openclaw:mainfrom
giodl73-repo:agent/rust-gateway-client

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: #115975

Summary

Re-derives the shared Rust Gateway client and bounded node-host foundation from current OpenClaw main rather than replaying the August Tauri extraction.

The Linux desktop remains the first consumer, but only TLS, WebSocket, challenge, request correlation, event delivery, heartbeat activity, and transport lifecycle move into openclaw-gateway-client. Current Tauri ownership of saved/remote Gateway profiles, credential references, route generations, switching/recovery, desktop and sleep leases, Quick Chat recovery, Canvas/accent state, and UI notices is preserved.

The exact generic client work is also reviewed in giodl73-repo/openclaw-rust-node#14. OpenClaw remains authoritative for Gateway schemas and behavior.

Position in the series

  1. This PR adds the two unpublished workspace crates and current-main Tauri consumer.
  2. #116450 adds the bounded embeddable lifecycle on this exact head.
  3. #116863 adds the authenticated bounded sidecar bridge on feat(rust): add the embeddable node runtime lifecycle #116450.
  4. Closed Windows node #1068 remains prior evidence; adoption requires a smaller current-contract PR after the shared contracts are accepted.

What this adds

openclaw-gateway-client

  • role-neutral TLS and WebSocket sessions with exact leaf-pin support;
  • bounded requests, correlation, cancellation, retained events, and transport activity;
  • independent 64 MiB message and 16 MiB frame limits matching current Tauri;
  • application-owned dispatch guards executed immediately before wire enqueue;
  • per-request deadlines covering permit wait, queueing, write, and response; and
  • bounded current-v4 to released-v3 node negotiation using fresh challenge/signing material.

openclaw-node-host

  • node identity, activation, invocation, cancellation, reconnect, and bounded command runtime;
  • exact v4-first negotiation with one v3 retry only for the released structured mismatch response;
  • released paramsJSON invocation compatibility for both negotiated protocol versions; and
  • a repository-local foreground proof host with local health/readiness.

Linux Tauri migration

  • keeps profiles, credentials, Gateway ownership, switching, and reconnect supervision app-owned;
  • preserves generation fencing through actual socket enqueue;
  • drains events while startup and configuration requests are pending;
  • ignores unknown text frames consistently, independent of request timing;
  • retires the session if an invalid dispatch guard rejects after enqueue; and
  • preserves desktop demand, local sleep leases, history recovery, Canvas refresh, Gateway accent updates, and delivering-session event attribution.

Boundaries

This does not publish crates, stabilize a public Rust API, replace Tauri or src/node-host, select product IPC, add Windows integration, or implement worker/session hosting, workspace transfer, host statistics, system.run, PTY, MCP, skills, or plugins.

Validation

  • current proof head: 07c4c67a87e4c1872899da23646debada66cd48a;
  • shared crate workspace: 71 passed, 0 failed;
  • Linux Tauri unit tests: 260 passed, 3 ignored;
  • Linux Tauri integration tests: 11 passed, 6 ignored;
  • Linux combined: 271 passed, 9 ignored, 0 failed;
  • crate and Linux formatting/check/rustdoc gates passed;
  • crate Clippy -D warnings passed;
  • focused Linux Clippy passed with unchanged current-main lint categories allowed;
  • cargo test --locked --all-targets passed after retaining the rebased rustls lock edge;
  • git diff --check passed; and
  • independent adversarial review found no blocking issue.

Authority proof

The public CommandRuntime::run path runs over a real WebSocket session: an allowed invocation completes and records exactly one native effect, then a wire-delivered node.invoke.cancel reaches the handler cancellation token and suppresses any second native effect. Pre-cancelled, buffered retired-session, and duplex-overflow paths reject before native handler construction.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 16, 2026, 1:41 PM ET / 17:41 UTC (Revision 38).

ClawSweeper review

What this changes

Extracts the Linux desktop’s Gateway transport into a shared Rust library and adds an unpublished node runtime and foreground host.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains useful, distinct work with no blocking correctness finding. Prior fixes remain intact; the unresolved question is acceptance of the bounded Rust incubation scope.

Priority: P2
Reviewed head: 07c4c67a87e4c1872899da23646debada66cd48a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with useful boundary proof and no blocking finding; the remaining architecture choice does not reduce patch quality.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured execution report and inspected production-path harness cover CommandRuntime::run over a real loopback WebSocket: one allowed effect completes, wire cancellation suppresses further effects, and retired-session work cannot construct a handler. This supports bounded runtime behavior without claiming production platform adoption.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured execution report and inspected production-path harness cover CommandRuntime::run over a real loopback WebSocket: one allowed effect completes, wire cancellation suppresses further effects, and retired-session work cannot construct a handler. This supports bounded runtime behavior without claiming production platform adoption.
Evidence reviewed 10 items Pinned review continuity: The exact head changes only formatting in the node-host manifest relative to the previous completed review. GitHub’s commit patch confirms no runtime changes in this last commit.
Current-main implementation boundary: Pinned main still implements the desktop socket connection directly. Its root tree has no crates directory; the supplied latest release revision also has no crates directory. Neither establishes this shared runtime as implemented.
Release boundary: The tree check returned no crates directory at the supplied v2026.9.4 release commit.
Findings None None.
Security None None.

How this fits together

The shared client carries requests and events between native applications and the Gateway. The desktop retains profile and credential ownership, while the node runtime dispatches incoming commands to bounded native handlers.

flowchart LR
  A[Desktop profiles and credentials] --> B[Shared Rust client]
  C[Node identity and command registration] --> B
  B <--> D[OpenClaw Gateway]
  D --> E[Invocation and cancellation events]
  E --> F[Node runtime authority checks]
  F --> G[Native handlers and results]
  G --> B
Loading

Decision needed

Question Recommendation
Should these two unpublished crates incubate in the OpenClaw monorepo with Linux Tauri as the first consumer? Accept bounded incubation: Accept the two unpublished workspace crates without promising publication, an official host binary, or broader platform support.

Why: The implementation and bounded proof are coherent, but repository placement and ownership acceptance remain explicitly proposed in the linked RFC.

Before merge

  • Complete next step (P2) - Record acceptance or deferral of the two-crate monorepo incubation scope in the PR or linked RFC.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +1593, Other +7249. Total +8842 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 1593 0 +1593
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 17 7852 603 +7249
Total 19 9445 603 +8842

Review metrics

Metric Value Why it matters
Rust production versus test growth Production sections +4,635 lines; test sections +2,989 lines Physical-line counts include comments and blanks, exclude manifests and lockfiles, and reflect the stated shared-client and bounded-runtime expansion.

Root-cause cluster

Relationship: partial_overlap
Canonical: #115975
Summary: This foundation implements part of the broader Rust-adoption proposal; the lifecycle and sidecar PRs are dependent layers.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one shared Rust transport with application-owned credentials and authority, and limit initial node-runtime adoption to explicitly accepted unpublished incubation.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this proposes a reusable native runtime rather than reporting a current-main defect; supplied boundary execution covers its principal dispatch and cancellation behavior.

Is this the best way to solve the issue?

Yes for the bounded technical approach: the desktop consumes the extracted transport while retaining application policy, and publication remains disabled. Monorepo adoption still requires acceptance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3343ccd2a3f9.

Labels

Label justifications:

  • P2: This is a substantive native-client improvement with an existing desktop consumer, without evidence of an urgent user regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured execution report and inspected production-path harness cover CommandRuntime::run over a real loopback WebSocket: one allowed effect completes, wire cancellation suppresses further effects, and retired-session work cannot construct a handler. This supports bounded runtime behavior without claiming production platform adoption.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured execution report and inspected production-path harness cover CommandRuntime::run over a real loopback WebSocket: one allowed effect completes, wire cancellation suppresses further effects, and retired-session work cannot construct a handler. This supports bounded runtime behavior without claiming production platform adoption.

Evidence

What I checked:

  • Pinned review continuity: The exact head changes only formatting in the node-host manifest relative to the previous completed review. GitHub’s commit patch confirms no runtime changes in this last commit. (crates/openclaw-node-host/Cargo.toml:20, 07c4c67a87e4)
  • Current-main implementation boundary: Pinned main still implements the desktop socket connection directly. Its root tree has no crates directory; the supplied latest release revision also has no crates directory. Neither establishes this shared runtime as implemented. (apps/linux/src-tauri/src/gateway_ws.rs:1101, 3343ccd2a3f9)
  • Release boundary: The tree check returned no crates directory at the supplied v2026.9.4 release commit. (3a9d69db306c)
  • Desktop dispatch ownership: The desktop guard retains the configuration lock while checking route generation, local sleep ownership, and deadline, then enqueues through the shared transport. Profile and credential writers remain outside the extracted crate. (apps/linux/src-tauri/src/gateway_ws.rs:1604, 07c4c67a87e4)
  • Authority proof and prior fixes: The captured PR body reports successful execution through CommandRuntime::run over a real loopback WebSocket. The inspected harness observes one allowed effect, wire-delivered cancellation with no additional effect, and buffered retired-session rejection before handler construction. Runtime source retains pre-cancellation and retirement checks. These observations support the bounded handler contract, not broader platform adoption. (crates/openclaw-node-host/tests/node_session.rs:21, 07c4c67a87e4)
  • Compatibility and supply-chain inspection: Both crates set publish=false. The node client makes one structured v3 fallback with fresh connection/signing material; desktop TLS pins and private-network URL policy remain supported. Static lockfile parsing found checksums for all registry packages and no new non-registry dependency source in the introduced lockfile. (crates/openclaw-node-host/Cargo.toml:7, 07c4c67a87e4)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (37 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-15T23:49:48.129Z sha ca18380 :: needs real behavior proof before merge. :: [P2] Retire handler authority when local closure is requested
  • reviewed 2026-09-16T00:02:01.425Z sha 35cca07 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T00:08:41.196Z sha 35cca07 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T05:29:22.779Z sha 40af6d6 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T06:03:46.938Z sha 1a3e450 :: blocked before merge. :: none
  • reviewed 2026-09-16T16:27:37.101Z sha dd967ff :: blocked before merge. :: [P2] Synchronize the desktop manifest with its Cargo lockfile
  • reviewed 2026-09-16T16:55:04.092Z sha 79b7b71 :: blocked before merge. :: none
  • reviewed 2026-09-16T17:07:50.350Z sha 79b7b71 :: blocked before merge. :: none

@giodl73-repo
giodl73-repo force-pushed the agent/rust-gateway-client branch from ea3c03e to 02c96a1 Compare July 29, 2026 19:37
@socket-security

socket-security Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​thiserror@​2.0.198010093100100
Addedcargo/​futures-util@​0.3.3310010093100100

View full report

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 29, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Jul 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 29, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

giodl73-repo and others added 2 commits September 16, 2026 09:12
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
@giodl73-repo
giodl73-repo force-pushed the agent/rust-gateway-client branch from 16758e9 to dd967ff Compare September 16, 2026 16:18
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@giodl73-repo
giodl73-repo marked this pull request as ready for review September 16, 2026 17:00
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@giodl73-repo
giodl73-repo merged commit f9a7f10 into openclaw:main Sep 16, 2026
198 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
Adds the unpublished shared Gateway client and bounded node-host foundation, with Linux Tauri as the first consumer. Exact-head CI and ClawSweeper review are clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: linux maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant