Skip to content

Commit 6ed217c

Browse files
roomotedaniel-lxs
andauthored
Fixes #4882: Remove experimental setting for command execution in attempt_completion (#4884)
* Fixes #4882: Remove experimental setting for command execution in attempt_completion - Remove DISABLE_COMPLETION_COMMAND from experiments system - Permanently disable command execution in attempt_completion tool - Update tool prompts to remove command parameter and examples - Remove experimental UI toggle and localization entries (18+ languages) - Update tests to reflect permanent behavior - Remove experiment-specific test file Command execution is now permanently disabled in attempt_completion. Users must use execute_command tool separately before attempt_completion. * refactor: simplify getAttemptCompletionDescription by removing unnecessary variables * test: fix tests by regenerating snaps --------- Co-authored-by: Daniel Riccio <[email protected]>
1 parent 93b8f6d commit 6ed217c

40 files changed

+106
-718
lines changed

packages/types/src/experiment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Keys, Equals, AssertEqual } from "./type-fu.js"
66
* ExperimentId
77
*/
88

9-
export const experimentIds = ["powerSteering", "disableCompletionCommand", "multiFileApplyDiff"] as const
9+
export const experimentIds = ["powerSteering", "multiFileApplyDiff"] as const
1010

1111
export const experimentIdsSchema = z.enum(experimentIds)
1212

@@ -18,7 +18,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>
1818

1919
export const experimentsSchema = z.object({
2020
powerSteering: z.boolean().optional(),
21-
disableCompletionCommand: z.boolean().optional(),
2221
multiFileApplyDiff: z.boolean().optional(),
2322
})
2423

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,25 +298,22 @@ Example: Requesting to ask the user for the path to the frontend-config.json fil
298298
</ask_followup_question>
299299

300300
## attempt_completion
301-
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. Optionally you may provide a CLI command to showcase the result of your work. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
301+
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
302302
IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must ask yourself in <thinking></thinking> tags if you've confirmed from the user that any previous tool uses were successful. If not, then DO NOT use this tool.
303303
Parameters:
304304
- result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.
305-
- command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use `open index.html` to display a created html website, or `open localhost:3000` to display a locally running development server. But DO NOT use commands like `echo` or `cat` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
306305
Usage:
307306
<attempt_completion>
308307
<result>
309308
Your final result description here
310309
</result>
311-
<command>Command to demonstrate result (optional)</command>
312310
</attempt_completion>
313311

314-
Example: Requesting to attempt completion with a result and command
312+
Example: Requesting to attempt completion with a result
315313
<attempt_completion>
316314
<result>
317315
I've updated the CSS
318316
</result>
319-
<command>open index.html</command>
320317
</attempt_completion>
321318

322319
## switch_mode
@@ -449,7 +446,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w
449446
1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order.
450447
2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go.
451448
3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within <thinking></thinking> tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Next, think about which of the provided tools is the most relevant tool to accomplish the user's task. Go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided.
452-
4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. `open index.html` to show the website you've built.
449+
4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user.
453450
5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.
454451

455452

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,25 +195,22 @@ Example: Requesting to ask the user for the path to the frontend-config.json fil
195195
</ask_followup_question>
196196

197197
## attempt_completion
198-
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. Optionally you may provide a CLI command to showcase the result of your work. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
198+
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
199199
IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must ask yourself in <thinking></thinking> tags if you've confirmed from the user that any previous tool uses were successful. If not, then DO NOT use this tool.
200200
Parameters:
201201
- result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.
202-
- command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use `open index.html` to display a created html website, or `open localhost:3000` to display a locally running development server. But DO NOT use commands like `echo` or `cat` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
203202
Usage:
204203
<attempt_completion>
205204
<result>
206205
Your final result description here
207206
</result>
208-
<command>Command to demonstrate result (optional)</command>
209207
</attempt_completion>
210208

211-
Example: Requesting to attempt completion with a result and command
209+
Example: Requesting to attempt completion with a result
212210
<attempt_completion>
213211
<result>
214212
I've updated the CSS
215213
</result>
216-
<command>open index.html</command>
217214
</attempt_completion>
218215

219216
## switch_mode
@@ -346,7 +343,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w
346343
1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order.
347344
2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go.
348345
3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within <thinking></thinking> tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Next, think about which of the provided tools is the most relevant tool to accomplish the user's task. Go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided.
349-
4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. `open index.html` to show the website you've built.
346+
4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user.
350347
5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.
351348

352349

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,25 +369,22 @@ Example: Requesting to ask the user for the path to the frontend-config.json fil
369369
</ask_followup_question>
370370

371371
## attempt_completion
372-
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. Optionally you may provide a CLI command to showcase the result of your work. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
372+
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
373373
IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must ask yourself in <thinking></thinking> tags if you've confirmed from the user that any previous tool uses were successful. If not, then DO NOT use this tool.
374374
Parameters:
375375
- result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.
376-
- command: (optional) A CLI command to execute to show a live demo of the result to the user. For example, use `open index.html` to display a created html website, or `open localhost:3000` to display a locally running development server. But DO NOT use commands like `echo` or `cat` that merely print text. This command should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
377376
Usage:
378377
<attempt_completion>
379378
<result>
380379
Your final result description here
381380
</result>
382-
<command>Command to demonstrate result (optional)</command>
383381
</attempt_completion>
384382

385-
Example: Requesting to attempt completion with a result and command
383+
Example: Requesting to attempt completion with a result
386384
<attempt_completion>
387385
<result>
388386
I've updated the CSS
389387
</result>
390-
<command>open index.html</command>
391388
</attempt_completion>
392389

393390
## switch_mode
@@ -533,7 +530,7 @@ You accomplish a given task iteratively, breaking it down into clear steps and w
533530
1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order.
534531
2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go.
535532
3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within <thinking></thinking> tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Next, think about which of the provided tools is the most relevant tool to accomplish the user's task. Go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use. BUT, if one of the values for a required parameter is missing, DO NOT invoke the tool (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters using the ask_followup_question tool. DO NOT ask for more information on optional parameters if it is not provided.
536-
4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user. You may also provide a CLI command to showcase the result of your task; this can be particularly useful for web development tasks, where you can run e.g. `open index.html` to show the website you've built.
533+
4. Once you've completed the user's task, you must use the attempt_completion tool to present the result of the task to the user.
537534
5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.
538535

539536

0 commit comments

Comments
 (0)