Skip to content

Commit 18a74f0

Browse files
chore: allow LLM to handle failed tool calls
1 parent ca203da commit 18a74f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/engine/cmd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ func (e *Engine) runCommand(ctx Context, tool types.Tool, input string, toolCate
8080
}
8181

8282
if err := cmd.Run(); err != nil {
83+
if toolCategory == NoCategory {
84+
return fmt.Sprintf("ERROR: got (%v) while running tool, OUTPUT: %s", err, all), nil
85+
}
8386
_, _ = os.Stderr.Write(output.Bytes())
8487
log.Errorf("failed to run tool [%s] cmd %v: %v", tool.Parameters.Name, cmd.Args, err)
8588
return "", fmt.Errorf("ERROR: %s: %w", all, err)

0 commit comments

Comments
 (0)