feat: replace unknown-command list with closest-match suggestions - #2063
Merged
hatayama merged 2 commits intoJul 29, 2026
Merged
Conversation
Dumping every available command wastes tokens on typos. Rank a short Levenshtein suggestion list instead, and stamp shared release inputs for the cli/common change. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughUnknown command errors now include up to five ranked command suggestions based on Levenshtein distance, with alphabetical tie-breaking. Tests cover ranking, limits, empty inputs, and error payload changes; two shared-input stamps are updated. ChangesCommand suggestion errors
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant UnknownCommandError
participant suggestCommands
participant levenshteinDistance
UnknownCommandError->>suggestCommands: pass unknown and available commands
suggestCommands->>levenshteinDistance: calculate candidate distances
levenshteinDistance-->>suggestCommands: return edit distances
suggestCommands-->>UnknownCommandError: return up to five ranked suggestions
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The previous stamps were computed before command_suggestions.go was tracked, so git ls-files omitted it from the manifest hash. Co-authored-by: Cursor <cursoragent@cursor.com>
hatayama
merged commit Jul 29, 2026
f1469db
into
feat/pause-point-r13-leftovers-integration
1 of 2 checks passed
This was referenced Jul 29, 2026
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
SuggestedCommands(Levenshtein distance, name tie-break) instead of the fullAvailableCommandslist.cli/commonchange.User Impact
Typo recovery stays useful without dumping every command name into the error envelope.
Test plan
scripts/check-go-cli.sh→ exit 0scripts/stamp-release-inputs.shtwice → content-idempotent{ "ErrorCode": "UNKNOWN_COMMAND", "Command": "compil", "Details": { "SuggestedCommands": [ "compile", "completion", "install", "launch", "list" ] } }pull_request.branches: [main, v3-beta]); full CI on the final PR tov3-beta