Skip to content

feat(node-host): support native session and policy ownership - #150344

Merged
giodl73-repo merged 12 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/native-node-ownership-seams
Sep 20, 2026
Merged

giodl73-repo merged 12 commits into
openclaw:mainfrom
giodl73-repo:user/giodl/native-node-ownership-seams

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What this enables

The existing macOS app remains the owner of device identity, credentials,
certificate trust, native admission, and native tools. This PR adds the
reusable Swift/Rust seams needed for a native product to supply those decisions
while reusing the shared Rust Gateway client and node runtime.

This is the prerequisite for #149725. It intentionally contains no macOS
helper, packaging, rollout, or product integration.

Shared contracts

  • let a native caller supply signed Gateway connect material without moving
    credential ownership into Rust;
  • let the native trust owner evaluate the certificate from the exact Rust TLS
    stream before HTTP credentials are sent;
  • preserve exact invocation parameter JSON and await native admission before
    system.* handler construction;
  • keep request lifetime/cancellation caller-owned and bounded;
  • reserve bounded, prioritized WebSocket ping capacity independently of
    application RPC capacity.

External SecTrust evaluation is explicitly rebound to the requested hostname
before system-trust or TOFU decisions. Matching explicit pins retain the
existing self-signed-certificate behavior.

Evidence

Current head: dc5abc1af8e.

  • Rust 1.93 workspace: 148 tests passed.
  • Strict workspace Clippy, rustdoc, Cargo formatting, and diff hygiene pass.
  • An independent exact-head review found no correctness, concurrency, TLS,
    cancellation, authority, compatibility, or test-coverage finding.
  • TLS integration tests cover approved native trust and pins on the same
    stream, handshake-signature rejection, and rejection/timeout/cancellation
    before HTTP upgrade.
  • Session tests cover request lifetime, cancellation, deadlines,
    control-capacity keepalive, and transport closure.
  • The current-main merge preserves byte-exact paramsJSON capture while
    retaining the permanent conformance rule that rejects legacy direct
    params.
  • Exact-head hosted CI:
    https://github.com/openclaw/openclaw/actions/runs/35435960665

Non-goals

  • no node protocol or command-authority transfer from TypeScript/Gateway;
  • no macOS sidecar adoption or packaging;
  • no release-mechanics decision;
  • no claim of performance improvement.

@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.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 12:37 AM ET / 04:37 UTC (Revision 13).

ClawSweeper review

What this changes

Adds shared Swift and Rust interfaces for native-owned connection signing, certificate trust, command admission, request cancellation, and independently bounded WebSocket keepalives.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful prerequisite that current main does not provide. No actionable introduced correctness or security defect was found.

Priority: P2
Reviewed head: dc5abc1af8e71e771027dbb1bf8d919e8e80539e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent shared-library extension with focused boundary coverage and no actionable introduced findings; CI remains a separate landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: Verified maintainer authorship exempts ordinary contributor proof. Inspected transport tests cover approval and rejection before HTTP writes, and runtime tests cover native admission denial and cancellation; no unresolved authority violation requiring additional final-effect proof was established.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Verified maintainer authorship exempts ordinary contributor proof. Inspected transport tests cover approval and rejection before HTTP writes, and runtime tests cover native admission denial and cancellation; no unresolved authority violation requiring additional final-effect proof was established.
Evidence reviewed 10 items Pinned introduction and review continuity: Reviewed the complete introduced changes against ce1a433. The checkout matches the previously reviewed head, whose supplied completed review contains no findings. Raw head parent records match the supplied original-head identity; the stale test merge was not used to infer regressions.
Current-main and release necessity check: The relevant Rust owners are unchanged between the pinned base and fetched main, and main's NodeClient lacks connect_signed. The latest release and main have identical Gateway session and command-runtime blobs, so those released owners also lack the new native-policy interfaces. No merged replacement was established.
Release comparison: The v2026.9.5 session and runtime blob identities match their current-main counterparts; this is a necessity check, not a claim that this PR shipped.
Findings None None.
Security None None.

How this fits together

The shared Gateway client carries authenticated connections and requests between native applications and OpenClaw. The node runtime routes incoming commands through native admission checks before invoking platform handlers.

