From 60815f405c0eb3b8bd73b85199f6cd277ba4753c Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Tue, 15 Jul 2025 13:42:30 -0600 Subject: [PATCH] fix: prevent LLM from suggesting full command chains in execute-command - Updated execute-command prompt to explicitly forbid suggesting full command chains - Added clear instruction that only the first command should be suggested for chained commands - This ensures the LLM will only suggest the initial command and let the user decide on subsequent commands --- src/core/prompts/tools/execute-command.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/prompts/tools/execute-command.ts b/src/core/prompts/tools/execute-command.ts index d1c83ea173..45c714c0d7 100644 --- a/src/core/prompts/tools/execute-command.ts +++ b/src/core/prompts/tools/execute-command.ts @@ -42,8 +42,8 @@ Example: Requesting to execute ls in a specific directory **Suggestion Guidelines:** - Suggestions use prefix matching (case-insensitive) - For simple commands: Include the base command (e.g., "npm", "git") and optionally a more specific pattern -- For chained commands (using &&, ||, ;, |): Include patterns for EACH individual command in the chain - - Example: For "cd backend && npm install", suggest: "cd backend && npm install", "cd", "npm install", "npm" +- For chained commands (using &&, ||, ;, |): Include patterns for EACH individual command in the chain (NOT the full chain) + - Example: For "cd backend && npm install", suggest: "cd", "npm install", "npm" - Include 2-4 relevant patterns total - Only suggest "*" (allow all) if explicitly requested by the user @@ -70,7 +70,6 @@ Example: Requesting to execute a chained command cd backend && npm install -cd backend && npm install cd npm install npm