Skip to content

[Repo Assist] fix(setup): surface actionable error when gateway device-pair plugin is not loaded#747

Merged
shanselman merged 2 commits into
mainfrom
repo-assist/eng-device-pair-plugin-not-found-2026-06-11-8f330ecd7f643284
Jun 21, 2026
Merged

[Repo Assist] fix(setup): surface actionable error when gateway device-pair plugin is not loaded#747
shanselman merged 2 commits into
mainfrom
repo-assist/eng-device-pair-plugin-not-found-2026-06-11-8f330ecd7f643284

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist.

Relates to #677.

Problem

When a user's gateway CLI is older than 2026.6.0, the device-pair plugin is not loaded, and openclaw nodes list --json / openclaw nodes approve exit non-zero with:

plugins.entries.device-pair: plugin not found: device-pair

Previously AutoApproveNodePairing and AutoApprovePairing returned StepResult.Fail with the raw CLI output and then retried three times before ultimately surfacing a vague failure message:

"Could not list pending node pairing requests (exit 1): ..."

The user had no clear indication that the root cause was their gateway version.

Fix

  • Added ApprovalRequestHelper.IsPluginNotFoundError(string output) — a lightweight string check for the "plugin not found" substring (case-insensitive).
  • Added ApprovalRequestHelper.PluginNotFoundMessage — a shared, actionable message text directing users to upgrade to 2026.6.0+.
  • Applied detection at three failure points:
    • AutoApproveNodePairing → listing pending requests fails
    • AutoApproveNodePairing → approval command fails
    • AutoApprovePairing → approval command fails
  • Returns StepResult.Terminal (non-retriable) so the setup engine stops immediately with a clear message instead of retrying.

Trade-offs

The detection is a simple substring match. If a future gateway release changes the error wording, it will fall through to the existing Fail path (no regression, just loses the improvement). No new dependencies.

Test Status

Passed! — Failed: 0, Passed: 253 (out of 254), Skipped: 0

The 1 failure (Constructor_SetsLocalDataDirFromLocalAppDataRootEnvironment) is pre-existing on main and unrelated to this change (confirmed by running the same test against main with identical infrastructure). All ApprovalRequestHelper tests, including the 7 new IsPluginNotFoundError tests, pass.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

@clawsweeper

clawsweeper Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 18, 2026, 5:19 AM ET / 09:19 UTC.

Summary
Adds device-pair plugin-not-found detection to setup pairing approval paths, returns a terminal upgrade message, and adds helper/step tests that keep unrelated plugin failures retriable.

Reproducibility: yes. at source level: current main returns retriable raw-output failures for the reported non-zero pairing commands, and the linked user logs show the old gateway emitted the device-pair plugin diagnostic. I did not run a live old gateway reproduction in this read-only review.

Review metrics: 3 noteworthy metrics.

  • Pairing failures changed: 3 paths. All changed production paths convert the known device-pair plugin failure from retryable to terminal.
  • Regression coverage added: 9 matcher inputs, 6 step outcomes. The updated branch now covers both the classifier and the terminal-vs-retriable setup behavior requested by the previous review.
  • Patch surface: 4 files, +132/-3. The diff is narrow and concentrated in setup approval handling and tests.

Root-cause cluster
Relationship: partial_overlap
Canonical: #677
Summary: This PR partially addresses the open setup report by improving the old-gateway device-pair diagnostic, but it does not own the broader rollback/deletion behavior from the canonical issue.

Members:

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

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Post redacted after-fix output or logs from a gateway missing the device-pair plugin.
  • Keep tokens, IP addresses, phone numbers, non-public endpoints, and other private details redacted in the proof.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Only unit/CI test status is posted; add redacted terminal output, setup logs, or a recording from an affected gateway, then update the PR body or ask a maintainer to comment @clawsweeper re-review if it does not refresh.

Risk before merge

  • [P1] No real affected-gateway proof shows the final user-visible setup message or confirms the exact stdout shape on a gateway that lacks the device-pair plugin.
  • [P1] Current main now installs gateway LKG 2026.6.8 by default, so this PR mainly protects older/custom gateway paths; maintainers should keep it scoped as compatibility diagnostics rather than treating it as the broader rollback fix.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the narrow diagnostic after redacted affected-gateway proof shows setup stops immediately with upgrade guidance, while leaving the broader rollback/deletion policy tracked in OpenClawGateway being deleted/rolled back after the failed setup. #677.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] Human/contributor action remains: attach real affected-gateway proof or have a maintainer consciously override the proof gate; no concrete automated code repair remains.

Security
Cleared: The focused C# setup-engine and test changes add no dependency, permission, secret handling, downloaded artifact, workflow, or supply-chain surface.

Review details

Best possible solution:

Merge the narrow diagnostic after redacted affected-gateway proof shows setup stops immediately with upgrade guidance, while leaving the broader rollback/deletion policy tracked in #677.

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

Yes at source level: current main returns retriable raw-output failures for the reported non-zero pairing commands, and the linked user logs show the old gateway emitted the device-pair plugin diagnostic. I did not run a live old gateway reproduction in this read-only review.

