diff --git a/internal/llm/tools/shell/shell.go b/internal/llm/tools/shell/shell.go index e25bdf3e..08d8a986 100644 --- a/internal/llm/tools/shell/shell.go +++ b/internal/llm/tools/shell/shell.go @@ -47,7 +47,7 @@ func GetPersistentShell(workingDir string) *PersistentShell { shellInstance = newPersistentShell(workingDir) }) - if !shellInstance.isAlive { + if shellInstance == nil || !shellInstance.isAlive { shellInstance = newPersistentShell(shellInstance.cwd) }