openclaw - ✅(Solved) Fix [Bug]: Unknown CLI subcommands still suggest "add to plugins.allow" for arbitrary tokens (residual of #64732) [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#80109Fetched 2026-05-11 03:18:39
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
2
Timeline (top)
commented ×2closed ×1cross-referenced ×1

The narrow fix from #64732 (commit 82a8006f77) added the singular tool token to the reserved-non-plugin list, but the generic non-plugin classification layer that the issue's own Codex review recommended was not implemented. As a result, any unknown CLI subcommand still hits the missing-plugin fallback and emits the misleading "add to plugins.allow" guidance — even for clearly nonsensical tokens that could not possibly be plugin IDs.

This wastes operator time chasing nonexistent plugins. I just spent a Claude Code session being told to add approval (singular — there is no such bundled plugin) to my allowlist; cross-checking the bundled dist/extensions/ directory and openclaw plugins list --json confirmed no such plugin exists. The error message is the only signal, and it's actively misleading.

Error Message

$ openclaw nonexistent-fake-command --help [openclaw] Failed to start CLI: Error: The openclaw nonexistent-fake-command command is unavailable because plugins.allow excludes "nonexistent-fake-command". Add "nonexistent-fake-command" to plugins.allow if you want that bundled plugin CLI surface. at runCli (file:///.../dist/cli/run-main.js:460:46) at async runMainOrRootHelp (file:///.../dist/entry.js:468:3) at async file:///.../dist/entry.js:438:55

Root Cause

$ openclaw nonexistent-fake-command --help
[openclaw] Failed to start CLI: Error: The `openclaw nonexistent-fake-command` command is unavailable because `plugins.allow` excludes "nonexistent-fake-command". Add "nonexistent-fake-command" to `plugins.allow` if you want that bundled plugin CLI surface.
    at runCli (file:///.../dist/cli/run-main.js:460:46)
    at async runMainOrRootHelp (file:///.../dist/entry.js:468:3)
    at async file:///.../dist/entry.js:438:55

Fix Action

Fixed

PR fix notes

PR #80123: fix(cli): return null for unknown non-plugin commands instead of suggesting plugins.allow

Description (problem / solution / changelog)

Summary

Fixes #80109.

When plugins.allow is set, unknown CLI subcommands (e.g., openclaw nonexistent-fake-command, openclaw approval, openclaw qzlmop) were incorrectly told to add the token to plugins.allow, even though no such bundled plugin exists. This is a residual of the narrow fix in #64732 that only added tool to the reserved-non-plugin set.

Changes

Add an isKnownPluginId check to resolveMissingPluginCommandMessage so the plugins.allow exclusion message only fires for tokens that actually match a known bundled plugin ID. Truly unknown tokens now return null, letting Commander's default "unknown command" diagnostic (with did-you-mean suggestions) handle them instead.

Files changed

  • src/cli/run-main-policy.ts: Add optional isKnownPluginId callback to options; check it before the plugins.allow fallback. When knownPlugin === false, return null.
  • src/plugins/manifest-command-aliases.runtime.ts: Export isManifestKnownPluginId that checks the manifest registry for a matching plugin ID.
  • src/cli/run-main.ts: Pass isKnownPluginId: isManifestKnownPluginId at both call sites.
  • src/cli/run-main.test.ts: Add tests for unknown commands returning null and known plugins still getting the plugins.allow message.
  • src/cli/run-main.exit.test.ts: Add isManifestKnownPluginId to the runtime mock.
  • CHANGELOG.md: Add entry.

Backward compatibility

When neither registry nor isKnownPluginId callback is provided, the result is undefined (not false), so the early return does not fire and existing behavior is preserved.

Real behavior proof

Behavior or issue addressed: Unknown CLI subcommands incorrectly suggest adding to plugins.allow even when no such bundled plugin exists

Real environment tested: Node.js v22.22.1 on Linux, direct invocation of patched source via npx tsx

Exact steps or command run after this patch: npx tsx -e with direct import of resolveMissingPluginCommandMessage from patched src/cli/run-main-policy.ts, testing three scenarios with a registry containing real plugin IDs

Evidence after fix:

=== Unknown command with registry (FIXED) ===
resolveMissingPluginCommandMessage("qzlmop", allow:[browser], registry) → null (falls through to Commander did-you-mean)

=== Known plugin excluded by plugins.allow (preserved) ===
resolveMissingPluginCommandMessage("browser", allow:[memory-core], registry) → "The `openclaw browser` command is unavailable because `plugins.allow` excludes \"browser\". Add \"browser\" to `plugins.allow` if you want that bundled plugin CLI surface."

=== Backward compat: no registry, no callback ===
resolveMissingPluginCommandMessage("qzlmop", allow:[browser], NO registry) → preserves existing behavior (assumes could be plugin)

Observed result after fix: Unknown tokens like "qzlmop" return null when registry-backed lookup confirms no matching plugin ID exists, allowing Commander to show "unknown command" with did-you-mean suggestions. Known plugins like "browser" still correctly get the plugins.allow exclusion message.

What was not tested: Full end-to-end CLI invocation with live gateway startup (requires full OpenClaw installation with all plugins loaded)

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/cli/run-main-policy.ts (modified, +32/-0)
  • src/cli/run-main.exit.test.ts (modified, +50/-0)
  • src/cli/run-main.test.ts (modified, +40/-12)
  • src/cli/run-main.ts (modified, +48/-0)
  • src/plugins/manifest-command-aliases.runtime.ts (modified, +26/-0)

Code Example

$ openclaw nonexistent-fake-command --help
[openclaw] Failed to start CLI: Error: The `openclaw nonexistent-fake-command` command is unavailable because `plugins.allow` excludes "nonexistent-fake-command". Add "nonexistent-fake-command" to `plugins.allow` if you want that bundled plugin CLI surface.
    at runCli (file:///.../dist/cli/run-main.js:460:46)
    at async runMainOrRootHelp (file:///.../dist/entry.js:468:3)
    at async file:///.../dist/entry.js:438:55
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect CLI diagnostic / UX)

Summary

The narrow fix from #64732 (commit 82a8006f77) added the singular tool token to the reserved-non-plugin list, but the generic non-plugin classification layer that the issue's own Codex review recommended was not implemented. As a result, any unknown CLI subcommand still hits the missing-plugin fallback and emits the misleading "add to plugins.allow" guidance — even for clearly nonsensical tokens that could not possibly be plugin IDs.

This wastes operator time chasing nonexistent plugins. I just spent a Claude Code session being told to add approval (singular — there is no such bundled plugin) to my allowlist; cross-checking the bundled dist/extensions/ directory and openclaw plugins list --json confirmed no such plugin exists. The error message is the only signal, and it's actively misleading.

Steps to reproduce

On a 2026.5.7 install with a populated plugins.allow:

$ openclaw nonexistent-fake-command --help
[openclaw] Failed to start CLI: Error: The `openclaw nonexistent-fake-command` command is unavailable because `plugins.allow` excludes "nonexistent-fake-command". Add "nonexistent-fake-command" to `plugins.allow` if you want that bundled plugin CLI surface.
    at runCli (file:///.../dist/cli/run-main.js:460:46)
    at async runMainOrRootHelp (file:///.../dist/entry.js:468:3)
    at async file:///.../dist/entry.js:438:55

The same error fires for openclaw approval, openclaw foo, openclaw qzlmop, etc. — anything not in the registered command set or manifest aliases.

Expected behavior

Truly unknown tokens (no bundled plugin, no manifest alias, no reserved-non-plugin entry) should fall through to a Commander-style "unknown command" diagnostic with a "did-you-mean" suggestion against the registered command set, not suggest adding the token to plugins.allow.

This matches what #64732's review explicitly called the "best possible solution":

Add an explicit CLI command classification layer before plugin allowlist diagnostics: framework/core/reserved non-plugin names should never suggest adding themselves to plugins.allow, manifest CLI aliases should resolve to the owning plugin ID, runtime slash aliases should explain chat-only usage or point to the related CLI command, and truly unknown commands should fall through to Commander-style unknown-command handling.

Actual behavior

The token is normalized as a plugin ID candidate and resolveMissingPluginCommandMessage() (see src/cli/run-main-policy.ts:155 per the #64732 review) returns the misleading allowlist guidance. The reserved-non-plugin set added in 82a8006f77 only covers tool; everything else still gets routed into this fallback.

Impact

  • Operators with strict plugins.allow configs (recommended for supply-chain hardening, per bundledDiscovery: "compat" + explicit allowlist) see this error frequently as they explore the CLI surface.
  • The error directly suggests modifying a security-relevant config (plugins.allow) to "fix" something that is not actually a plugin allowlist problem. This is the worst possible failure mode for a security knob: a misleading prompt to weaken it.
  • Diagnostic time is spent verifying whether the suggested plugin actually exists (it usually doesn't).

OpenClaw version

2026.5.7 (eeef486)

Operating system

Arch Linux

Install method

npm global

Suggested fix

Implement the classification layer #64732's review described, in priority order:

  1. Truly unknown primary tokens (no plugin, no manifest alias, no reserved entry) → Commander unknown-command output with did-you-mean against the registered command set.
  2. Manifest alias tokens → resolve to owning plugin ID and emit guidance pointing at that plugin ID, not the alias.
  3. Reserved non-plugin tokens → already handled for tool post-82a8006f77; this list will need to grow as new reserved tokens appear, but should be the smallest of the three branches.

The current narrow fix to add tokens to the reserved list one at a time will not scale and was already flagged in the original review as not the best solution.

Related

  • #64732 (closed) — canonical tracker, narrow fix only covered tool
  • #77183 (closed) — same misleading-error pattern for lcm
  • #65319 (open) — adjacent slash-alias case for /lossless
  • #64242, #64779 — earlier alias-diagnostics fixes (manifest-owned commands)

Trailers per Linux kernel coding-assistant policy:

Signed-off-by: Lance [email protected] Assisted-by: Claude-Code:claude-opus-4-7

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Truly unknown tokens (no bundled plugin, no manifest alias, no reserved-non-plugin entry) should fall through to a Commander-style "unknown command" diagnostic with a "did-you-mean" suggestion against the registered command set, not suggest adding the token to plugins.allow.

This matches what #64732's review explicitly called the "best possible solution":

Add an explicit CLI command classification layer before plugin allowlist diagnostics: framework/core/reserved non-plugin names should never suggest adding themselves to plugins.allow, manifest CLI aliases should resolve to the owning plugin ID, runtime slash aliases should explain chat-only usage or point to the related CLI command, and truly unknown commands should fall through to Commander-style unknown-command handling.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Unknown CLI subcommands still suggest "add to plugins.allow" for arbitrary tokens (residual of #64732) [1 pull requests, 2 comments, 3 participants]