opencode
opencode copied to clipboard
fix(grep): return lines even in the presence of warnings
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.