Skip to content

fix(commands): strip hyphens from Slack slash command names - #17081

Closed
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/ISSUE-17054-slack-invalid-hyphen
Closed

ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/ISSUE-17054-slack-invalid-hyphen

Conversation

@ms-alan

@ms-alan ms-alan commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Slack slash command names only allow lowercase letters, digits, and underscores — hyphens are not permitted.

Root cause: The _sanitize_slack_name function's regex [^a-z0-9_\-] was keeping hyphens (the \- inside [] makes hyphen a literal character to match, not a range operator). The docstring also incorrectly claimed Slack allows hyphens.

What this caused: Commands like /reload-mcp and /set-home were emitted into the Slack app manifest with hyphens, which Slack rejects with "the slash command has an invalid name".

Fix:

  • Changed _SLACK_INVALID_CHARS regex from [^a-z0-9_\-] to [^a-z0-9_] so hyphens are stripped, not kept.
  • Updated the docstring to correctly document Slack's allowed character set.

After this fix:

  • /reload-mcp/reloadmcp
  • /set-home (alias) → /sethome (already canonical)

Closes #17054

Slack slash command names only allow lowercase letters, digits, and
underscores — hyphens are not permitted despite what the previous
comment claimed.

The _sanitize_slack_name function was keeping hyphens (the regex
[^a-z0-9_\-] preserves them), causing commands like /reload-mcp and
/set-home to generate invalid Slack manifests. The fix removes the
hyphen from the allowed character class so these commands become
/reloadmcp and /sethome respectively.

Closes NousResearch#17054
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/slack Slack app adapter comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 28, 2026
@kshitijk4poor

Copy link
Copy Markdown
Contributor

After investigation, Slack's API documentation confirms hyphens ARE allowed in slash command names. The current regex () is correct. Commands like need hyphens. Thanks for the PR though!

@kshitijk4poor

Copy link
Copy Markdown
Contributor

After investigation, Slack's API documentation confirms hyphens are allowed in slash command names. The current regex is correct — commands like /reload-mcp need hyphens. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Setup]: Slack manifest is broken

3 participants