openclaw - 💡(How to fix) Fix [Bug]: parseSlashCommandActionArgs prefix match incorrectly captures longer command names (e.g. /config-check matched by /config) [3 pull requests]

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…

Bug Description

The slash command parser parseSlashCommandActionArgs uses a simple startsWith prefix match, which causes built-in commands to incorrectly intercept skill commands that share a prefix.

For example, a skill named config-check triggered via /config-check <args> is captured by the built-in /config handler, resulting in:

⚠️ /config is disabled. Set commands.config=true to enable.

Root Cause

In src/auto-reply/reply/slash-command-parsers.ts (or the equivalent shared parseSlashCommandActionArgs):

if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" }; const rest = trimmed.slice(slash.length).trim();

No boundary check is performed after the prefix match. /config-check starts with /config, so it matches. The rest becomes -check <args>, which is then treated as an invalid action.

Expected Behavior

/config-check should not match the /config command handler. The parser should verify that the character immediately after the prefix is either whitespace, a colon, or end-of-string.

Suggested Fix

if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" }; const charAfter = trimmed.charAt(slash.length); if (charAfter && !/[\s:]/.test(charAfter)) return { kind: "no-match" };

Affected Version

Confirmed in 2026.3.13 and 2026.5.18.

Impact

Any skill whose name starts with a built-in command prefix (config-, debug-, models-*, etc.) will be unreachable via slash invocation from any channel.

Root Cause

Root Cause

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Bug Description

The slash command parser parseSlashCommandActionArgs uses a simple startsWith prefix match, which causes built-in commands to incorrectly intercept skill commands that share a prefix.

For example, a skill named config-check triggered via /config-check <args> is captured by the built-in /config handler, resulting in:

⚠️ /config is disabled. Set commands.config=true to enable.

Root Cause

In src/auto-reply/reply/slash-command-parsers.ts (or the equivalent shared parseSlashCommandActionArgs):

if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" }; const rest = trimmed.slice(slash.length).trim();

No boundary check is performed after the prefix match. /config-check starts with /config, so it matches. The rest becomes -check <args>, which is then treated as an invalid action.

Expected Behavior

/config-check should not match the /config command handler. The parser should verify that the character immediately after the prefix is either whitespace, a colon, or end-of-string.

Suggested Fix

if (!trimmed.toLowerCase().startsWith(slashLower)) return { kind: "no-match" }; const charAfter = trimmed.charAt(slash.length); if (charAfter && !/[\s:]/.test(charAfter)) return { kind: "no-match" };

Affected Version

Confirmed in 2026.3.13 and 2026.5.18.

Impact

Any skill whose name starts with a built-in command prefix (config-, debug-, models-*, etc.) will be unreachable via slash invocation from any channel.

Steps to reproduce

a skill named config-check triggered via /config-check <args> is captured by the built-in /config handler, resulting in:

⚠️ /config is disabled. Set commands.config=true to enable.

Expected behavior

/config-check should not match the /config command handler. The parser should verify that the character immediately after the prefix is either whitespace, a colon, or end-of-string.

Actual behavior

⚠️ /config is disabled. Set commands.config=true to enable.

OpenClaw version

Confirmed in 2026.3.13 and 2026.5.18.

Operating system

macos

Install method

No response

Model

opus-4-6

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

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

/config-check should not match the /config command handler. The parser should verify that the character immediately after the prefix is either whitespace, a colon, or end-of-string.

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 - 💡(How to fix) Fix [Bug]: parseSlashCommandActionArgs prefix match incorrectly captures longer command names (e.g. /config-check matched by /config) [3 pull requests]