Is this the best way to solve the issue?

Yes for the narrow diagnostic: the updated classifier is now specific to device-pair and has step-level regression coverage. The remaining gap is merge proof, not a clear code defect.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 234fa8ff097f.

Label changes

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded setup compatibility improvement for a user-blocking but older-gateway-specific pairing failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only unit/CI test status is posted; add redacted terminal output, setup logs, or a recording from an affected gateway, then update the PR body or ask a maintainer to comment @clawsweeper re-review if it does not refresh.
Evidence reviewed

What I checked:

  • Current main behavior: Current main still returns retriable StepResult.Fail with raw stdout for device and node approval/list failures, so the requested terminal upgrade guidance is not already implemented. (src/OpenClaw.SetupEngine/SetupSteps.cs:1921, 234fa8ff097f)
  • Updated PR diff: The PR head now requires both plugin not found and device-pair before converting the pairing failure to StepResult.Terminal, and applies that check to three pairing failure paths. (src/OpenClaw.SetupEngine/ApprovalRequestHelper.cs:27, a87442e79e45)
  • Regression coverage: The updated branch adds matcher cases plus step-level tests for terminal device-pair failures and retriable unrelated-plugin failures. (tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs:1182, a87442e79e45)
  • Related user report: The linked report includes setup logs from a gateway CLI 2026.5.28 run and a later log line showing plugins.entries.device-pair: plugin not found: device-pair, supporting the compatibility diagnostic this PR targets.
  • Proof gate: The PR body and comments report unit/CI test status but do not include redacted terminal output, setup logs, a recording, or another after-fix artifact from a gateway missing the device-pair plugin. (a87442e79e45)
  • Feature history: Git blame ties the current approval helper and pairing approval/list paths to commit d5543b9, while recent setup/pairing hardening landed in ea36b12. (src/OpenClaw.SetupEngine/SetupSteps.cs:2327, d5543b904507)

Likely related people:

  • AlexAlves87: Git blame attributes the current ApprovalRequestHelper and AutoApprovePairing/AutoApproveNodePairing implementations to commit d5543b9, which created the SetupEngine files now touched by this PR. (role: introduced current setup-engine implementation; confidence: medium; commits: d5543b904507; files: src/OpenClaw.SetupEngine/ApprovalRequestHelper.cs, src/OpenClaw.SetupEngine/SetupSteps.cs)
  • ranjeshj: Recent merged history shows gateway connection and pairing hardening in commit ea36b12 and adjacent setup-step cleanup in d4284d4; the same collaborator also requested this re-review after updating the branch. (role: recent setup and pairing area contributor; confidence: high; commits: ea36b12f9e4c, d4284d43fb6a; files: src/OpenClaw.SetupEngine/SetupSteps.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)
  • Kevin Kaminski: Recent setup history includes gateway configuration timeout scaling in the same SetupSteps test area, making this a plausible secondary routing candidate for setup reliability review. (role: adjacent setup reliability contributor; confidence: low; commits: e821d6810498; files: src/OpenClaw.SetupEngine/SetupSteps.cs, tests/OpenClaw.SetupEngine.Tests/SetupStepsTests.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@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 priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jun 11, 2026
github-actions Bot and others added 2 commits June 17, 2026 22:50
…is not loaded

When the gateway CLI lacks the device-pair plugin (versions prior to
2026.6.0), 'openclaw nodes list --json' and 'openclaw nodes approve'
exit non-zero with output containing 'plugin not found: device-pair'.

Previously, AutoApproveNodePairing and AutoApprovePairing returned
StepResult.Fail with the raw CLI output and then retried 3 times before
reporting a vague failure. After retries the error surfaced as:
  'Could not list pending node pairing requests (exit 1): ...'

This change:
- Adds ApprovalRequestHelper.IsPluginNotFoundError to detect this pattern
- Returns StepResult.Terminal (non-retriable) with an actionable message
  pointing the user to upgrade their gateway to 2026.6.0+
- Covers both the 'list pending' and 'approve' command paths in
  AutoApproveNodePairing, and the 'approve' command path in AutoApprovePairing
- Adds tests for IsPluginNotFoundError in ApprovalRequestHelperTests

Relates to #677.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Require the missing-plugin classifier to identify device-pair before returning terminal setup guidance, and cover the pairing approval paths so unrelated plugin failures remain retriable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ranjeshj ranjeshj force-pushed the repo-assist/eng-device-pair-plugin-not-found-2026-06-11-8f330ecd7f643284 branch from 6013bf5 to a87442e Compare June 18, 2026 07:37
@ranjeshj

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 18, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Jun 18, 2026
@shanselman shanselman marked this pull request as ready for review June 21, 2026 06:22
@shanselman shanselman merged commit 2153c7e into main Jun 21, 2026
20 checks passed
@shanselman shanselman deleted the repo-assist/eng-device-pair-plugin-not-found-2026-06-11-8f330ecd7f643284 branch June 21, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. repo-assist status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants