fix(node): trust gateway session attribution only - #1072
Conversation
|
Codex review: found issues before merge. Reviewed August 2, 2026, 1:57 PM ET / 17:57 UTC. ClawSweeper reviewWhat this changesThe PR adds a post-handshake Gateway feature negotiation so Windows-node invocations prefer Gateway-stamped session envelopes and only use nested session keys with explicitly legacy Gateways. Merge readiness⛔ Blocked until real behavior proof is added - 9 items remain This member-authored draft is still necessary, but it is not safe to merge yet. The unchanged head retains all three previously reported P1 protocol regressions: it misses common legacy unknown-method errors, discards trusted request-envelope session attribution, and delays event cancellation behind capability negotiation. Priority: P1 Review scores
Verification
How this fits togetherThe Windows node receives Gateway WebSocket events and requests, extracts session correlation, then dispatches local capabilities such as command execution. This change inserts feature negotiation between connection handshake and invocation dispatch so the node can decide which session attribution source to trust. flowchart LR
A[Gateway connection] --> B[Handshake succeeds]
B --> C[Session-envelope feature negotiation]
C --> D[Gateway invoke or cancel traffic]
D --> E[Trusted session attribution]
E --> F[Local node capability]
F --> G[Gateway result or cancellation]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the authoritative-envelope trust boundary, but accept documented legacy unknown-method variants, retain trusted request-envelope session keys, and dispatch cancellation independently of feature negotiation with focused regression coverage and redacted real Gateway proof. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Targeted tests can feed a flat or mixed-case unknown-method response, a direct request containing params.sessionKey, and an invoke-plus-cancel sequence before negotiation resolves; the current PR code deterministically exhibits all three defects. Is this the best way to solve the issue? No. The feature-negotiation design can preserve the intended trust boundary, but its legacy classifier, direct-request attribution, and cancellation ordering must be corrected before it is a maintainable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ac00c5f4977. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
|
Adversarial maintainer review found blocking protocol regressions, so this draft should not be marked ready yet:
Please accept both string/object unknown-method errors case-insensitively, preserve trusted request-envelope attribution, and dispatch/respond to cancellation without waiting on negotiation. Current merge confidence is 35%. |
What Problem This Solves
Fixes an issue where the Windows node could trust nested caller session attribution or dispatch node invocation traffic before it knew whether the connected Gateway supported authoritative session envelopes.
Why This Change Was Made
The Windows node publishes the generic session-envelope feature after handshake, correlates the feature request response, queues invoke/input/cancel traffic in wire order during negotiation, and uses the legacy nested session key only after an explicit old-Gateway unknown-method response. Timeout and unrelated failures remain authoritative and fail closed.
This mirrors the OpenClaw node-host contract tracked by openclaw/openclaw#116528 without introducing passport, certificate, key-store, IdP, SCIM, OAuth, or public identity surfaces.
User Impact
Windows node users retain compatibility with older Gateways while preventing caller-supplied nested data from overriding authoritative Gateway attribution on supported or indeterminate connections.
Evidence
WindowsNodeClient, capability, and exec-approval validation tests added;.NETis not installed in the authoring environment.