flowchart TD
  A[Native identity and credentials] --> B[Shared Gateway client]
  C[Native certificate trust] --> B
  B --> D[Gateway connection]
  D --> E[Node command runtime]
  E --> F[Native admission checks]
  F --> G[Platform handler and result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +465, Other +592. Total +1057 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 519 54 +465
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 11 687 95 +592
Total 14 1206 149 +1057

Review metrics

Metric Value Why it matters
Production versus test growth Production +510 net lines; tests +545 net lines; manifest/lock +2 Separating inline Rust tests shows the production growth supports concrete native-adapter interfaces rather than being entirely test scaffolding.

Technical review

Best possible solution:

Keep native credentials, trust, and admission with their existing owners while reusing the shared transport and runtime; assess macOS adoption and rollout separately.

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

Not applicable: this proposes native integration interfaces rather than reporting a reproducible product failure; target code was not executed during this read-only review.

Is this the best way to solve the issue?

Yes: extending the existing transport and runtime owners preserves native policy ownership without adding a competing credential or authorization manager.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded shared-runtime improvement supporting native integration, without an established urgent user regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Verified maintainer authorship exempts ordinary contributor proof. Inspected transport tests cover approval and rejection before HTTP writes, and runtime tests cover native admission denial and cancellation; no unresolved authority violation requiring additional final-effect proof was established.

Evidence

What I checked:

  • Pinned introduction and review continuity: Reviewed the complete introduced changes against ce1a433. The checkout matches the previously reviewed head, whose supplied completed review contains no findings. Raw head parent records match the supplied original-head identity; the stale test merge was not used to infer regressions. (dc5abc1af8e7)
  • Current-main and release necessity check: The relevant Rust owners are unchanged between the pinned base and fetched main, and main's NodeClient lacks connect_signed. The latest release and main have identical Gateway session and command-runtime blobs, so those released owners also lack the new native-policy interfaces. No merged replacement was established. (crates/openclaw-node-host/src/node.rs:628, e6e4848bb11a)
  • Release comparison: The v2026.9.5 session and runtime blob identities match their current-main counterparts; this is a necessity check, not a claim that this PR shipped. (crates/openclaw-gateway-client/src/session.rs, ec9c1a13db89)
  • TLS authority reaches the actual connection: Native policy receives certificate evidence from the actual TLS stream and must approve before its HTTP upgrade. Handshake signatures remain verified; deferred-policy sessions disable resumption and early data. TLS integration tests exercise approval, rejection, timeout, caller abort, invalid signatures, and pin mismatch. (crates/openclaw-gateway-client/src/session.rs:653, dc5abc1af8e7)
  • Native admission preserves runtime gates: Both admission policies share cancellation and deadline accounting. The runtime checks the advertised command manifest and rechecks cancellation/session retirement before constructing the handler. Added tests verify denied native admission and cancellation do not enter handlers. (crates/openclaw-node-host/src/runtime.rs:724, dc5abc1af8e7)
  • Compatibility and supply-chain inspection: Existing system-root and explicit-pin transports remain available, and Swift transports without the new request-lifetime interface retain their existing send path. Cargo adds a direct edge to already-locked tokio-rustls 0.26.4 without changing its source, version, or checksum. No persisted-format or installation-default change was found. (crates/openclaw-gateway-client/Cargo.toml:15, dc5abc1af8e7)

Likely related people:

  • giodl73-repo: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-17T00:01:25.661Z sha ffac53d :: blocked before merge. :: none
  • reviewed 2026-09-17T00:38:16.919Z sha caa8ce4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T01:07:12.099Z sha 54ae074 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T01:27:36.766Z sha a97e9bd :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T02:00:19.205Z sha a97e9bd :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T16:13:53.818Z sha 5e36cee :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T10:01:32.064Z sha dc5abc1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T10:13:28.166Z sha dc5abc1 :: needs maintainer review before merge. :: none

@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. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
Patrick-Erichsen and others added 5 commits September 16, 2026 16:20
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
Bind external SecTrust evaluation to the requested hostname before system trust or TOFU decisions, and route keepalive pings through a prioritized control channel so RPC write backlog cannot starve liveness checks.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
Keep the dedicated control channel while retaining Tokio select fairness so sustained outbound command traffic cannot starve inbound responses, events, or close frames.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
Use a valid TLS server leaf fixture, satisfy Swift lint, and move pending-request state into the existing support file to stay below the GatewayChannel line cap.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
@giodl73-repo
giodl73-repo force-pushed the user/giodl/native-node-ownership-seams branch from e396b51 to d84564e Compare September 16, 2026 23:21
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
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
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 2c44506f-c357-47e5-a867-91775df2093d
…e-ownership-seams

# Conflicts:
#	crates/openclaw-node-host/src/node.rs
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 20, 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 7559f6d into openclaw:main Sep 20, 2026
541 of 550 checks passed
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Merged via maintainer-approved exact-head admin squash after scoped review and preparation. Source head: dc5abc1. Landed squash: 7559f6d. The required aggregate failure was independently adjudicated as unrelated session-diagnostics baseline noise; the Node runtime conformance gate and all PR-scoped proof passed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…w#150344) thanks @giodl73-repo

Adds reusable native session, policy, TLS trust, cancellation, and keepalive ownership seams while preserving Gateway command authority. Prepared and reviewed at exact head dc5abc1; required aggregate failure adjudicated as unrelated session-diagnostics baseline noise. Co-authored-by: Gio Della-Libera <[email protected]>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

2 participants