Skip to content

Commit c07fd0c

Browse files
authored
Merge pull request #939 from dgageot/shell-current
Passing . to shell tools is not required
2 parents fbe27a9 + 6ce451f commit c07fd0c

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

pkg/tools/builtin/shell.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ func (lw *limitedWriter) Write(p []byte) (n int, err error) {
100100

101101
type RunShellArgs struct {
102102
Cmd string `json:"cmd" jsonschema:"The shell command to execute"`
103-
Cwd string `json:"cwd" jsonschema:"The working directory to execute the command in"`
103+
Cwd string `json:"cwd,omitempty" jsonschema:"The working directory to execute the command in (default: \".\")"`
104104
Timeout int `json:"timeout,omitempty" jsonschema:"Command execution timeout in seconds (default: 30)"`
105105
}
106106

107107
type RunShellBackgroundArgs struct {
108108
Cmd string `json:"cmd" jsonschema:"The shell command to execute in the background"`
109-
Cwd string `json:"cwd" jsonschema:"The working directory to execute the command in"`
109+
Cwd string `json:"cwd,omitempty" jsonschema:"The working directory to execute the command in (default: \".\")"`
110110
}
111111

112112
type ViewBackgroundJobArgs struct {

pkg/tools/builtin/shell_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestShellTool_Tools(t *testing.T) {
5252
"type": "string"
5353
},
5454
"cwd": {
55-
"description": "The working directory to execute the command in",
55+
"description": "The working directory to execute the command in (default: \".\")",
5656
"type": "string"
5757
},
5858
"timeout": {
@@ -62,8 +62,7 @@ func TestShellTool_Tools(t *testing.T) {
6262
},
6363
"additionalProperties": false,
6464
"required": [
65-
"cmd",
66-
"cwd"
65+
"cmd"
6766
]
6867
}`, string(schema))
6968
}

0 commit comments

Comments
 (0)