openclaw-windows-node icon indicating copy to clipboard operation
openclaw-windows-node copied to clipboard

[TRACKING] Connect & pair reliably — local and remote

Open samanthamsong opened this issue 5 months ago • 1 comments

🦞 Tracking issue (epic) — this rolls up the scenario below. It holds no code itself; the work lives in the child issues (GitHub sub-issues). Track the progress bar; triage here, build there.

Outcome

I can connect and pair my node reliably, for local and remote gateways.

Definition of done

Pairing (incl. the QR flow) is robust for local and remote gateways, recovers from restarts, and we can test it when we make fixes.

Child issues

  • [ ] #710 — remote pairing broken (token scopes empty)
  • [ ] #720 — QR pairing stuck in "node" role
  • [ ] #667 — WebSocket handshake 1006 on WSL2

Backlog: One-pagers/FY27-Windows-Node-work-items.md • Narrative: User-scenarios/scenario-s2-connect-and-pair.md

samanthamsong avatar Jun 26 '26 18:06 samanthamsong

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 26, 2026, 2:22 PM ET / 18:22 UTC.

Summary Keep open: current main and merged connection hardening cover important local/QR pairing pieces, but the broader local-and-remote reliability outcome is not complete while the remote node token/scope approval child remains open and remote live gateway/node pairing is still a documented coverage gap.

Reproducibility: no. single high-confidence reproduction covers the full epic. The child issues include concrete source/live evidence for pieces of the problem, and remote gateway/node pairing remains explicitly under-validated on current main.

Root-cause cluster Relationship: canonical Canonical: https://github.com/openclaw/openclaw-windows-node/issues/832 Summary: This item is the tracking umbrella for related but distinct connection and pairing reports.

Members:

  • partial_overlap: https://github.com/openclaw/openclaw-windows-node/issues/667 - This child report covers WSL2 WebSocket/node connection, token mismatch, zero-command registration, and a separate TTS crash within the broader reliability outcome.
  • partial_overlap: https://github.com/openclaw/openclaw-windows-node/issues/710 - This child report covers remote gateway node token/scope approval and node-role rotation behavior within the broader pairing outcome.
  • partial_overlap: https://github.com/openclaw/openclaw-windows-node/issues/720 - This child report covers QR pairing role/device-token persistence and chat rejection within the broader pairing outcome.
  • fixed_by_candidate: https://github.com/openclaw/openclaw-windows-node/pull/741 - The merged PR fixed several Windows-client-side pairing and connection hardening pieces, but did not fully close the remote token/scope outcome tracked by the umbrella.

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

Ways to help us reproduce this

  • Add a screenshot or short recording showing the behavior.
  • Add expected vs actual behavior.
  • Include redacted logs or terminal output.

Next step This broad tracking epic has active child reports plus authorization-sensitive remote pairing work, so maintainers should triage the child set instead of sending one automated fix PR.

Security Needs attention: This issue is security-sensitive because the remaining remote pairing work affects scoped tokens, approval authority, and remote Windows node execution.

Review details

Best possible solution:

Resolve or explicitly supersede the child issues with release-backed QR/setup verification, live remote gateway token/scope validation, and automated setup/pair/reconnect coverage where practical.

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

No single high-confidence reproduction covers the full epic. The child issues include concrete source/live evidence for pieces of the problem, and remote gateway/node pairing remains explicitly under-validated on current main.

Is this the best way to solve the issue?

No single broad automated PR is the best way to solve this. The maintainable path is to resolve the concrete child issues, verify local and remote pairing/restart behavior, then close or split this tracking item.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • Remote VPS/reverse-proxy node-scope and node-role rotation behavior may require gateway-side changes outside this repository.
  • No single current-main live reproduction covers the entire local-and-remote epic end to end.
  • Some child issues may now be partially implemented, so maintainers may need to split or close children individually before closing this umbrella.

Codex review notes: model internal, reasoning high; reviewed against 1c377cb64b65.

Label changes

Label changes:

  • add P1: The epic tracks active pairing and remote Node Mode failures that can block users from connecting a Windows node or using the expected operator role.
  • add impact:security: Remote pairing, scoped node tokens, and node-role approval sit on the authorization boundary for remote Windows node execution.
  • add impact:message-loss: The QR pairing child documents chat sends being rejected when the tray is connected under the wrong role.
  • add impact:auth-provider: The remaining work centers on bootstrap, shared, operator-device, and node-device token selection, scopes, pairing approvals, and role-specific credentials.
  • add issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.
  • add clawsweeper:needs-info: Current issue advisory state selects this label.
  • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
  • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
  • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
  • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.
  • add clawsweeper:needs-security-review: Current issue advisory state selects this label.

Label justifications:

  • P1: The epic tracks active pairing and remote Node Mode failures that can block users from connecting a Windows node or using the expected operator role.
  • impact:security: Remote pairing, scoped node tokens, and node-role approval sit on the authorization boundary for remote Windows node execution.
  • impact:message-loss: The QR pairing child documents chat sends being rejected when the tray is connected under the wrong role.
  • impact:auth-provider: The remaining work centers on bootstrap, shared, operator-device, and node-device token selection, scopes, pairing approvals, and role-specific credentials.
Evidence reviewed

Security concerns:

  • [medium] Remote node token scope contract needs owner review The remote child report and collaborator follow-up leave node token scopes, node-role rotation, and external gateway approval behavior unresolved, which affects whether remote node execution is authorized correctly. Confidence: 0.82

Acceptance criteria:

  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore
  • OPENCLAW_RUN_E2E=1 dotnet test ./tests/OpenClaw.E2ETests/OpenClaw.E2ETests.csproj -r win-x64 --no-restore

What I checked:

  • Repository policy read: AGENTS.md was read fully; its connection, pairing, credential precedence, GatewayConnectionManager ownership, and test-isolation guidance shaped the review scope. (AGENTS.md:1, 1c377cb64b65)
  • Tracking issue scope: The issue body states this is a tracking epic and lists child issues for remote pairing, QR role/device-token persistence, and WSL2 WebSocket handshake failure.
  • Current client-side pairing hardening: Current main stores setup-code credentials as bootstrap credentials, forces the fresh bootstrap for immediate setup-code connect, clears stored role tokens for a fresh pairing attempt, and reconnects after bootstrap handoff only when durable operator/shared credentials are available. (src/OpenClaw.Connection/GatewayConnectionManager.cs:521, 1c377cb64b65)
  • Credential precedence invariant: CredentialResolver still enforces device token, then shared gateway token, then bootstrap token for operator and node connections, matching the repository policy that paired devices must not be downgraded. (src/OpenClaw.Connection/CredentialResolver.cs:31, 1c377cb64b65)
  • Node capability binding and stale-event hardening: NodeConnector fires ClientCreated before connecting so capabilities can be registered before handshake, and GatewayConnectionManager guards node attempts by lifecycle/node generation. (src/OpenClaw.Connection/NodeConnector.cs:96, 1c377cb64b65)
  • Remote coverage gap remains: The test coverage document still lists full live gateway/node pairing against a remote gateway as not fully covered by automated tests. (docs/TEST_COVERAGE.md:95, 1c377cb64b65)

Likely related people:

  • ranjeshj: Merged PR 741 spans the central connection, pairing, credential, node connector, setup-code, and E2E files involved in this umbrella. (role: recent connection hardening contributor; confidence: high; commits: ea36b12f9e4c; files: src/OpenClaw.Connection/GatewayConnectionManager.cs, src/OpenClaw.Connection/NodeConnector.cs, src/OpenClaw.Shared/OpenClawGatewayClient.cs)
  • Vincent Koc: Recent history shows reconnect/startup state work adjacent to the pairing and credential-source surfaces used by this tracking issue. (role: recent adjacent contributor; confidence: medium; commits: 260fb90c6dc7; files: src/OpenClaw.Connection/GatewayConnectionManager.cs)
  • Scott Hanselman: Current main is a recent commit by this contributor and nearby history includes setup/E2E gating work adjacent to connection validation. (role: recent adjacent contributor; confidence: low; commits: 1c377cb64b65; files: tests/OpenClaw.E2ETests/Setup/SetupAndConnectTests.cs)
How this review workflow works
  • 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.

clawsweeper[bot] avatar Jun 26 '26 18:06 clawsweeper[bot]