File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,9 +151,9 @@ func (h *shellHandler) RunShell(ctx context.Context, toolCall tools.ToolCall) (*
151151
152152 cmd := exec .Command (h .shell , append (h .shellArgsPrefix , params .Cmd )... )
153153 cmd .Env = h .env
154- cmd .Dir = h . workingDir
155- if params .Cwd != " " {
156- cmd .Dir = params . Cwd
154+ cmd .Dir = params . Cwd
155+ if params .Cwd == "" || params . Cwd == ". " {
156+ cmd .Dir = h . workingDir
157157 }
158158
159159 cmd .SysProcAttr = platformSpecificSysProcAttr ()
@@ -231,9 +231,9 @@ func (h *shellHandler) RunShellBackground(ctx context.Context, toolCall tools.To
231231 // Setup command (no context - background jobs run independently)
232232 cmd := exec .Command (h .shell , append (h .shellArgsPrefix , params .Cmd )... )
233233 cmd .Env = h .env
234- cmd .Dir = h . workingDir
235- if params .Cwd != " " {
236- cmd .Dir = params . Cwd
234+ cmd .Dir = params . Cwd
235+ if params .Cwd == "" || params . Cwd == ". " {
236+ cmd .Dir = h . workingDir
237237 }
238238
239239 cmd .SysProcAttr = platformSpecificSysProcAttr ()
You can’t perform that action at this time.
0 commit comments