aterminate_process_group now waits for proc.returncode and then treats os.killpg(pgid, 0) as proof that the recorded group is still the child process's group. After the child is reaped, its pgid can be reused as soon as the original group empties. If a new group takes that number during the grace window, _group_has_members() returns true and the timeout branch calls os.killpg(pgid, SIGKILL) at the linked hunk, which can terminate unrelated processes during cancellation.\n\nThe signal-0 probe proves only that some group with that number exists; it does not bind that group to the child or one of its descendants. Keep a start-time-verified group-member witness, or otherwise verify group identity, before issuing the group-wide SIGKILL. If the recorded group cannot be proven, skip the group-wide signal and retain the direct-child cleanup.\n\nCode hunk at the merge commit: https://github.com/ohdearquant/lionagi/blob/4cb490efc0bc8071d297c92f2d8c2164eb170fe7/lionagi/ln/_proc.py#L342-L360\n\nMerged pull request: #3401
aterminate_process_group now waits for proc.returncode and then treats os.killpg(pgid, 0) as proof that the recorded group is still the child process's group. After the child is reaped, its pgid can be reused as soon as the original group empties. If a new group takes that number during the grace window, _group_has_members() returns true and the timeout branch calls os.killpg(pgid, SIGKILL) at the linked hunk, which can terminate unrelated processes during cancellation.\n\nThe signal-0 probe proves only that some group with that number exists; it does not bind that group to the child or one of its descendants. Keep a start-time-verified group-member witness, or otherwise verify group identity, before issuing the group-wide SIGKILL. If the recorded group cannot be proven, skip the group-wide signal and retain the direct-child cleanup.\n\nCode hunk at the merge commit: https://github.com/ohdearquant/lionagi/blob/4cb490efc0bc8071d297c92f2d8c2164eb170fe7/lionagi/ln/_proc.py#L342-L360\n\nMerged pull request: #3401