Skip to content

fix(cli): preserve cmd_key when clamping skill command names#18951

Closed
CharlieKerfoot wants to merge 1 commit into
NousResearch:mainfrom
CharlieKerfoot:fix/after-_clamp_command_names-truncates-skill-names-to-fit-the-
Closed

fix(cli): preserve cmd_key when clamping skill command names#18951
CharlieKerfoot wants to merge 1 commit into
NousResearch:mainfrom
CharlieKerfoot:fix/after-_clamp_command_names-truncates-skill-names-to-fit-the-

Conversation

@CharlieKerfoot

Copy link
Copy Markdown
Contributor

Summary

In _collect_gateway_skill_entries, skill entries were unzipped into (name, desc) pairs before being passed through _clamp_command_names, with cmd_key stashed in a separate key_by_pair dict keyed by the original tuple. When a skill name exceeds the 32-char Discord limit, _clamp_command_names truncates it and appends a digit, so the post-clamp (name, desc) no longer matches the original key. The lookup falls back to "", and Discord ends up with a slash command whose dispatch key is empty. When you click it, nothing happens.

Fix

The fix generalizes _clamp_command_names to pass arbitrary extra tuple elements through unchanged, so cmd_key rides along with each entry and survives any rename.

Tests

Both normal skills and long skills (over 32-char) have normal behavior now.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard platform/discord Discord bot adapter tool/skills Skills system (list, view, manage) labels May 2, 2026
@CharlieKerfoot CharlieKerfoot changed the title fix: preserve cmd_key when clamping skill command names fix(cli): preserve cmd_key when clamping skill command names May 2, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Merged via PR #19162. Your commit was cherry-picked onto current main with your authorship preserved in git log. Follow-up additions: updated type annotations on _clamp_command_names, added 7 tests covering the fix (unit + integration through both Discord paths), and AUTHOR_MAP entry. Thanks for the clean fix, @CharlieKerfoot!

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/discord Discord bot adapter tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants