summaryrefslogtreecommitdiffhomepage
path: root/internal/llm/tools/shell/shell.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-16 20:06:23 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 13:42:00 +0200
commitbbfa60c787f2ec459f1689b9a650ddbec9693ed9 (patch)
treef7f2aa31c460c8cc22ec40cc299c386277152241 /internal/llm/tools/shell/shell.go
parent76b4065f17b87a63092acfd98c997bab53700b35 (diff)
downloadopencode-bbfa60c787f2ec459f1689b9a650ddbec9693ed9.tar.gz
opencode-bbfa60c787f2ec459f1689b9a650ddbec9693ed9.zip
reimplement agent,provider and add file history
Diffstat (limited to 'internal/llm/tools/shell/shell.go')
-rw-r--r--internal/llm/tools/shell/shell.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/llm/tools/shell/shell.go b/internal/llm/tools/shell/shell.go
index 64592f67d..4a776478a 100644
--- a/internal/llm/tools/shell/shell.go
+++ b/internal/llm/tools/shell/shell.go
@@ -83,11 +83,21 @@ func newPersistentShell(cwd string) *PersistentShell {
commandQueue: make(chan *commandExecution, 10),
}
- go shell.processCommands()
+ go func() {
+ defer func() {
+ if r := recover(); r != nil {
+ fmt.Fprintf(os.Stderr, "Panic in shell command processor: %v\n", r)
+ shell.isAlive = false
+ close(shell.commandQueue)
+ }
+ }()
+ shell.processCommands()
+ }()
go func() {
err := cmd.Wait()
if err != nil {
+ // Log the error if needed
}
shell.isAlive = false
close(shell.commandQueue)