🤖 fix: show helpful errors for slash commands with missing/invalid arguments #1701
+57
−12
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.
Previously, commands like
/truncate(without args) would show "Unknown command: /truncate" which was confusing since the command exists but needs an argument.Changes
Added two new
ParsedCommandtypes:command-missing-args: for required arguments not providedcommand-invalid-args: for arguments that don't pass validationUpdated commands to use these with usage hints:
/truncate: shows/truncate <0-100> (percentage to remove)/idle: shows/idle <hours> or /idle off/mcp add|edit|remove: shows appropriate usage for each subcommandBefore/After
/truncate/truncate 150/mcp addGenerated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$2.10