From df69540d59d3bfeb785e3d1157cce8c5d3585f03 Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Mon, 14 Jul 2025 15:59:54 -0600 Subject: [PATCH] fix: remove trailing spaces from command suggestion examples - Remove instruction to include trailing spaces in suggestions - Update all examples to not have trailing spaces - Patterns like 'npm', 'git', 'ls' work fine without trailing spaces - This prevents LLM from generating suggestions with unwanted spaces --- src/core/prompts/tools/execute-command.ts | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/core/prompts/tools/execute-command.ts b/src/core/prompts/tools/execute-command.ts index b926247eec..327b40a95e 100644 --- a/src/core/prompts/tools/execute-command.ts +++ b/src/core/prompts/tools/execute-command.ts @@ -15,17 +15,16 @@ Parameters: - Include suggestions when executing common development commands (npm, git, ls, cd, etc.) - Suggestions use prefix matching: any command that starts with the suggestion will be auto-approved - The special pattern "*" allows ALL commands (use with caution) -- Suggestions are case-insensitive (e.g., "npm " matches "NPM install", "npm test", etc.) -- Include a trailing space in suggestions to ensure proper prefix matching +- Suggestions are case-insensitive (e.g., "npm" matches "NPM install", "npm test", etc.) - Common patterns to suggest: - - "npm " for all npm commands - - "git " for all git operations - - "ls " for listing files - - "cd " for changing directories - - "echo " for echo commands - - "mkdir " for creating directories + - "npm" for all npm commands + - "git" for all git operations + - "ls" for listing files + - "cd" for changing directories + - "echo" for echo commands + - "mkdir" for creating directories - "rm -rf node_modules" for specific cleanup command - - Language-specific patterns like "python ", "node ", "go test ", etc. + - Language-specific patterns like "python", "node", "go test", etc. - "*" to allow all commands (only suggest when explicitly requested by user) Usage: @@ -42,8 +41,8 @@ Example: Requesting to execute npm run dev with suggestions npm run dev -npm run -npm +npm run +npm @@ -52,7 +51,7 @@ Example: Requesting to execute git status with suggestions git status git status -git * +git @@ -62,7 +61,7 @@ Example: Requesting to execute ls in a specific directory with suggestions /home/user/projects ls -la -ls +ls ` }