Repository navigation
fix(node): reconnect after OpenClaw ID server rotation - #194459
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
70d8109 to
7cf477a
Compare
b697e1b to
92bbf99
Compare
Refresh signed Discovery authority before every tunnel dial and periodic probe. Persist stronger binding and membership facts before acting, retain them on refused re-enrollment, and merge trust through the canonical SQLite owner. Document invitation secrecy as the pairing threat-model limit. Verified with baseline regressions, isolated native transport and Gateway flows, SQLite durability, focused tests, targeted static checks, and independent review.
92bbf99 to
7863d1d
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
7863d1d to
58ac569
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landing note (maintainer): ClawSweeper could not review this PR, and that was not caused by anything in this PR's final code.
|
|
Merged via squash.
|
* fix(node): refresh OpenClaw ID authority before reconnecting Refresh signed Discovery authority before every tunnel dial and periodic probe. Persist stronger binding and membership facts before acting, retain them on refused re-enrollment, and merge trust through the canonical SQLite owner. Document invitation secrecy as the pairing threat-model limit. Verified with baseline regressions, isolated native transport and Gateway flows, SQLite durability, focused tests, targeted static checks, and independent review. * test(node): reset pre-mail admission fixture for rejoin refusal * fix(node): keep verified OpenClaw ID trust when Discovery routing is invalid * fix(node): let preview OpenClaw ID targets rejoin with an explicit Discovery origin * test: size the node ID reconnect test allocation exactly * test(node): document runner config mock isolation * docs(node): route preview-target recovery through owner removal * fix(node): report OpenClaw ID connection refusals to the node operator * fix(node): explain an unsigned Discovery refusal of a removed node * test(node): build synthetic userinfo URLs at runtime for the review scanner --------- Co-authored-by: jalehman <[email protected]>
Related: #193993, #193982
What Problem This Solves
Fixes: a saved OpenClaw ID node keeps dialing the Gateway server key it learned at enrollment, so it cannot reconnect after the Gateway honestly rotates that key.
User Impact
User impact: nodes refresh and verify the claw's current signed server authority and membership before every connection, follow an honest server-key rotation without rejoining, close a connection whose server key was replaced, and keep learned trust across restarts and refused rejoins. A node whose access was removed stops with a rejoin instruction, and the reason for any other refusal is printed once instead of a bare connection failure.
openclaw nodeconfig loading. It still never connects: the owner removes the node on the Access page, then it rejoins with a new link and--discovery-url, keeping its verified trust.Why This Change Was Made
Enrollment and reconnect share one node-signed Discovery client and descriptor verifier. Before each dial and periodic probe, the node verifies the binding, snapshot freshness and its own membership. The canonical SQLite writer saves the strongest binding, the membership order and the binding-retirement facts before any dial, without touching unrelated node settings. If that save fails, the node stops.
Rebased onto
mainafter #193993. Its pre-mail re-enroll refusal, recovery-hint messages,loadNodeTunnelKeyexport and supervised foreground join are kept. Maintainer follow-up commits on top of Josh Avant's commit:discoveryUrlload for an explicit-origin rejoin, but the runner refuses to dial them.Evidence
ftp:, embedded credentials) keep binding 2 and snapshot 3, then refuse the older binding-1 evidence;discoveryUrlloads, refuses to dial, keeps stronger trust on a refused rejoin, and adopts the explicit origin on an admitted rejoin;both streaming transfer routes use the same private bridge(ECONNRESET), fails the same way on unmodifiedorigin/mainon the same host.pnpm tsgo:core, changed-file oxlint and format,git diff --check, the mock-export ratchet and knip pass. The test-line ratchet againstorigin/mainpasses with an exact allocation (+776, slack 0).deadcode:exportsreports only untouched exports insrc/daemon/launchd.tsandui/.../dashboard-tools.tsx, so that failure comes frommain.92bbf99, CI failed onlychecks-node-changed-12. Twoupdate-command-resume-completion.test.tscases failed because their Doctor fixture timed out (exit 124) under Bun. This PR does not touch that file, and it passes locally (11 of 11). At head7863d1d, all CI checks pass, includingchecks-node-changed-12,Scan changed paths (precise),check-lint-core-2andopenclaw/ci-gate.URIdetector) refused two synthetichttps://user:…@test fixtures: one added here and one already onmaininopenclaw-id-target.test.ts. Both fixtures now build their userinfo at runtime. A local TruffleHog scan of all changed files at58ac569reports 0 findings. That head changes only those two tests and the line allocation.Live proof
The proof ran 7 of 7 steps green on build
92bbf99, against staging OpenClaw ID and Discovery with a throwaway claw.env -iand isolated profiles.relay_urlor replay an earlier captured response.iroh:3abd…→iroh:c952…). The same node ID reconnected in about 7 s without rejoining.system.whichran over the new connection. The saved target is binding 2 with the new key, snapshot seq 3.Possible claw substitution: rollback. No connection while the replay was served. The node connected once current evidence returned, without a restart.ftp://…Discovery returned an invalid relay URL…, and nothing was dialed. The saved target advanced to binding 3 with the new key and kept the previous relay. A replay of binding 2 was then refused (rollback), and the node connected on current evidence.discoveryUrlnode runexits with the owner-removal and re-join guidance and makes no Discovery request.node join --discovery-urlloads the profile, the owner approves, and the node connects. The saved target has the explicit origin and binding 3.OpenClaw ID node access was removed or is not admitted; re-join this node. A restarted node never connected.Gaps:
mainhas no Gateway command that rotates the server key. Proof-only plumbing stopped the isolated Gateway, generated a new endpoint key, and signedServerBinding(seq+1)for it with the claw root from the throwaway recovery kit. The unmodified Gateway then republished on start.92bbf99the restarted node retried silently on Discovery's 403. On7863d1d, a rerun against the same removed node printsDiscovery does not list this node for the claw; retrying. If the owner removed this node, re-join it with a new link.and does not dial.Cleanup: the throwaway claw was retired from staging Discovery. The isolated Gateway was stopped, and its profile was backed up and removed. The local node profiles, proxy and secrets were removed, and the staging lock was released.