Skip to content

fix(cli): stop pairing list crashing with empty channel enum#98142

Merged
RomneyDa merged 1 commit into
mainfrom
fix/pairing-list-empty-channel-enum
Jun 30, 2026
Merged

fix(cli): stop pairing list crashing with empty channel enum#98142
RomneyDa merged 1 commit into
mainfrom
fix/pairing-list-empty-channel-enum

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Problem

Running openclaw pairing list with no channel argument when no chat DM pairing channels are configured throws:

Channel required. Use --channel <channel> or pass it as the first argument (expected one of: )

The empty (expected one of: ) enum reads like a bug. The deeper UX trap is a naming collision: openclaw pairing manages chat DM pairing, but users reasonably reach for it when trying to approve a TUI/device or scope-upgrade request — which actually lives under openclaw devices. So they land on an opaque error for a command that was never going to help them.

Fix

src/cli/pairing-cli.ts:

  • Guard the supported-channel hint used in help text and error messages so an empty channel list no longer renders a bare () / (expected one of: ) (shows none configured instead).
  • When no pairing channels are configured, throw an actionable error that redirects to openclaw devices list / openclaw devices approve rather than failing with an empty enum.

Tests

src/cli/pairing-cli.test.ts:

  • pairing list with zero configured channels → error mentions openclaw devices, never emits () or expected one of: ), and does not call into the pairing store.
  • pairing list with multiple channels and no argument → still lists the supported channels (expected one of: telegram, discord, imessage).

All 15 tests in the file pass; oxlint clean on changed files.

Notes

  • Does not touch CHANGELOG.md (per CONTRIBUTING — maintainers/ClawSweeper add entries on landing).
  • This is one of a set of fixes for the device scope-upgrade approval flow; the related TUI copy, request-ID churn, and self-approval deadlock are separate PRs.
  • 🤖 AI-assisted (Claude Code), authored/reviewed by @RomneyDa.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS maintainer Maintainer-authored PR labels Jun 30, 2026
@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 9:39 AM ET / 13:39 UTC.

Summary
The PR updates openclaw pairing list help/error text for zero configured pairing channels and adds regression tests for zero-channel and multi-channel missing-channel cases.

PR surface: Source +7, Tests +24. Total +31 across 2 files.

Reproducibility: yes. at source level. Current main builds the missing-channel message from channels.join(", "), and listPairingChannels() can legitimately return an empty array when no pairing-capable chat channels are registered.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair lane is needed; this review-clean protected maintainer PR needs ordinary maintainer review or landing.

Security
Cleared: The diff only changes CLI help/error text and colocated tests, with no dependency, workflow, credential, permission, package, or code-execution surface change.

Review details

Best possible solution:

Land the narrow CLI message/test fix through normal maintainer review while keeping the broader device scope-upgrade recovery work tracked in #74484.

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

Yes, at source level. Current main builds the missing-channel message from channels.join(", "), and listPairingChannels() can legitimately return an empty array when no pairing-capable chat channels are registered.

Is this the best way to solve the issue?

Yes for the narrow bug. The fix stays at the CLI command boundary, preserves single-channel and explicit-channel behavior, and points device-pairing users to the existing devices command surface rather than inventing a new flow.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a low-risk CLI ergonomics bug fix for confusing help/error text, with no config, storage, auth, provider, or migration surface change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored PR with the protected maintainer label; PR-body test notes and green checks are supplemental evidence.
Evidence reviewed

PR surface:

Source +7, Tests +24. Total +31 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 6 +7
Tests 1 24 0 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 37 6 +31

What I checked:

  • Root policy read and applied: The full root policy was read; its deep-review, protected-label, and maintainer-item guidance affected this keep-open routing. (AGENTS.md:1, 6cb82eaab865)
  • Current-main bug path: Current main renders both the pairing list option/argument hint and missing-channel error with channels.join(", "), so an empty channel list can produce the reported empty enum. (src/cli/pairing-cli.ts:103, 6cb82eaab865)
  • Zero configured pairing channels are a real state: listPairingChannels() filters registered channel plugins by plugin.pairing, so installs with no pairing-capable chat channels can return an empty list. (src/channels/plugins/pairing.ts:12, 6cb82eaab865)
  • CLI entry point checked: The pairing command is registered through the core sub-CLI loader, so the changed function is the runtime command boundary for openclaw pairing. (src/cli/program/register.subclis-core.ts:215, 6cb82eaab865)
  • PR implementation inspected: The PR head computes a guarded channelHint, uses it in help text, and sends zero-channel no-argument users to the existing openclaw devices approve path without calling the pairing store. (src/cli/pairing-cli.ts:91, c47ffb5ab130)
  • Regression tests inspected: The PR adds coverage for no configured pairing channels avoiding expected one of: )/() and preserving the supported-channel list when multiple channels exist. (src/cli/pairing-cli.test.ts:227, c47ffb5ab130)

Likely related people:

  • vignesh07: Commit c0d5fc8d1e2f added the default-channel behavior for pairing commands, and 6cf7c02d4ac6 added account selector handling in the same command/test surface. (role: introduced current pairing CLI defaulting behavior; confidence: high; commits: c0d5fc8d1e2f, 6cf7c02d4ac6; files: src/cli/pairing-cli.ts, src/cli/pairing-cli.test.ts)
  • vincentkoc: Commits 938cc3628ccd and be1c38e692f2 recently changed parseChannel and pairing CLI error text, which is the same UX/error-message area this PR repairs. (role: recent CLI error-guidance contributor; confidence: high; commits: 938cc3628ccd, be1c38e692f2; files: src/cli/pairing-cli.ts)
  • steipete: Recent commits touched pairing CLI helper docs and pairing CLI test coverage, and earlier history added pairing alias/test behavior in this area. (role: recent pairing CLI docs/test contributor; confidence: medium; commits: 169a4159dee9, 408ba4c8a082, 1656f491fd61; files: src/cli/pairing-cli.ts, src/cli/pairing-cli.test.ts, docs/cli/pairing.md)
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 30, 2026
@RomneyDa RomneyDa changed the title fix(cli): stop pairing list crashing with empty channel enum (AI-assisted) fix(cli): stop pairing list crashing with empty channel enum Jun 30, 2026
When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).
@RomneyDa
RomneyDa force-pushed the fix/pairing-list-empty-channel-enum branch from 5d9a0cd to c47ffb5 Compare June 30, 2026 13:25
@RomneyDa
RomneyDa merged commit 44ec758 into main Jun 30, 2026
97 checks passed
@RomneyDa
RomneyDa deleted the fix/pairing-list-empty-channel-enum branch June 30, 2026 21:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 1, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 6, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).

(cherry picked from commit 44ec758)
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jul 8, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).

(cherry picked from commit 44ec758)
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
…law#98142)

When no chat DM pairing channels are configured, `openclaw pairing list`
(no channel argument) threw `Channel required ... (expected one of: )`
with an empty enum that reads like a bug. Users who hit this are usually
trying to approve a TUI/device or scope-upgrade request, which lives under
`openclaw devices`, not `openclaw pairing` (which only handles chat DM
pairing).

- Guard the channel hint in help text and errors so an empty channel list
  no longer renders a bare `()` / `(expected one of: )`.
- When no pairing channels exist, redirect to `openclaw devices list` /
  `openclaw devices approve` instead of failing opaquely.

AI-assisted (Claude Code).

(cherry picked from commit 44ec758)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant