Skip to content

Commit 60815f4

Browse files
committed
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
1 parent a280f87 commit 60815f4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/core/prompts/tools/execute-command.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Example: Requesting to execute ls in a specific directory
4242
**Suggestion Guidelines:**
4343
- Suggestions use prefix matching (case-insensitive)
4444
- For simple commands: Include the base command (e.g., "npm", "git") and optionally a more specific pattern
45-
- For chained commands (using &&, ||, ;, |): Include patterns for EACH individual command in the chain
46-
- Example: For "cd backend && npm install", suggest: "cd backend && npm install", "cd", "npm install", "npm"
45+
- For chained commands (using &&, ||, ;, |): Include patterns for EACH individual command in the chain (NOT the full chain)
46+
- Example: For "cd backend && npm install", suggest: "cd", "npm install", "npm"
4747
- Include 2-4 relevant patterns total
4848
- Only suggest "*" (allow all) if explicitly requested by the user
4949
@@ -70,7 +70,6 @@ Example: Requesting to execute a chained command
7070
<execute_command>
7171
<command>cd backend && npm install</command>
7272
<suggestions>
73-
<suggest>cd backend && npm install</suggest>
7473
<suggest>cd</suggest>
7574
<suggest>npm install</suggest>
7675
<suggest>npm</suggest>

0 commit comments

Comments
 (0)