Skip to content

Conversation

@Davidyz
Copy link
Contributor

@Davidyz Davidyz commented Feb 19, 2025

Description

Currently, the tool class discard stdout when stderr is not empty even if the exit code is 0. In the real world a lot of programs/libraries (in my case, VectorCode) use stderr for warnings that don't actually terminate the command. The current way in which stdout and stderr are handled caused false negatives in some cases (outputs with useful information get thrown away).

I'm not sure if it's appropriate to call both output.error and output.success. I simply copied the code under elseif not vim.tbl_isempty(stdout) then here.

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make docs to update the vimdoc pages

@olimorris
Copy link
Owner

Great inclusion, thanks.

I'm currently working on refactoring the tools class. Hopefully finished tomorrow. No changes to functionality but it needs splitting out into separate files, so hopefully easier to understand.

@olimorris olimorris merged commit d8de491 into olimorris:main Feb 19, 2025
4 checks passed
@Davidyz Davidyz deleted the davidyz/tool_keep_stdout branch March 10, 2025 22:23
cleong14 pushed a commit to cleong14/codecompanion.nvim that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants