Repository navigation
Keep Windows device metadata stable across reconnects - #1064
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Codex review: found issues before merge. Reviewed July 29, 2026, 12:13 PM ET / 16:13 UTC. ClawSweeper reviewWhat this changesThe PR replaces separate Windows operator and node handshake metadata literals with one shared canonical definition and adds tests for persistent device identity, serialized metadata, and v2/v3 handshake signatures. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep this PR open for maintainer review. The final commit strengthens the regression tests and reports a real signed-in Companion reconnect, but the branch still intentionally changes an already approved operator identity from Priority: P1 Review scores
Verification
How this fits togetherThe Windows Tray operates both an operator client and a Windows node client that can share a persisted device identity when connecting to a Gateway. Their connect metadata is signed and serialized during the handshake, and Gateway pairing can request repair when metadata differs from the approved record. flowchart LR
A[Persisted device identity] --> B[Windows operator client]
A --> C[Windows node client]
D[Shared Windows metadata] --> B
D --> C
B --> E[Signed connect request]
C --> E
E --> F[Gateway pairing decision]
F --> G[Connected session or metadata upgrade]
Decision needed
Why: The code intentionally canonicalizes operator metadata to Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Choose and document an upgrade-safe policy for already approved desktop operator records, then add a Gateway-backed regression proving that a legacy pair either reconnects without intervention or presents the intended one-time approval flow with a clear in-product recovery path. Do we have a high-confidence way to reproduce the issue? No high-confidence legacy-pair reproduction is included in the inspectable context. The source-level transition is clear: v3 operator handshakes move from Is this the best way to solve the issue? Unclear. Consolidating the metadata source is the maintainable repair for drift, but it is not yet established that forcing the new canonical value for already approved operator records is the best upgrade behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a4d22e03595b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7b9bc681-ce19-4a8b-b06c-94efb63a5f9f
|
Maintainer patch pushed as I tightened the regression coverage in two places:
Validation
Real behavior proofBuilt the candidate and ran it against an existing signed-in Companion data directory. Operator and node reconnects used the stored device token, emitted The configured WSL gateway explicitly negotiates V2, so live V3 proof is blocked on this host. I compared the V3 signing path with the current upstream gateway verifier: both ASCII-lowercase platform and family before signature verification, preserving the serialized |
Related to #1031
Root cause
The Windows operator and node clients share one persisted
DeviceIdentity, but their connect metadata had drifted. The node pinnedplatform=windowsanddeviceFamily=Windows; the operator signed with a different family and omitteddeviceFamilyfromconnect.params.client. After a Gateway or Companion restart, the same device identity and token could therefore reconnect with missing or different family metadata, correctly triggering ametadata-upgraderepair pairing.Change
OpenClawGatewayClientandWindowsNodeClient.WindowsClientMetadatawithplatform=windowsanddeviceFamily=Windows.Scope
Corrupt or unreadable identity-loader hardening is intentionally left to a separate PR. This change makes no OpenClaw core production changes and performs no stale pairing cleanup.
Validation
.\build.ps1: passed, all 5 projects.git diff --check: passed.Real behavior proof
An isolated synthetic restart test uses a temporary data directory and real
DeviceIdentitypersistence:DeviceId.platform=windowsanddeviceFamily=Windows.Live Gateway restart proof is not included because the existing E2E harness requires configured WSL Gateway credentials and real Gateway state.
Review
Compatibility
Identities previously pinned to
desktopor a missing family may require one legitimate metadata-upgrade approval when first moving to canonicalWindows. Subsequent reconnects retain the same metadata.