fix(gateway): ignore invoking CLI ancestor during PID scan

This commit is contained in:
刘昊 2026-04-23 06:14:21 +08:00
parent a1d57292af
commit 9f7f9aafab
2 changed files with 27 additions and 0 deletions

View file

@ -280,6 +280,8 @@ def _scan_gateway_pids(exclude_pids: set[int], all_profiles: bool = False) -> li
if any(pattern in command for pattern in patterns) and (
all_profiles or _matches_current_profile(command)
):
if _is_pid_ancestor_of_current_process(pid):
continue
_append_unique_pid(pids, pid, exclude_pids)
except (OSError, subprocess.TimeoutExpired):
return []