Repository navigation
Conversation
Greptile SummaryThis PR fixes an inconsistency between Key changes:
Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/cli/nodes-cli/register.status.ts
Line: 344-345
Comment:
**Unnecessary optional chaining on non-nullable map**
After the refactor, `connectedById` is now always a `Map` (created unconditionally on line 340) and can never be `null` or `undefined`. The `?.` optional chaining at lines 344 and 395 is therefore unnecessary and could be misleading to future readers who might wonder under what circumstances `connectedById` could be absent.
```suggestion
const live = connectedById.get(node.nodeId);
```
The same applies at line 395:
```suggestion
const live = connectedById.get(n.nodeId);
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "fix(cli): keep nodes..." |
| const live = connectedById?.get(node.nodeId); | ||
| if (!live?.connected) { |
There was a problem hiding this comment.
Unnecessary optional chaining on non-nullable map
After the refactor, connectedById is now always a Map (created unconditionally on line 340) and can never be null or undefined. The ?. optional chaining at lines 344 and 395 is therefore unnecessary and could be misleading to future readers who might wonder under what circumstances connectedById could be absent.
| const live = connectedById?.get(node.nodeId); | |
| if (!live?.connected) { | |
| const live = connectedById.get(node.nodeId); |
The same applies at line 395:
| const live = connectedById?.get(node.nodeId); | |
| if (!live?.connected) { | |
| const live = connectedById.get(n.nodeId); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/nodes-cli/register.status.ts
Line: 344-345
Comment:
**Unnecessary optional chaining on non-nullable map**
After the refactor, `connectedById` is now always a `Map` (created unconditionally on line 340) and can never be `null` or `undefined`. The `?.` optional chaining at lines 344 and 395 is therefore unnecessary and could be misleading to future readers who might wonder under what circumstances `connectedById` could be absent.
```suggestion
const live = connectedById.get(node.nodeId);
```
The same applies at line 395:
```suggestion
const live = connectedById.get(n.nodeId);
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cdc883edc
ℹ️ 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".
| ) | ||
| : null; | ||
| const filteredPaired = paired.filter((node) => { | ||
| const liveNodes = parseNodeList(await callGatewayCli("node.list", opts, {})); |
There was a problem hiding this comment.
Avoid requiring read scope for plain
nodes list
This unconditional node.list fetch makes openclaw nodes list fail for operators that only have pairing permissions. In src/gateway/method-scopes.ts, node.pair.list is allowed under operator.pairing, but node.list is gated by operator.read, so an unfiltered list request that used to succeed can now abort with an authorization error even though it only needs pairing data.
Useful? React with 👍 / 👎.
| ) | ||
| : null; | ||
| const filteredPaired = paired.filter((node) => { | ||
| const liveNodes = parseNodeList(await callGatewayCli("node.list", opts, {})); |
There was a problem hiding this comment.
Preserve fallback when the gateway lacks
node.list
This new hard dependency on node.list also regresses mixed-version setups where the CLI is newer than the gateway. Other code paths still treat unknown method: node.list as a compatibility case and fall back to node.pair.list (src/cli/nodes-cli/rpc.ts:79-95, src/agents/tools/nodes-utils.ts:41-64), but nodes list now throws before it can show the pairing data, so the command stops working outright against older gateways.
Useful? React with 👍 / 👎.
|
The only remaining failing check appears to be unrelated to this PR. It is failing in |
|
Closing this as duplicate or superseded after Codex automated review. Close as superseded by #65772. #50970 targets a real Best possible solution: Close #50970 as superseded and continue the maintainer review on #65772. The best fix is to make What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex Review notes: model gpt-5.5, reasoning high; reviewed against 76cf013df507. |
Fixes #50847.
Keeps
openclaw nodes listconsistent withopenclaw nodes statusby merging live paired nodes fromnode.listwhennode.pair.listis stale or temporarily missing a paired entry.Includes an e2e regression test covering the case where
nodes statussees a paired live node butnodes listwould otherwise reportPaired: 0.