Repository navigation
fix(skills/bounding-heavy-commands): stop a joined line of bounded commands on one Ctrl-C - #71
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Non-SIGINT signals can escape between measured rows, and the shell behavior is overstated in documentation.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Updates the bounded-command wrapper so Ctrl-C stops joined command lines after cleanup.
Changes:
- Re-raises received stop signals after cleanup.
- Adds joined-line and signal-status process tests.
- Documents signal behavior for measured rows.
| File | Description |
|---|---|
skills/bounding-heavy-commands/SKILL.md |
Documents measured-row signal handling. |
skills/bounding-heavy-commands/scripts/bounded_run.py |
Tracks signals and terminates accordingly. |
skills/bounding-heavy-commands/scripts/tests/test_bounded_run.py |
Tests wrapper and joined-line signal behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3cca79c to
414be42
Compare
|
Review round on 3cca79c (review 5363805257). No suppressed findings.
Comment gate, self-evaluated because this session could not dispatch an agent: this PR's code comments did not change. The comments in the rows loop and in |
414be42 to
910ee86
Compare
910ee86 to
c408db0
Compare
c408db0 to
7c6f96d
Compare
|
Review round on c408db0 (review 5364081988). No suppressed findings.
Comment gate: no code comment changed. |
A line of wrapper calls joined with ';' needed one Ctrl-C for each call. The wrapper caught the signal, cleaned up, and exited normally with 130, so the shell ran the next call. When a stop signal (SIGINT, SIGTERM, SIGHUP, SIGQUIT) reaches the wrapper, while it waits in the queue or while the command runs, the wrapper now finishes its cleanup and its lines, restores the default handler, and sends the signal to itself. The shell sees a death by signal and stops the line. A caller that reads the status still reads 128 plus the signal. A command that exits 130 by itself, with no signal to the wrapper, still gives a normal exit 130. --measure-rows still stops its rows first. The --inside-cap process is unchanged: its parent wrapper got the signal and ends by it. Fixes #69 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a Ctrl-C, not on a signal to the wrapper alone The shell stops a line of joined commands when it gets the interrupt too, as with a Ctrl-C at the terminal. A signal sent to the wrapper alone ends the wrapper by that signal, and the shell runs the next command of the line. The usage text and the skill said that each stop signal to the wrapper stops the line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ust get the signal too The docstring said that a shell stops a joined line when the running command dies from a signal. The shell stops it only when it got the signal as well, as with a Ctrl-C at the terminal; the caller test shows bash going on when only the wrapper is signalled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter a failed row No process test covered the case where a row fails and a later row gets the interrupt. The new test runs --measure-rows in a bash line, lets the first row exit 3, interrupts the second, and checks that the wrapper dies from SIGINT and that the next command of the line does not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7c6f96d to
1955b7c
Compare


Description
Fixes #69
One Ctrl-C did not stop a line of joined wrapper calls, such as the measurement line of #63. The wrapper caught the signal, cleaned up, and exited normally with 130, so the shell started the next call and the user had to press Ctrl-C once per command. After its cleanup and its output lines, a wrapper that received SIGINT, SIGTERM, SIGHUP, or SIGQUIT now restores the default handler and sends the signal to itself, so the shell sees a death by signal and stops the line. A
--measure-rowsrun that had a failed row and is then stopped by a signal now ends by that signal (a shell reads 128+N) rather than with the failed row's exit code.Changes
--measure-rowsoutside a running row, and when SIGINT arrives during the queue wait. After cleanup it dies from that signal. For SIGQUIT the core-file limit is set to 0 first.--measure-rowsrow of the skill's option table now says that a stop signal ends the wrapper by that signal, so a Ctrl-C, which reaches the shell too, stops a joined line. A signal sent to the wrapper alone does not stop the shell's line.Challenges
A test with
shproves nothing on systems whereshis dash: dash dies from a group SIGINT by itself, so the line stops even without the fix. The new tests usebash, which stops a line only when the running command dies from the signal, and they are skipped where bash is missing.Related
Testing
TDD with process tests. Each runs
bash -c '<wrapper call>; touch <file>'in its own process group and sends SIGINT to the group, as a terminal does. The cases: Ctrl-C while the command runs, Ctrl-C while the wrapper waits in the queue (a holder takes all the slots), and Ctrl-C during--measure-rows. In each, the line stops and the file is not created. Two guard tests cover existing behavior: a command that exits 130 by itself lets the line continue, and a signal sent to the wrapper alone gives the caller 130 or 143. The first three failed before the change, because the line continued. The existing process tests now expect death by signal. The full suite (312 tests) passes through the queue.🤖 Generated with Claude Code