Repository navigation
feat(node): enroll with owner-approved OpenClaw ID invitations - #193993
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
d27d1a0 to
bc9b6b9
Compare
4f09040 to
40096b0
Compare
|
Codex review: needs maintainer review before merge. What this changesAdds owner-approved OpenClaw ID node enrollment through node join and connect, with foreground execution or service installation. Example: A Linux build node joins with only system.which enabled.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR completes a useful, owner-approved enrollment path missing from main; prior findings are addressed, and no new actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe CLI prepares the node’s command manifest, redeems an invitation through Discovery, verifies signed membership, and passes the target to the existing node runner; Gateway authority controls pairing and execution. flowchart LR
A[Node CLI] --> B[Prepared command manifest]
B --> C[Signed enrollment]
C --> D[Discovery mailbox]
D --> E[Owner approval]
E --> F[Verified node target]
F --> G[Existing node runner]
G --> H[Gateway live authority]
Technical reviewBest possible solution: Land the shared enrollment flow with existing Gateway authority and persistence owners once current-head CI passes. Do we have a high-confidence way to reproduce the issue? This is a new capability; source inspection confirms main has tunnel transport and Gateway admission but lacks the invitation-enrollment CLI path. Is this the best way to solve the issue? The implementation is a coherent enrollment stage that reuses protocol verification, node runtime preparation, Gateway authorization, SQLite configuration, supervision, and service installation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 99b8d7070664. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +438, Tests +542, Docs +80, Other +5. Total +1065 across 19 files. Added test files: 2. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)Reviewed November 8, 2026, 9:43 PM ET / November 9, 2026, 02:43 UTC (Revision 3). |
d01a6fb to
3dae3d4
Compare
40096b0 to
b7abc8d
Compare
3dae3d4 to
f99ba0c
Compare
b7abc8d to
1b404a8
Compare
a032fd8 to
52fc558
Compare
5771dc0 to
be89be8
Compare
52fc558 to
4c1be1f
Compare
Refs openclaw-517.5
Restore the loadNodeTunnelKey export the join flow uses, and cover Gateway refusal of unlisted and removed node principals.
70d8109 to
7cf477a
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Landed despite one inherited CI failureThe test-line ratchet was the only failure in CI run 42551795330 (
Every other check passed, including |
…law#193993) * feat(node): enroll with owner-approved OpenClaw ID invitations Refs openclaw-517.5 * fix(node): refuse re-enrollment while the node is still admitted Restore the loadNodeTunnelKey export the join flow uses, and cover Gateway refusal of unlisted and removed node principals. * fix(node): supervise foreground node join like connect * test(node): explain join orchestration mock isolation * fix(node): name recovery steps when enrollment verification fails
Related: #193982 (node transport, merged), #194001 (Gateway node admission, merged), #194007 (Access node invites, merged), #195507 (one automatic node pairing per approved listing, merged; found by this PR's live proof)
What Problem This Solves
Headless nodes need an owner-approved way to join an OpenClaw ID claw without a user account or a Gateway token.
User Impact
Adds
openclaw node join <openclaw-node-link>and sends the same link throughopenclaw connect. The node shows a six-digit code and its signed command list. The owner compares the code and approves on the Access page. After approval, the node checks that it was admitted, then connects in the foreground, or installs a user service with--service.--discovery-urlor reuse the one saved with the node's target; there is no production default. The origin is never derived from the claw hostname or relay URL.node joinnow refuses a node that is still admitted, and leaves the new invitation unused. To change a node's commands, the owner removes it on the Access page and sends a new link. Plain reconnects useopenclaw node runor the installed service.node joinnow runs under the packaged node supervisor, the same asconnect. Supervisor restarts usenode run, never the one-time link.Why This Change Was Made
The node signs the command manifest it actually prepared, with its own local key, and Discovery only ever sees the redemption proof. Before the runner saves the target, the node checks the root, claw and hostname pins, the highest same-claw binding sequence it has seen, signed snapshot freshness, and its own listing. The first connection reuses that prepared runtime. The service is installed only after a successful first hello and a clean shutdown.
ClawSweeper's re-enrollment finding (P2). A membership snapshot lists node keys only; it says nothing about which invitation or description the owner approved. A node that is already admitted would therefore look approved before the owner had decided on the new invitation. The node now checks Discovery before mailing the redemption, and refuses if it is already listed. It doesn't wait on the new invitation, and it doesn't spend it.
Accepted edge (named in code). Suppose an earlier invitation for the same node key is still pending and the owner approves it later. That approval can also complete a newer join that is waiting. Binding completion to one specific invitation needs a signed per-invitation outcome, which doesn't exist yet and is tracked as openclaw-607; this PR adds no protocol statement. The Gateway pairs only the commands from the description the owner approved (
approveOpenClawIdNodePairing), so this edge can't widen what the node may run. A Discovery that lies about pending state can, at most, cause the same mismatch; it can't grant access.Authority at admission and execution. Gateway #194001 owns this. Admission resolves the tunnel peer against the Gateway's current authority, not Discovery's snapshot.
resolveGatewayConnectPolicyFailureand request dispatch then re-checkisOpenClawIdTunnelPrincipalCurrentbefore any work runs. A new real-Gateway test covers both cases. A node key the Gateway doesn't list (pending, or removed after the node fetched its descriptor) is refused before pairing. A live node session is closed with code 4001 on its next request once its listing is removed. Existing coverage includesauthority.nodes.test.ts, where pending nodes don't resolve and removal closes connections, and the pairing suite's stale-principal case.Stored data. This PR adds no new store, field or migration. Node config stays in SQLite
nodeHost.configv1, as in 2026.11.2. Theopenclaw-idtarget shape already shipped in #193982. Existing Gateway-mode targets keep loading unchanged; only an explicitnode joinreplaces the saved target. See Evidence for the upgrade check.Test lines. The allocation is 542, exactly this PR's net test-line delta. Against current main the ratchet reports 32 lines of slack; that headroom was already on main and isn't allocated by this PR.
Evidence
refuses re-enrollment while old membership still lists W, before spending the inviteis red against the previous enrollment source and green with the fix.["node","join"]supervised-restart case.pnpm tsgo:core, scoped oxlint and oxfmt, andpnpm deadcode:exportsall passed with 0 entries.loadNodeTunnelKeyis exported again becauseopenclaw-id-join.tsuses it; fix(ci): remove unused OpenClaw ID node exports #195338 had made it private. The mock-isolation ratchet passes; each orchestration mock in the join suite states why it is isolated.nodeHost.configv1 and paired. The PR head'snode runwith no flags then loaded that config and connected with the existing pairing (0 pending requests). The config bytes were unchanged (same hash). A failednode join(Discovery unreachable) left the config unchanged apart from creating the node's 0600 endpoint key, andnode runconnected again afterwards. Note: main is versioned 2026.11.1, so a 2026.11.2 → PR head run is a version downgrade and stops at the newer-config check; that is why the upgrade was seeded from 2026.10.10.7cf477a8e9e5: 73 passed, 52 skipped, 0 failed. Current headeac8b7f06c2f: CI is running.eac8b7f(ClawSweeper P3, after the live run): failed descriptor or membership verification now names a recovery step. A stale membership snapshot asks the operator to have the claw owner check that the Gateway is online and connected to OpenClaw ID, then join with a new link; an invalid descriptor asks them to check--discovery-urlwith the owner. Only error strings and the stale-snapshot test assertion changed; enrollment logic didn't. The live proof below ran on7cf477a, and the enrollment, join and connect suites pass 46/46 ateac8b7f.git range-diff ac26a0d7f1f8..70d8109b8a56 origin/main..7cf477a8e9e5shows all 4 commits unchanged (=).Live proof on the staging testnet (build
7cf477a, this PR's head)Setup:
7cf477a8e9e5with its own profile, port and state, and linked as the throwaway staging clawocid517proof2-e61zr.crabd.xyz. The Studio's own Gateway wasn't touched.?session=main. Node admission doesn't depend on this.All 9 checks passed in one run:
794-600) and the owner selected Deny node. The invite readsdeniedand no node is listed. The waiting node never connected and, when cancelled, reported "no target was saved".865-003) and the owner approved. The Gateway loggedadmission allowed … path=relayand then repeated admissions withpath=direct. The node reportedconnected … via OpenClaw ID (direct), and its device was auto-paired asopenclaw-id-node.node.invoke system.whichover the tunnel returned{"bins":{"sh":"/usr/bin/sh"}}open, unused.socket hang up/ 1006. The Gateway logged no admission for its key: it was refused at relay/tunnel admission, before any Gateway stream.node runfrom the saved target never connected (socket hang up), and the Gateway logged no admission for that key between removal and the new approval.system.which,system.run)061-592) and approved. The Gateway then auto-paired the same device (approvedVia: openclaw-id-node, 0 pending Devices approvals).node.listshowssystem.runandsystem.which.system.whichworked, andsystem.run echoreturned exit 0 withstdout: "ocid517-ok".--service379-356). The join installed the isolated user unitopenclaw-node-ocid517svc.service, which becameactive. Aftersystemctl --user restart, the journal shows a newnode host gateway connected … (direct)andnode.listshows the node connected again.Path: every node was admitted over the relay first and then moved to a direct path, according to both the node diagnostics and the Gateway's tunnel log.
Before #195507: an earlier run on build
70d8109, against a claw since retired, passed steps 1–7. Step 8 then failed: after removal and a new approval, the Gateway answereddevice pairing requiredand left a non-repair pending node request. #195507 fixed that in the Gateway; step 8 above is the after.Cleanup:
Remaining limits: