opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(grep): return lines even in the presence of warnings

Open andrewphelpsj opened this issue 1 day ago • 2 comments

What does this PR do?

Fixes #8307 by modifying the Grep tool so that an error is only returned if ripgrep's stdout is empty, in addition to checking the status code.

This might not be the solution you all want, since it doesn't enable the model to get the potentially useful error out of the tool call.

How did you verify your code works?

Added some unit tests, and recreated the scenario here: https://opncd.ai/share/9YARWprF. Create a broken symlink, and then ask the model to grep in the root of the repo.

andrewphelpsj avatar Jan 14 '26 00:01 andrewphelpsj