Skip to content

fix(nodes): show pending requestIds when approve fails with unknown requestId - #95001

Closed
lsr911 wants to merge 1 commit into
openclaw:mainfrom
lsr911:fix/issue-94040-Bug-nodes-approve-failed-G
Closed

lsr911 wants to merge 1 commit into
openclaw:mainfrom
lsr911:fix/issue-94040-Bug-nodes-approve-failed-G

Conversation

@lsr911

@lsr911 lsr911 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

When openclaw nodes approve <requestId> fails with "unknown requestId", the CLI now lists the current valid pending requestIds so users can identify the correct request without guessing.

Problem

Running openclaw nodes approve <requestId> with a stale or typo'd requestId produces an opaque GatewayClientRequestError: unknown requestId error. Users have no way to discover which requestIds are valid without running openclaw nodes pending separately.

Root Cause

The gateway returns INVALID_REQUEST / "unknown requestId" when the requestId is not found in the pending list, but the CLI passes this error through without surfacing the currently valid pending requestIds. See src/cli/nodes-cli/register.pairing.ts:107-121.

Changes

  • src/cli/nodes-cli/register.pairing.ts — add isUnknownNodePairRequestIdError detector and buildUnknownRequestIdHint that fetches pending requests; wrap approve call in try/catch to surface the hint when the specific error is detected
  • src/cli/nodes-cli/register.pairing.unknown-request-id.test.ts — add tests for the hint with pending IDs, fallback when list fails, and non-intercept of unrelated errors

Testing

3 new tests cover: pending IDs displayed, fallback when listing fails, non-unknown-requestId errors pass through unchanged. Full CI needed (no local pnpm).

Related

Closes #94040
参考 #94452 — 采用相同的 error detection + hint 模式,改进 toString/error 处理方式
参考 #94532 — 该 PR 尝试在 gateway 端做 idempotent 修复但引用了不存在的 getPairedNode 函数

…equestId

When openclaw nodes approve fails with "unknown requestId", the
error message gave users no actionable guidance. This adds a hint
that lists current pending requestIds and points to the
openclaw nodes pending command for inspection.

- Add isUnknownNodePairRequestIdError helper to detect the specific
  GatewayClientRequestError / INVALID_REQUEST unknown requestId error
- Add buildUnknownRequestIdHint to fetch pending requests and
  build a descriptive error message
- Wrap the approve call in try/catch to intercept unknown requestId
  errors and surface the hint with pending IDs

Closes openclaw#94040
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

This PR is a useful attempt at the nodes approval error, but it is not the best landing path: the same central fix is already covered by the open, proof-positive #94452, while this branch still has a user-visible formatting defect and no real behavior proof.

Root-cause cluster
Relationship: superseded
Canonical: #94452
Summary: This PR targets the same nodes approval unknown-requestId bug as the proof-positive focused CLI candidate, while the canonical issue remains the user report behind both branches.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this parallel branch, review or land #94452 as the focused fix, and carry over any desired extra fallback tests there if maintainers want broader coverage.

So I’m closing this here and keeping the remaining discussion on #94452.

Review details

Best possible solution:

Close this parallel branch, review or land #94452 as the focused fix, and carry over any desired extra fallback tests there if maintainers want broader coverage.

Do we have a high-confidence way to reproduce the issue?

Yes, source inspection shows current main returns unknown requestId from node.pair.approve and the nodes CLI wrapper renders that raw gateway error. I did not run the Windows Companion plus Kubernetes port-forward setup live.

Is this the best way to solve the issue?

No for this branch: the focused approach is right, but #94452 already implements the same CLI-layer fix with better message formatting and real behavior proof.

Security review:

Security review cleared: The diff only changes nodes CLI error rendering and mocked CLI tests, with no dependency, workflow, secret, permission, auth-policy, or storage changes.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • fuller-stack-dev: Authored recent nodes reapproval diagnostics and pending pairing cleanup work touching the same node pairing state and diagnostics area. (role: recent area contributor; confidence: medium; commits: 65b460f2345a; files: src/gateway/server-methods/nodes.ts, src/infra/node-pairing.ts)
  • steipete: History shows repeated node pairing, approval-scope, CLI, and gateway method work across the central files. (role: historical feature owner; confidence: high; commits: 01a24c20bfb7, ca2fdcc45f36, 7fb2a356e8f2; files: src/cli/nodes-cli/register.pairing.ts, src/gateway/server-methods/nodes.ts, src/infra/node-pairing.ts)
  • joshavant: Authored the node approval scope request fix in the same nodes approve CLI path. (role: adjacent CLI approval-scope contributor; confidence: medium; commits: e1c1c5724281; files: src/cli/nodes-cli/register.pairing.ts)
  • jacobtomlinson: Authored earlier gateway node pairing approval restriction and scope-hardening work that defines the approval semantics this CLI wraps. (role: adjacent approval/auth owner; confidence: medium; commits: 4d7cc6bb4fac; files: src/gateway/server-methods/nodes.ts, src/infra/node-pairing.ts)

Codex review notes: model internal, reasoning high; reviewed against 6ef4684b89a0.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: nodes approve failed: GatewayClientRequestError: unknown requestId

1 participant