Skip to content

Commit 8472ae0

Browse files
authored
Merge pull request RooCodeInc#728 from nissa-seru/add-command-fixes-from-cline
Add command fixes
2 parents 6f64975 + 7e5d78d commit 8472ae0

File tree

7 files changed

+491
-28
lines changed

7 files changed

+491
-28
lines changed

src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Example: Requesting to write to frontend-config.json
132132
</write_to_file>
133133
134134
## execute_command
135-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
135+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
136136
Parameters:
137137
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
138138
Usage:
@@ -291,7 +291,7 @@ RULES
291291
SYSTEM INFORMATION
292292
293293
Operating System: Linux
294-
Default Shell: /bin/bash
294+
Default Shell: /bin/zsh
295295
Home Directory: /home/user
296296
Current Working Directory: /test/path
297297
@@ -455,7 +455,7 @@ Example: Requesting to write to frontend-config.json
455455
</write_to_file>
456456
457457
## execute_command
458-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
458+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
459459
Parameters:
460460
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
461461
Usage:
@@ -614,7 +614,7 @@ RULES
614614
SYSTEM INFORMATION
615615
616616
Operating System: Linux
617-
Default Shell: /bin/bash
617+
Default Shell: /bin/zsh
618618
Home Directory: /home/user
619619
Current Working Directory: /test/path
620620
@@ -778,7 +778,7 @@ Example: Requesting to write to frontend-config.json
778778
</write_to_file>
779779
780780
## execute_command
781-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
781+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
782782
Parameters:
783783
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
784784
Usage:
@@ -937,7 +937,7 @@ RULES
937937
SYSTEM INFORMATION
938938
939939
Operating System: Linux
940-
Default Shell: /bin/bash
940+
Default Shell: /bin/zsh
941941
Home Directory: /home/user
942942
Current Working Directory: /test/path
943943
@@ -1147,7 +1147,7 @@ Example: Requesting to click on the element at coordinates 450,300
11471147
</browser_action>
11481148
11491149
## execute_command
1150-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
1150+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
11511151
Parameters:
11521152
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
11531153
Usage:
@@ -1309,7 +1309,7 @@ RULES
13091309
SYSTEM INFORMATION
13101310
13111311
Operating System: Linux
1312-
Default Shell: /bin/bash
1312+
Default Shell: /bin/zsh
13131313
Home Directory: /home/user
13141314
Current Working Directory: /test/path
13151315
@@ -1473,7 +1473,7 @@ Example: Requesting to write to frontend-config.json
14731473
</write_to_file>
14741474
14751475
## execute_command
1476-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
1476+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
14771477
Parameters:
14781478
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
14791479
Usage:
@@ -2045,7 +2045,7 @@ RULES
20452045
SYSTEM INFORMATION
20462046
20472047
Operating System: Linux
2048-
Default Shell: /bin/bash
2048+
Default Shell: /bin/zsh
20492049
Home Directory: /home/user
20502050
Current Working Directory: /test/path
20512051
@@ -2255,7 +2255,7 @@ Example: Requesting to click on the element at coordinates 450,300
22552255
</browser_action>
22562256
22572257
## execute_command
2258-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
2258+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
22592259
Parameters:
22602260
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
22612261
Usage:
@@ -2417,7 +2417,7 @@ RULES
24172417
SYSTEM INFORMATION
24182418
24192419
Operating System: Linux
2420-
Default Shell: /bin/bash
2420+
Default Shell: /bin/zsh
24212421
Home Directory: /home/user
24222422
Current Working Directory: /test/path
24232423
@@ -2641,7 +2641,7 @@ Your search/replace content here
26412641
</apply_diff>
26422642
26432643
## execute_command
2644-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
2644+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
26452645
Parameters:
26462646
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
26472647
Usage:
@@ -2802,7 +2802,7 @@ RULES
28022802
SYSTEM INFORMATION
28032803
28042804
Operating System: Linux
2805-
Default Shell: /bin/bash
2805+
Default Shell: /bin/zsh
28062806
Home Directory: /home/user
28072807
Current Working Directory: /test/path
28082808
@@ -2966,7 +2966,7 @@ Example: Requesting to write to frontend-config.json
29662966
</write_to_file>
29672967
29682968
## execute_command
2969-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
2969+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
29702970
Parameters:
29712971
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
29722972
Usage:
@@ -3125,7 +3125,7 @@ RULES
31253125
SYSTEM INFORMATION
31263126
31273127
Operating System: Linux
3128-
Default Shell: /bin/bash
3128+
Default Shell: /bin/zsh
31293129
Home Directory: /home/user
31303130
Current Working Directory: /test/path
31313131
@@ -3331,7 +3331,7 @@ Example: Requesting to write to frontend-config.json
33313331
</write_to_file>
33323332
33333333
## execute_command
3334-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
3334+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
33353335
Parameters:
33363336
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
33373337
Usage:
@@ -3549,7 +3549,7 @@ RULES
35493549
SYSTEM INFORMATION
35503550
35513551
Operating System: Linux
3552-
Default Shell: /bin/bash
3552+
Default Shell: /bin/zsh
35533553
Home Directory: /home/user
35543554
Current Working Directory: /test/path
35553555
@@ -3873,7 +3873,7 @@ RULES
38733873
SYSTEM INFORMATION
38743874
38753875
Operating System: Linux
3876-
Default Shell: /bin/bash
3876+
Default Shell: /bin/zsh
38773877
Home Directory: /home/user
38783878
Current Working Directory: /test/path
38793879
@@ -4182,7 +4182,7 @@ RULES
41824182
SYSTEM INFORMATION
41834183
41844184
Operating System: Linux
4185-
Default Shell: /bin/bash
4185+
Default Shell: /bin/zsh
41864186
Home Directory: /home/user
41874187
Current Working Directory: /test/path
41884188
@@ -4376,7 +4376,7 @@ Example: Requesting to write to frontend-config.json
43764376
</write_to_file>
43774377
43784378
## execute_command
4379-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
4379+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: /test/path
43804380
Parameters:
43814381
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
43824382
Usage:
@@ -4948,7 +4948,7 @@ RULES
49484948
SYSTEM INFORMATION
49494949
49504950
Operating System: Linux
4951-
Default Shell: /bin/bash
4951+
Default Shell: /bin/zsh
49524952
Home Directory: /home/user
49534953
Current Working Directory: /test/path
49544954

