core: rg process not aborted when interrupting Glob tool #7736

Closed
opened 2026-02-16 18:08:05 -05:00 by yindo · 1 comment
Owner

Originally created by @goniz on GitHub (Jan 27, 2026).

Originally assigned to: @thdxr on GitHub.

Description

When using the Glob tool (which uses Ripgrep.files()) it might be stuck going through lots of files.
OpenCode allows to interrupt the current tool call with ESC but Ripgrep specifically did not stop the process from running.

While the user thinks the file search was interrupted, the process continues in the background 🤷🏻‍♂️

Plugins

No response

OpenCode version

1.1.36

Steps to reproduce

  1. Run the prompt: use glob to search for "filename.txt" on /
  2. Inspect the rg process is running
  3. Hit ESC to interrupt the tool call
  4. Inspect the rg process is still running

Screenshot and/or share link

https://github.com/user-attachments/assets/6263962c-5015-4e94-b52c-9aa6823e53ab

Operating System

Arch Linux

Terminal

Ghostty

Originally created by @goniz on GitHub (Jan 27, 2026). Originally assigned to: @thdxr on GitHub. ### Description When using the `Glob` tool (which uses `Ripgrep.files()`) it might be stuck going through lots of files. OpenCode allows to interrupt the current tool call with `ESC` but `Ripgrep` specifically did not stop the process from running. While the user thinks the file search was interrupted, the process continues in the background 🤷🏻‍♂️ ### Plugins _No response_ ### OpenCode version 1.1.36 ### Steps to reproduce 1. Run the prompt: `use glob to search for "filename.txt" on /` 2. Inspect the `rg` process is running 3. Hit `ESC` to interrupt the tool call 4. Inspect the `rg` process is still running ### Screenshot and/or share link https://github.com/user-attachments/assets/6263962c-5015-4e94-b52c-9aa6823e53ab ### Operating System Arch Linux ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:08:05 -05:00
yindo closed this issue 2026-02-16 18:08:05 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

This issue might be a duplicate of or related to existing issues. Please check:

  • #10563: Memory Leak: Orphaned processes when terminal closes without explicit exit - This issue covers the broader problem of OpenCode not properly terminating child processes, which is the same root cause as the rg process continuing in the background.

These issues both stem from the same underlying problem: child processes (like ripgrep) are not being properly killed when interrupted or when OpenCode exits. The fix for one should help address the other.

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of or related to existing issues. Please check: - #10563: Memory Leak: Orphaned processes when terminal closes without explicit exit - This issue covers the broader problem of OpenCode not properly terminating child processes, which is the same root cause as the `rg` process continuing in the background. These issues both stem from the same underlying problem: child processes (like ripgrep) are not being properly killed when interrupted or when OpenCode exits. The fix for one should help address the other.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7736