Skip to content

Fix Linux command stopping and a stalled Claude Code queue, and make CI pass - #20

Merged
reka18 merged 3 commits into
mainfrom
fix/linux-group-kill
Nov 26, 2026
Merged

reka18 merged 3 commits into
mainfrom
fix/linux-group-kill

Conversation

@reka18

@reka18 reka18 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Stopping a command signalled the wrong processes (Linux)

CodeSmith ran /bin/kill -TERM -<pgid>, without --. Traced with signal 0 in containers:

System procps Call made for group 12345
Ubuntu 24.04 4.0.4 kill(-1): every process the user may signal
Debian 12 4.0.2 kill(-1)
Ubuntu 22.04 3.3.17 kill(0): CodeSmith's own process group

On 24.04 and Debian 12 only the first digit is kept, so a command also ignored the stop. v0.4.1 has the same code. stop_child now uses kill(2) through signal_group, which refuses groups 1 and below.

A queued Claude Code request could stall

The queue was woken while the finishing session was still locked, so a waiter could miss it and time out after 120 s. It is now woken after the unlock, and after a prewarm. Reproduced by holding the lock longer; there is no reliable regression test.

CI

  • Two compaction tests raced a background summary for queued replies; a background command test required a turn within 900 ms.
  • scripts/ci.sh runs every test target even after one fails.

Replaces the diagnostic in #19.

procps's kill (Ubuntu 24.04) reads `-TERM -1234` as `kill(-1, SIGTERM)`:
only the first digit of the group. A stopped command ignored the stop, and
a group starting with 1 signalled every process the user has.
…nlocked

The wake-up was sent while the session's lock was still held, so a waiter
could fail to stop its process, go back to sleep with no other wake-up due,
and sit out the queue time. A prewarmed process now wakes waiters too.
…arget in CI

Two compaction tests queued replies after the first turn, racing its
background summary for them. The background command test required a turn
to finish within 900 ms; it now holds the command open instead. CI runs
all test targets so one run shows every failure.
@reka18 reka18 changed the title Signal a command's process group directly instead of through /bin/kill Fix Linux command stopping and a stalled Claude Code queue, and make CI pass Nov 26, 2026
@reka18
reka18 merged commit c1fc851 into main Nov 26, 2026
3 checks passed
@reka18
reka18 deleted the fix/linux-group-kill branch November 26, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant