Skip to content

Commit d8de491

Browse files
authored
feat(tools): when stderr is not empty, do not discard stdout when exit code is 0 (#955)
1 parent 8fcb2f5 commit d8de491

File tree

1 file changed

+5
-0
lines changed
  • lua/codecompanion/strategies/chat/tools

1 file changed

+5
-0
lines changed

lua/codecompanion/strategies/chat/tools/init.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ function Tools:run()
404404
output.error(cmd, strip_ansi(stderr))
405405
log:debug("[Tools] %s finished with stderr: %s", self.tool.name, stderr)
406406
stderr = {}
407+
if code == 0 then
408+
output.success(cmd, strip_ansi(stdout))
409+
log:trace("[Tools] %s finished with output: %s", self.tool.name, stdout)
410+
stdout = {}
411+
end
407412
elseif not vim.tbl_isempty(stdout) then
408413
output.success(cmd, strip_ansi(stdout))
409414
log:trace("[Tools] %s finished with output: %s", self.tool.name, stdout)

0 commit comments

Comments
 (0)