mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: prevent duplicate command patterns by trimming full command (#6224)
This commit is contained in:
parent
c61bd95bbe
commit
490538f9df
1 changed files with 4 additions and 2 deletions
|
|
@ -33,11 +33,13 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
|
|||
|
||||
// Create a combined list with full command first, then patterns
|
||||
const allPatterns = useMemo(() => {
|
||||
const fullCommandPattern: CommandPattern = { pattern: command }
|
||||
// Trim the command to ensure consistency with extracted patterns
|
||||
const trimmedCommand = command.trim()
|
||||
const fullCommandPattern: CommandPattern = { pattern: trimmedCommand }
|
||||
|
||||
// Create a set to track unique patterns we've already seen
|
||||
const seenPatterns = new Set<string>()
|
||||
seenPatterns.add(command) // Add the full command first
|
||||
seenPatterns.add(trimmedCommand) // Add the trimmed full command first
|
||||
|
||||
// Filter out any patterns that are duplicates or are the same as the full command
|
||||
const uniquePatterns = patterns.filter((p) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue