Skip to content

fix(config): give actionable guidance when command names are used in plugins.allow (#64191)#64242

Merged
steipete merged 4 commits into
openclaw:mainfrom
feiskyer:fix/64191-dreaming-plugins-allow-warning
Apr 10, 2026
Merged

fix(config): give actionable guidance when command names are used in plugins.allow (#64191)#64242
steipete merged 4 commits into
openclaw:mainfrom
feiskyer:fix/64191-dreaming-plugins-allow-warning

Conversation

@feiskyer

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Putting "dreaming" in plugins.allow causes a "plugin not found" warning, and running openclaw dreaming from CLI misleadingly tells users to add "dreaming" to plugins.allow — creating a circular trap where neither path works.
  • Why it matters: Users cannot discover that /dreaming is a runtime slash command from memory-core, not a standalone plugin or CLI command. The error messages actively mislead them.
  • What changed: Added a command-name-to-plugin-id map so both validation and CLI resolution give actionable guidance pointing users to the correct plugin id (memory-core) and the correct usage (/dreaming in chat or openclaw memory on CLI).
  • What did NOT change: No new features, no behavioral changes to dreaming itself, no changes to how plugins.allow enforcement works. Generic "plugin not found" handling for truly unknown ids is untouched.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Root Cause (if applicable)

  • Root cause: dreaming is a runtime slash command registered by the memory-core plugin via api.registerCommand(), but both config validation and CLI command resolution treat unrecognized names as plugin ids. Neither path knows that some command names map to parent plugins.
  • Missing detection / guardrail: No mapping existed between well-known runtime command names and their parent plugin ids.
  • Contributing context: The memory-core plugin registers CLI commands under memory (via api.registerCli()) but its slash command under dreaming (via api.registerCommand()). The naming mismatch between the CLI surface (memory) and the slash command (dreaming) makes this confusing.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
  • Target test or file:
    • src/cli/run-main.test.ts — 2 new tests for resolveMissingPluginCommandMessage("dreaming")
    • src/config/config.plugin-validation.test.ts — 1 new test for plugins.allow: ["dreaming"]
  • Scenario the test should lock in:
    • "dreaming" in plugins.allow produces a redirect warning (not generic "plugin not found")
    • openclaw dreaming produces a runtime-command explanation (not a misleading plugins.allow suggestion)
    • The runtime-command message takes priority even when plugins.allow is set

Security Impact

  1. Does this touch auth, tokens, credentials, or permission checks? No
  2. Does this change exec, shell, or code-execution paths? No
  3. Does this affect network, SSRF, or fetch-guard behavior? No
  4. Does this change how untrusted content is processed? No
  5. Does this modify config loading, validation, or defaults? Yes — validation warning messages only, no behavioral changes to enforcement

Human Verification (required)

Verified scenarios:

  • Docker E2E: plugins.allow: ["dreaming"] + openclaw doctor → shows redirect warning to memory-core
  • Docker E2E: openclaw dreaming status with plugins.allow: ["memory-core"] → shows runtime slash command explanation ✅
  • Docker E2E: openclaw dreaming status without plugins.allow → same explanation ✅
  • Docker E2E: openclaw memory --help → still works normally ✅
  • Unit tests: all 3 new tests pass, all existing tests pass ✅
  • pnpm check passes (types, lint, all checks) ✅

Edge cases checked:

  • COMMAND_NAME_TO_PLUGIN_ID entries where command name equals plugin id (e.g. active-memory) are skipped by the parentPluginId !== pluginId guard
  • Unknown plugin ids not in the map still get the generic "plugin not found" warning

What I did NOT verify:

  • Gateway runtime behavior of /dreaming slash command (not changed by this PR)

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

  • Risk: The static COMMAND_NAME_TO_PLUGIN_ID map could become stale if plugins rename their commands.
    • Mitigation: The map is small, well-documented, and only affects warning messages. If a mapping becomes stale, users fall back to the existing generic "plugin not found" warning — no worse than before.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Apr 10, 2026
@greptile-apps

greptile-apps Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a usability trap where putting "dreaming" in plugins.allow produced a generic "plugin not found" warning, and running openclaw dreaming told users to add it to plugins.allow — neither path leading to a solution. The fix adds two small static maps (COMMAND_NAME_TO_PLUGIN_ID in validation and RUNTIME_COMMAND_TO_PLUGIN_ID in the CLI resolver) that redirect users to the correct plugin id and usage. Tests cover all three new paths and existing behavior is unchanged.

Confidence Score: 5/5

Safe to merge — focused bug fix with good test coverage and no behavioral changes to existing enforcement.

All findings are P2 style/maintenance concerns. The active-memory self-mapping is dead code, and the hardcoded openclaw memory in run-main.ts creates a future maintenance trap, but neither affects correctness today. Core fix logic is correct.

src/cli/run-main.ts (hardcoded CLI alternative message), src/config/validation.ts (dead active-memory self-mapping entry)

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/cli/run-main.ts
Line: 88-91

Comment:
**Hardcoded CLI alternative couples message to a single entry**

The third sentence hardcodes `` `openclaw memory` `` regardless of which entry matched in `RUNTIME_COMMAND_TO_PLUGIN_ID`. If a future entry is added to the map (e.g. `voice → talk-voice`), the guidance would incorrectly tell the user to run `openclaw memory` for CLI voice operations. Consider storing the CLI command alongside the plugin id in the map value:

```suggestion
  // Check if this is a runtime slash command rather than a CLI command.
  const runtimeEntry = RUNTIME_COMMAND_TO_PLUGIN_ID[normalizedPluginId];
  if (runtimeEntry) {
    const { parentPluginId, cliAlternative } = runtimeEntry;
    return (
      `"${normalizedPluginId}" is a runtime slash command (/${normalizedPluginId}), not a CLI command. ` +
      `It is provided by the "${parentPluginId}" plugin. ` +
      (cliAlternative
        ? `Use \`${cliAlternative}\` for CLI operations, or \`/${normalizedPluginId}\` in a chat session.`
        : `Use \`/${normalizedPluginId}\` in a chat session.`)
    );
  }
