summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--internal/llm/tools/shell/shell.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/llm/tools/shell/shell.go b/internal/llm/tools/shell/shell.go
index 10fa3779f..5731faec3 100644
--- a/internal/llm/tools/shell/shell.go
+++ b/internal/llm/tools/shell/shell.go
@@ -47,8 +47,10 @@ func GetPersistentShell(workingDir string) *PersistentShell {
shellInstance = newPersistentShell(workingDir)
})
- if shellInstance == nil || !shellInstance.isAlive {
+ if shellInstance == nil {
shellInstance = newPersistentShell(workingDir)
+ } else if !shellInstance.isAlive {
+ shellInstance = newPersistentShell(shellInstance.cwd)
}
return shellInstance