on main help sign in
chore: fix errors not showing in bash tool
commit931029e1579b57948322bdeda0a7c013202b90c8 authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 11 Jul 2025, 00:28 (1 year ago) parentf99f504
1 file changed+15−1
internal/llm/tools/bash.go+15−1
internal/llm/tools/bash.go+15−1
@@ -4,6 +4,7 @@ import (
44 "context"
55 "encoding/json"
66 "fmt"
7+ "log/slog"
78 "runtime"
89 "strings"
910 "time"
@@ -259,7 +260,7 @@ func NewBashTool(permission permission.Service, workingDir string) BaseTool {
259260 // Set up command blocking on the persistent shell
260261 persistentShell := shell.GetPersistentShell(workingDir)
261262 persistentShell.SetBlockFuncs(createCommandBlockFuncs())
262−
263+
263264 return &bashTool{
264265 permissions: permission,
265266 workingDir: workingDir,
@@ -357,7 +358,20 @@ func (b *bashTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
357358 stdout = truncateOutput(stdout)
358359 stderr = truncateOutput(stderr)
359360
361+ slog.Info("Bash command executed",
362+ "command", params.Command,
363+ "stdout", stdout,
364+ "stderr", stderr,
365+ "exit_code", exitCode,
366+ "interrupted", interrupted,
367+ "err", err,
368+ )
369+
360370 errorMessage := stderr
371+ if errorMessage == "" && err != nil {
372+ errorMessage = err.Error()
373+ }
374+
361375 if interrupted {
362376 if errorMessage != "" {
363377 errorMessage += "\n"