Repository navigation
fix(nodes): nodes approve and reject print "The CLI command failed." for an unknown request id - #198329
fix(nodes): nodes approve and reject print "The CLI command failed." for an unknown request id#198329yxshee wants to merge 1 commit into
Conversation
…for an unknown request id
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR makes unknown node pairing request errors display their explanation and recovery command on stderr. Example: Run openclaw nodes approve zz-nope with no pending pairing requests.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR fixes a current CLI diagnostic bug with a focused change, and no introduced defects were found; required workflows still await authorization. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe nodes CLI sends pairing requests to the Gateway and passes failures to the root CLI renderer, which produces JSON stdout and human-readable stderr. flowchart LR
A[Nodes approve or reject] --> B[Pairing CLI]
B --> C[Gateway pairing RPC]
C --> B
B --> D[Expected CLI error]
D --> E[Root failure renderer]
E --> F[JSON stdout and guidance stderr]
Technical reviewBest possible solution: Use the existing expected-error mechanism at both pairing refusal sites so the root renderer displays the established recovery guidance. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the failure path, and the contributor supplies matching before/after real CLI output; no target code was executed during this read-only review. Is this the best way to solve the issue? This is the smallest complete repair: reuse the established error type at the two producers and update existing regressions without adding another renderer or changing pairing policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 273a81799689. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +2. Total +3 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 13, 2026, 10:24 AM ET / 15:24 UTC. |
|
Thanks for the work here. We're closing this along with the author's other open PRs: the series splits one kind of change across many commands or call sites, and much of it is backed only by issues filed by the same author. Please open one issue per root cause with a reproduction from a real affected setup; maintainers will decide scope and fix it once at the shared owner. |
What Problem This Solves
Fixes:
openclaw nodes approve REQUEST_IDandopenclaw nodes reject REQUEST_IDprint only[openclaw] The CLI command failed.and a pointer toopenclaw doctoron stderr when the request id is not pending. The explanation that was written for this case (unknown id, the pending ids, runopenclaw nodes pending) only appears inside the JSON envelope on stdout.User Impact
User impact: stderr now shows the reason and the next step, in the same form as the other refusals of these commands. The JSON envelope on stdout and the exit code are unchanged.
Why This Change Was Made
nodes approveandnodes rejectown machine output, so their errors are rendered by the root error path and not by thenodeserror handler. That path prints the text of an expected error and hides a plainErrorbehind the generic line. The two unknown-request refusals were plain errors, so the explanation written for this case never reached the terminal in the real CLI. They are now raised withthrowExpectedCliError, as the unknown worktree id case is. The existing tests read the message from thenodeserror handler, which the real commands do not reach, so they now assert the error that the root path renders.Evidence
From source on
mainat 3a194b5, Linux, Node 24.22.2, fresh state directory, with a local Gateway running and no pending pairing requests.Before:
After:
Tests:
pnpm test src/cli/nodes-cli.coverage.test.ts: 31 passed.pnpm test src/cli/nodes-cli: 74 passed.main(the commands exit through thenodeshandler with a plain error) and pass with the fix. They still check the pending ids, the connection flag reminder, and that the URL and token are not echoed.pnpm check:test-lines-ratchet --staged,pnpm check:line-cap-ratchet,pnpm tsgo:core,oxfmt --checkandoxlint --type-awareon both files: clean.