[PR #8310] fix(grep): return lines even in the presence of warnings #12699

Closed
opened 2026-02-16 18:17:35 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8310

State: closed
Merged: No


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 warning messages 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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8310 **State:** closed **Merged:** No --- ### 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 warning messages 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.
yindo added the pull-request label 2026-02-16 18:17:35 -05:00
yindo closed this issue 2026-02-16 18:17:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12699