From 2d7799275046ef5cd48f4a11dbff9c49cddee9ee Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Mon, 7 Sep 2026 00:22:40 +0530 Subject: [PATCH] fix(file-ops): reuse _kill_process_group_posix in the native rg runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A bare os.killpg/signal.SIGKILL trips the Windows-footgun lane (the module is imported on Windows even though the native lane never runs there). The local environment already has the POSIX group killer with the TERM→KILL escalation and setsid-escapee sweep; use it. --- tools/file_operations_search.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/file_operations_search.py b/tools/file_operations_search.py index f111a316a0..c97fe6ace1 100644 --- a/tools/file_operations_search.py +++ b/tools/file_operations_search.py @@ -4,12 +4,10 @@ (no I/O). """ -import contextlib import os import posixpath import re import shlex -import signal import subprocess import sys import threading @@ -335,7 +333,7 @@ class SearchMixin: ``merge_stderr`` mirrors the shell path's stderr handling: merged for content search (diagnostics feed the error message), discarded (``2>/dev/null``) for file lists and probes.""" - from tools.environments.local import _make_run_env + from tools.environments.local import _kill_process_group_posix, _make_run_env cwd = getattr(self.env, "cwd", None) or self.cwd args = shlex.split(" ".join(argv)) try: @@ -373,8 +371,7 @@ class SearchMixin: exit_code = 124 break if proc.poll() is None: - with contextlib.suppress(ProcessLookupError, PermissionError): - os.killpg(proc.pid, signal.SIGKILL) + _kill_process_group_posix(proc) # native lane is POSIX-only (gate above) proc.wait() drainer.join() proc.stdout.close()