[PR #5096] feat(grep): add timeout support with 60s default to prevent hangs when with very big directories #11242

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

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

State: closed
Merged: No


Grep tool hangs indefinitely when searching large directories like node_modules because there's no timeout.

I've been using a custom made tool called 'SafeGrep' in my personal plugin (oh-my-opencode) that has hard-limit timeout thing, but figured this would be more useful in core.

Followed Bash tool's implementation and style:

  • Add 60s default timeout (max 10min)
  • Add abort signal handling

I assumed there would be related issues, but couldn't find any. This was quite annoying in my environment so I thought it was worth fixing—but if this is just my setup or if this PR is heading in the wrong direction, I'd appreciate any feedback!

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5096 **State:** closed **Merged:** No --- Grep tool hangs indefinitely when searching large directories like node_modules because there's no timeout. I've been using a custom made tool called 'SafeGrep' in my personal plugin ([oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode)) that has hard-limit timeout thing, but figured this would be more useful in core. Followed Bash tool's implementation and style: - Add 60s default timeout (max 10min) - Add abort signal handling --- I assumed there would be related issues, but couldn't find any. This was quite annoying in my environment so I thought it was worth fixing—but if this is just my setup or if this PR is heading in the wrong direction, I'd appreciate any feedback!
yindo added the pull-request label 2026-02-16 18:16:02 -05:00
yindo closed this issue 2026-02-16 18:16:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11242