fix(cli): safely restore grep signal controls - #12882
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The incremental commit renames the Files Reviewed (1 file)
Previous Review Summary (commit 348db37)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 348db37)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
The core settlement design checks out: bounded ripgrep commands settle on direct process exit instead of Files Reviewed (12 files)
Reviewed by kimi-k3 · Input: 34.1K · Output: 3.7K · Cached: 235.5K Review guidance: REVIEW.md from base branch |
…ion-with-agent-safety-tests fix(cli): safely restore grep signal controls
PR #12811 added configurable grep context, limits, literal matching, and case-insensitive matching, but bounded searches could leave an agent waiting after the direct ripgrep process had already exited. PR #12847 reverted the controls because descendants retaining inherited output pipes could delay Node's
closeevent indefinitely.This restores the signal controls while making early settlement an explicit ripgrep-only process policy. Bounded ripgrep commands settle on direct process exit, clean up owned process-group descendants on POSIX, and retain force-kill escalation for cancellation. Other commands keep the existing close-based lifecycle, so ordinary background shell processes are not pulled into this behavior.
The regression coverage recreates the inherited-pipe condition with a platform-specific fake ripgrep executable. The existing unit matrix exercises settlement and cancellation on Linux, macOS, and Windows; POSIX jobs additionally assert owned process-group cleanup while detached descendants remain untouched.