Repository navigation
fix(cli): read node liveness from the recorded node.list fact and drop dead nodes-CLI guards - #124348
Merged
Merged
Conversation
…p dead nodes-CLI guards Four nodes-CLI repairs at their owners: - nodes status --last-connected joined a second pairing-scoped RPC (node.pair.list) to reconstruct last-connection times the gateway already records on every node.list row (lastConnectedAtMs, max of stored pairing history and live connection, since 2dcd47d). The client-side join also preferred stored history over a live connection instead of taking the max, and made the command fail for callers whose auth grants operator.read but not operator.pairing. The filter now reads the recorded fact; connectedAtMs covers gateways predating it. - nodes list --connected blanked pending rows and then printed "Pending: 0" while requests waited — asserting a fact it never checked. Pending rows carry no connection state to filter on; they now always show. - nodes remove/rename carried unreachable !nodeId guards (resolveCliNodeId throws "node required" on blank input and every parse layer drops id-less rows) whose dead text pointed at the wrong command (nodes pending targets pairing requests, not paired nodes). Guards deleted; the reachable empty --name branch now hints at nodes list. - status.node-mode derived node-service liveness from the formatted runtimeShort display string — parsing a fact back out of its own projection, dead in all first-party call paths (both callers pass the runtime object it is derived from). Field and branch deleted. e2e test updated to pin the single-RPC shape (asserts node.pair.list is NOT called); node-mode fixtures now use the production shape.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 16, 2026 02:06
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 16, 2026
…p dead nodes-CLI guards (openclaw#124348) Four nodes-CLI repairs at their owners: - nodes status --last-connected joined a second pairing-scoped RPC (node.pair.list) to reconstruct last-connection times the gateway already records on every node.list row (lastConnectedAtMs, max of stored pairing history and live connection, since 0fdab28). The client-side join also preferred stored history over a live connection instead of taking the max, and made the command fail for callers whose auth grants operator.read but not operator.pairing. The filter now reads the recorded fact; connectedAtMs covers gateways predating it. - nodes list --connected blanked pending rows and then printed "Pending: 0" while requests waited — asserting a fact it never checked. Pending rows carry no connection state to filter on; they now always show. - nodes remove/rename carried unreachable !nodeId guards (resolveCliNodeId throws "node required" on blank input and every parse layer drops id-less rows) whose dead text pointed at the wrong command (nodes pending targets pairing requests, not paired nodes). Guards deleted; the reachable empty --name branch now hints at nodes list. - status.node-mode derived node-service liveness from the formatted runtimeShort display string — parsing a fact back out of its own projection, dead in all first-party call paths (both callers pass the runtime object it is derived from). Field and branch deleted. e2e test updated to pin the single-RPC shape (asserts node.pair.list is NOT called); node-mode fixtures now use the production shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Four nodes-CLI defects found by the round-6 TUI/CLI lane, all in the "stale/multi-signal derivation and dead-end guidance" class:
nodes status --last-connectedre-derived a recorded fact and broke for read-scoped callers. The gateway recordslastConnectedAtMson everynode.listrow (max of stored pairing history and live connection, since 2dcd47d). The CLI ignored it and joined a second pairing-scoped RPC (node.pair.list) — re-implementing the merge worse (preferring stored history over a live connection instead of taking the max) and making the whole command fail for callers whose auth grantsoperator.readbut notoperator.pairing, even though the needed fact was already in the response in hand.nodes list --connectedprinted "Pending: 0" while requests waited — the filter blanked pending rows and the header then asserted a fact it never checked, in both human and--jsonoutput, contradictingnodes pending.nodes remove/renamecarried unreachable guards with wrong advice.resolveCliNodeIdthrows"node required"on blank input and every parse layer drops id-less rows, so the!nodeIdguards were dead — and their text pointed atnodes pending, which lists pairing requests, not the paired nodes these commands target. The reachable empty---namebranch now hints atnodes list.status.node-modederived node-service liveness from the formattedruntimeShortdisplay string — parsing a fact back out of its own projection; dead in all first-party call paths (both callers pass theruntimeobject the string is derived from). Field and branch deleted.Why This Change Was Made
"Record facts where they happen; read them where they are needed" — the
--last-connectedfilter now reads the recorded row fact withconnectedAtMscovering gateways that predate it. Pending rows carry no connection state to filter on, so they always show. Dead guards and display-string parsing go per the lean-code doctrine.User Impact
nodes status --last-connectedworks for read-scoped callers and no longer under-reports live connections;nodes list --connectedstops lying about pending requests; error text points at commands that actually help.Evidence
node.pair.listis not called and the age filter works offnode.listrows (the old test cemented the double-RPC join).node scripts/run-vitest.mjs run src/commands/status.node-mode.test.ts src/shared/node-list-parse.test.ts— green; node-mode fixtures now use the production shape (runtime object).pnpm tsgo,pnpm check:test-types, oxfmt/oxlint clean; autoreview clean (0.99).Production LOC +12/−30 (net −18); tests +14/−16.