src/core/prompts/__tests__/system.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ jest.mock("os", () => ({
6565
homedir: () => "/home/user",
6666
}))
6767

68-
jest.mock("default-shell", () => "/bin/bash")
68+
jest.mock("default-shell", () => "/bin/zsh")
6969

7070
jest.mock("os-name", () => () => "Linux")
7171

72+
jest.mock("../../../utils/shell", () => ({
73+
getShell: () => "/bin/zsh",
74+
}))
75+
7276
// Create a mock ExtensionContext
7377
const mockContext = {
7478
extensionPath: "/mock/extension/path",

src/core/prompts/sections/system-info.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import defaultShell from "default-shell"
22
import os from "os"
33
import osName from "os-name"
44
import { Mode, ModeConfig, getModeBySlug, defaultModeSlug, isToolAllowedForMode } from "../../../shared/modes"
5+
import { getShell } from "../../../utils/shell"
56

67
export function getSystemInfoSection(cwd: string, currentMode: Mode, customModes?: ModeConfig[]): string {
78
const findModeBySlug = (slug: string, modes?: ModeConfig[]) => modes?.find((m) => m.slug === slug)
@@ -14,7 +15,7 @@ export function getSystemInfoSection(cwd: string, currentMode: Mode, customModes
1415
SYSTEM INFORMATION
1516
1617
Operating System: ${osName()}
17-
Default Shell: ${defaultShell}
18+
Default Shell: ${getShell()}
1819
Home Directory: ${os.homedir().toPosix()}
1920
Current Working Directory: ${cwd.toPosix()}
2021

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ToolArgs } from "./types"
22

33
export function getExecuteCommandDescription(args: ToolArgs): string | undefined {
44
return `## execute_command
5-
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: ${args.cwd}
5+
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory: ${args.cwd}
66
Parameters:
77
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
88
Usage:

0 commit comments

Comments
 (0)