Conversation
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
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! |
Contributor
|
After investigation, Slack's API documentation confirms hyphens are allowed in slash command names. The current regex is correct — commands like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slack slash command names only allow lowercase letters, digits, and underscores — hyphens are not permitted.
Root cause: The
_sanitize_slack_namefunction'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-mcpand/set-homewere emitted into the Slack app manifest with hyphens, which Slack rejects with "the slash command has an invalid name".Fix:
_SLACK_INVALID_CHARSregex from[^a-z0-9_\-]to[^a-z0-9_]so hyphens are stripped, not kept.After this fix:
/reload-mcp→/reloadmcp/set-home(alias) →/sethome(already canonical)Closes #17054