fix(gateway): require node pairing before enabling node commands#57777
fix(gateway): require node pairing before enabling node commands#57777jacobtomlinson merged 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR closes a security gap in the gateway's node command access model: previously, a node that had completed device pairing but not full node pairing would still have its declared commands exposed at connect time. The fix collapses the two-branch
Confidence Score: 5/5Safe to merge — the logic change is minimal and well-scoped, and the new regression test directly covers the fixed path. All findings are P2 or below. The production change is a two-line simplification that removes a special-case null branch. The test helper uses the same connectNodeClient primitives already proven in the surrounding suite, and the regression test uses proper polling where needed. No data-loss, security, or correctness issues were identified. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/gateway/server/ws-connection/message-handler.ts | Two-line change that collapses the 'no pairing → null → allow all' branch into an always-empty Set when pairedNode is absent, correctly enforcing that commands are blocked until a node pairing record exists. |
| src/gateway/server.roles-allowlist-update.test.ts | Adds connectNodeClientWithNodePairing helper to perform full node pairing in test setup, updates two existing tests that expected command access to use it, and adds a regression test that verifies declared commands are blocked when only device pairing exists. |
Reviews (1): Last reviewed commit: "Gateway: require node pairing for node c..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34fe397048
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e9ae24aca
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
🤖 We're reviewing this PR with Aisle We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛ Progress:
Latest run failed. Keeping previous successful results. Trace ID: Last updated on: 2026-03-30T16:43:55Z Latest run failed. Keeping previous successful results. Trace ID: Last updated on: 2026-03-30T18:18:51Z |
…nclaw#57777) * Gateway: require node pairing for node commands * Gateway: request node pairing on initial connect * Gateway: filter pending node pairing commands
…nclaw#57777) * Gateway: require node pairing for node commands * Gateway: request node pairing on initial connect * Gateway: filter pending node pairing commands
|
This broke things conceptually, reverting. if I connect a node, node decides what it runs. not node AND gateway. |
Summary
Changes
Validation
pnpm test -- src/gateway/server.roles-allowlist-update.test.ts -t "blocks all declared commands until node pairing exists"pnpm test -- src/gateway/server.roles-allowlist-update.test.tspnpm checkclaude -p "/review"and addressed the follow-up test setup changes it impliedNotes