fix(cli): preserve cmd_key when clamping skill command names#18951
Closed
CharlieKerfoot wants to merge 1 commit into
Closed
Conversation
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 |
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
In
_collect_gateway_skill_entries, skill entries were unzipped into(name, desc)pairs before being passed through_clamp_command_names, withcmd_keystashed in a separate key_by_pair dict keyed by the original tuple. When a skill name exceeds the 32-char Discord limit,_clamp_command_namestruncates 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_namesto pass arbitrary extra tuple elements through unchanged, socmd_keyrides along with each entry and survives any rename.Tests
Both normal skills and long skills (over 32-char) have normal behavior now.