```

(Requires updating the map type and the single `dreaming` entry to `{ parentPluginId: "memory-core", cliAlternative: "openclaw memory" }`.)

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/config/validation.ts
Line: 50

Comment:
**Self-mapping entry is unreachable**

`"active-memory": "active-memory"` will never produce the redirect warning because the downstream guard requires `parentPluginId !== pluginId`. When both values are `"active-memory"` the condition is false, and execution falls through to the generic `pushMissingPluginIssue` path — identical to if the entry weren't in the map at all. Either remove the entry or replace it with a comment explaining the intent.

```suggestion
  // dreaming is a slash command registered by memory-core; its CLI surface is `openclaw memory`.
  dreaming: "memory-core",
  // voice, phone, pair are CLI command names whose parent plugin ids differ.
  voice: "talk-voice",
  phone: "phone-control",
  pair: "device-pair",
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(config): give actionable guidance wh..." | Re-trigger Greptile

Comment thread src/cli/run-main.ts Outdated
Comment thread src/config/validation.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3aef0972f5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/cli/run-main.ts Outdated
@feiskyer
feiskyer force-pushed the fix/64191-dreaming-plugins-allow-warning branch 2 times, most recently from 604c6ed to 680b96d Compare April 10, 2026 12:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 680b96db17

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/cli/run-main.ts Outdated
feiskyer and others added 3 commits April 10, 2026 14:46
…plugins.allow (openclaw#64191)

When users put a runtime command name like "dreaming" into `plugins.allow`,
validation now explains that it is a command provided by a specific plugin
(e.g. "memory-core") and suggests using the plugin id instead, rather than
the generic "plugin not found" warning that previously created a circular
trap with the CLI error message.

Similarly, running `openclaw dreaming` from the CLI now explains that
`/dreaming` is a runtime slash command (not a CLI command) and points users
to `openclaw memory` for CLI operations or `/dreaming` in a chat session.

Fixes two related UX problems:
1. `plugins.allow: ["dreaming"]` → validation warned "plugin not found"
2. `openclaw dreaming status` → CLI said "add dreaming to plugins.allow"
   (which then triggered problem 1)

Root cause: "dreaming" is a slash command registered by the memory-core
plugin via `api.registerCommand()`, not a standalone plugin or CLI command.
@steipete
steipete force-pushed the fix/64191-dreaming-plugins-allow-warning branch from 204e88e to 4e01de8 Compare April 10, 2026 13:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e01de8cbb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/run-main.ts
Comment on lines +102 to +106
if (commandAlias.kind === "runtime-slash") {
const cliHint = commandAlias.cliCommand
? `Use \`openclaw ${commandAlias.cliCommand}\` for related CLI operations, or `
: "Use ";
return (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Respect deny/global disable before slash-command guidance

This branch returns the runtime slash command hint as soon as commandAliases.kind === "runtime-slash", but it only checks plugins.allow and plugins.entries.<id>.enabled first. If the owning plugin is disabled through plugins.enabled=false or blocked by plugins.deny, openclaw dreaming will still tell users to use /dreaming, even though that command surface is unavailable in runtime. This creates a misleading diagnostic path for valid config states and should be gated on full plugin activation (including deny/global disable), not just allowlist and entry-level disablement.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit ddfd6c3 into openclaw:main Apr 10, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

  • Gate: pnpm check; targeted pnpm test src/cli/run-main.test.ts src/config/config.plugin-validation.test.ts src/config/config.web-search-provider.test.ts src/plugins/setup-registry.test.ts src/plugins/provider-discovery.test.ts src/plugins/providers.test.ts extensions/memory-core/src/cli.test.ts src/agents/model-selection.test.ts src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts; pnpm build; CI current-head lightweight checks green. Full local pnpm test was green except a known unrelated openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts timeout, which passed targeted.
  • PR commits on main:

Thanks @feiskyer!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7dde05b50b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +60 to 64
const resolved = runtime.resolvePluginSetupCliBackend(params);
if (resolved) {
return resolved;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid manifest fallback after runtime backend resolution fails

This now falls back to resolveBundledSetupCliBackends() whenever runtime.resolvePluginSetupCliBackend() returns undefined, not just when the runtime module is unavailable. In failure cases (for example setup import/registration drift), that fallback trusts manifest cliBackends metadata and can report a backend as available even though setup resolution failed, which can misclassify providers via isCliProvider() and send model selection down the wrong path. The manifest fallback should only run when setup-runtime loading is unavailable, not when runtime lookup explicitly misses.

Useful? React with 👍 / 👎.

Comment thread src/cli/run-main.ts
Comment on lines +102 to +106
if (commandAlias.kind === "runtime-slash") {
const cliHint = commandAlias.cliCommand
? `Use \`openclaw ${commandAlias.cliCommand}\` for related CLI operations, or `
: "Use ";
return (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return alias guidance even when alias kind is omitted

Alias-specific handling only returns early for kind === "runtime-slash", but manifest parsing accepts commandAliases entries without a kind. For those valid aliases, this branch falls through to the generic allowlist check and can tell users to add the alias itself to plugins.allow even when the parent plugin is already allowlisted, which is incorrect because aliases are not plugin IDs. This recreates misleading guidance for kindless aliases.

Useful? React with 👍 / 👎.

@feiskyer
feiskyer deleted the fix/64191-dreaming-plugins-allow-warning branch April 11, 2026 01:12
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dreaming CLI: plugins.allow false-positive plugin not found warning

2 participants