Skip to content

fix(cli): keep nodes list aligned with nodes status - #72619

Merged
vincentkoc merged 3 commits into
mainfrom
clownfish/ghcrawl-156588-autonomous-smoke
Apr 27, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
clownfish/ghcrawl-156588-autonomous-smoke

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

Credit

This carries forward the active work by @skainguyen1412 in #65772 and preserves credit for earlier related work and review data from #50871, #50970, #51027, #51051, and #51053.

Validation

  • pnpm -s vitest run src/cli/program.nodes-basic.e2e.test.ts
  • pnpm check:changed

Notes

Merge is blocked until the failing hydrated checks for #65772 are repaired or proven unrelated by the executor and Codex /review is clean after the final diff.

ProjectClownfish replacement details:

@vincentkoc vincentkoc added the clawsweeper Tracked by ClawSweeper automation label Apr 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Apr 27, 2026
@greptile-apps

greptile-apps Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the nodes list / nodes status source-of-truth mismatch by merging the node.list effective view into the pairing-list result and falling back to pairing-only data when the endpoint is unavailable (older gateways). The core logic is sound, but there are two issues in the updated nodes list handler worth addressing.

  • Wrong filter-label denominator (P1): filteredLabel divides by paired.length (original pairing list) instead of pairedRows.length (post-merge total). When catalog-only nodes from node.list are merged in, the (of N) count understates the real pre-filter total.
  • Variable shadowing (P2): The inner const pairedRows at the table-rendering block shadows the outer const pairedRows = mergePairedNodesWithEffectiveNodes(…), which can confuse readers and will trip no-shadow linting rules.

Confidence Score: 3/5

Safe to merge only after fixing the filter-label denominator; the mismatch produces incorrect user-visible counts when catalog-only nodes are present and a filter flag is used.

One P1 finding (wrong denominator in filter label) sets the ceiling at 4/5; combined with a P2 shadow-variable issue, the score is pulled to 3/5.

src/cli/nodes-cli/register.status.ts — specifically the filteredLabel calculation and the inner pairedRows binding inside the table-rendering block.

Comments Outside Diff (1)

  1. src/cli/nodes-cli/register.status.ts, line 415-416 (link)

    P1 Filter label denominator is wrong after merge

    filteredLabel compares filteredPaired.length against paired.length (the raw pairing-list count), but after merging with effectiveNodes, pairedRows can contain additional catalog-only entries (nodes in node.list with paired: true that weren't in the pairing list). If any such nodes exist and a filter is active, the label will read e.g. "2 (of 3)" when the real pre-filter total is 5, misleading users about how many nodes were hidden.

    The denominator should be pairedRows.length:

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/cli/nodes-cli/register.status.ts
    Line: 415-416
    
    Comment:
    **Filter label denominator is wrong after merge**
    
    `filteredLabel` compares `filteredPaired.length` against `paired.length` (the raw pairing-list count), but after merging with `effectiveNodes`, `pairedRows` can contain additional catalog-only entries (nodes in `node.list` with `paired: true` that weren't in the pairing list). If any such nodes exist and a filter is active, the label will read e.g. `"2 (of 3)"` when the real pre-filter total is `5`, misleading users about how many nodes were hidden.
    
    The denominator should be `pairedRows.length`:
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/cli/nodes-cli/register.status.ts
Line: 415-416

Comment:
**Filter label denominator is wrong after merge**

`filteredLabel` compares `filteredPaired.length` against `paired.length` (the raw pairing-list count), but after merging with `effectiveNodes`, `pairedRows` can contain additional catalog-only entries (nodes in `node.list` with `paired: true` that weren't in the pairing list). If any such nodes exist and a filter is active, the label will read e.g. `"2 (of 3)"` when the real pre-filter total is `5`, misleading users about how many nodes were hidden.

The denominator should be `pairedRows.length`:

```suggestion
          const filteredLabel =
            hasFilters && filteredPaired.length !== pairedRows.length ? ` (of ${pairedRows.length})` : "";
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/cli/nodes-cli/register.status.ts
Line: 439

Comment:
**Shadow variable `pairedRows` hides merge result**

The inner `const pairedRows` declared here (used only to build table rows) shadows the outer `const pairedRows` assigned at line 392 (the merged `PairedNodeListRow[]`). While it doesn't cause a runtime bug today, the shadowing is likely to confuse future readers and TypeScript/ESLint strict rules will flag it. Renaming the inner binding (e.g. `tableRows`) removes the ambiguity at zero cost.

```suggestion
            const tableRows = filteredPaired.map((n) => {
```
Then update the `renderTable` call's `rows` argument from `pairedRows` to `tableRows`.

```suggestion
            const tableRows = filteredPaired.map((n) => {
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(cli): keep nodes list aligned with n..." | Re-trigger Greptile

Comment thread src/cli/nodes-cli/register.status.ts Resolved
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-156588-autonomous-smoke branch from a742fd6 to 5dd42d7 Compare April 27, 2026 07:50
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-156588-autonomous-smoke branch from 5dd42d7 to 538669d Compare April 27, 2026 09:11
@vincentkoc

Copy link
Copy Markdown
Member Author

ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical.

Source PR: #72619
Validation: pnpm check:changed; pnpm -s vitest run src/cli/program.nodes-basic.e2e.test.ts
Contributor credit is preserved in the branch history and PR context.

@vincentkoc
vincentkoc merged commit a50edbd into main Apr 27, 2026
66 checks passed
@vincentkoc
vincentkoc deleted the clownfish/ghcrawl-156588-autonomous-smoke branch April 27, 2026 09:39
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
* fix(cli): keep nodes list aligned with nodes status

* fix(clownfish): address review for ghcrawl-156588-autonomous-smoke (1)

* fix(cli): keep nodes list aligned with nodes status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper Tracked by ClawSweeper automation cli CLI command changes maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant