← Back to PRs

#22502: fix(errors): distinguish process termination from billing errors

by Shuai-DaiDai open 2026-02-21 07:21 View on GitHub →
agents size: XS
Fixes #11722 When local `exec` commands are terminated by SIGPIPE (exit code 141) or SIGKILL (exit code 137), they were incorrectly reported as "API billing errors". ## Changes - Added `isProcessTerminationError()` function to detect SIGPIPE/SIGKILL signals - Modified `isBillingErrorMessage()` to exclude process termination errors - Users now see appropriate error messages instead of misleading billing warnings ## Testing 1. Run a command that triggers SIGPIPE: `curl -I https://example.com 2>&1 | head -n 5` 2. Verify the error message mentions process termination, not billing --- Feedback welcome! <!-- greptile_comment --> <h3>Greptile Summary</h3> Added `isProcessTerminationError()` function to detect SIGPIPE (exit code 141/signal 13) and SIGKILL (exit code 137/signal 9) errors, and modified `isBillingErrorMessage()` to exclude these process termination errors, preventing them from being incorrectly reported as API billing errors. <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with low risk - The implementation correctly identifies process termination signals and prevents false positives in billing error detection. The logic is sound, covers all relevant signal codes (both numeric and name-based), and the change is narrowly scoped to fix a specific issue. - Consider adding unit tests for `isProcessTerminationError()` to verify all signal detection patterns work correctly <sub>Last reviewed commit: 7e90325</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs