fix(work verify): terminalize Ctrl-C cancellation - #448
Conversation
Catch KeyboardInterrupt at the verify-run boundary, terminate the child process group, and write a canceled receipt with preserved evidence instead of leaking a running receipt or printing a traceback. Closes #441 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR makes verification cancellation produce a terminal, neutral outcome. The main changes are:
Confidence Score: 5/5No additional blocking issue qualifies for this review round.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(work verify): retry child terminatio..." | Re-trigger Greptile |
Decode child output with UTF-8 replacement so non-text bytes cannot bypass receipt finalization, and always finalize through a fail-open finally path that covers capture and digest phases. Co-authored-by: Cursor <cursoragent@cursor.com>
A second interrupt during grace-period waits could skip process-group cleanup; retry termination with zero grace before returning. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolves verification.py conflict with #448: receipt reuse now lives inside the cancellation-safe try block; tree_fingerprint and planned_commands fields moved into the in-try receipt construction.
Summary
brigade work verify runboundary, terminate the verifier child process group, and write a terminal receipt instead of leaving arunningreceipt or printing a traceback.canceled(command statusinterrupted, exit code 130) with preserved stdout/stderr, timing, git, and graph evidence where available.verify+canceledas a neutral outcome signal (0), distinct from engineeringfailed(-1).Closes #441
Test plan
brigade work verify run --target . --command "pytest -q tests/test_work_cmd_verification.py::test_work_verify_run_terminalizes_keyboard_interrupt tests/test_work_cmd_verification.py::test_run_verify_child_process_catches_keyboard_interrupt tests/test_work_cmd_verification.py::test_work_verify_run_canceled_status_is_neutral_not_a_regression_signal tests/test_outcome.py::test_signal_value_rewards_only_model_unauthored_success" --capture brigade-workbrigade work verify run --target . --command "./scripts/verify" --capture brigade-workMade with Cursor