summaryrefslogtreecommitdiffhomepage
path: root/internal/llm/tools
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-14 10:52:04 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 13:41:27 +0200
commit9ae05fea12ad05ea356a057f67afdde46d548843 (patch)
treedc61462708c9f1e67d2aa4a6308073532ab5bc7d /internal/llm/tools
parent80cd75c4fb21eb28d82c1f0d672cbd8466c35ed5 (diff)
downloadopencode-9ae05fea12ad05ea356a057f67afdde46d548843.tar.gz
opencode-9ae05fea12ad05ea356a057f67afdde46d548843.zip
handle errros correctly in the bash tool
Diffstat (limited to 'internal/llm/tools')
-rw-r--r--internal/llm/tools/bash.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/llm/tools/bash.go b/internal/llm/tools/bash.go
index d55cb241b..0cea20878 100644
--- a/internal/llm/tools/bash.go
+++ b/internal/llm/tools/bash.go
@@ -273,14 +273,14 @@ func (b *bashTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
},
)
if !p {
- return NewTextErrorResponse("permission denied"), nil
+ return ToolResponse{}, permission.ErrorPermissionDenied
}
}
startTime := time.Now()
shell := shell.GetPersistentShell(config.WorkingDirectory())
stdout, stderr, exitCode, interrupted, err := shell.Exec(ctx, params.Command, params.Timeout)
if err != nil {
- return NewTextErrorResponse(fmt.Sprintf("error executing command: %s", err)), nil
+ return ToolResponse{}, fmt.Errorf("error executing command: %w", err)
}
took := time.Since(startTime).Milliseconds()