Skip to content

Commit 8a4d415

Browse files
AvicennaJrkujtimiihoxha
authored andcommitted
use workingDir if shellInstance is nil otherwise use cwd if shellInstance is not nil
1 parent f12386e commit 8a4d415

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/llm/tools/shell/shell.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ func GetPersistentShell(workingDir string) *PersistentShell {
4747
shellInstance = newPersistentShell(workingDir)
4848
})
4949

50-
if shellInstance == nil || !shellInstance.isAlive {
50+
if shellInstance == nil {
5151
shellInstance = newPersistentShell(workingDir)
52+
} else if !shellInstance.isAlive {
53+
shellInstance = newPersistentShell(shellInstance.cwd)
5254
}
5355

5456
return shellInstance

0 commit comments

Comments
 (0)