fix: suppress auto-continue on signal deaths (#222)#226
Merged
Nathan Schram (nathanschram) merged 1 commit intodevfrom Mar 23, 2026
Merged
fix: suppress auto-continue on signal deaths (#222)#226Nathan Schram (nathanschram) merged 1 commit intodevfrom
Nathan Schram (nathanschram) merged 1 commit intodevfrom
Conversation
…222) When earlyoom killed Claude sessions (rc=143/SIGTERM), auto-continue detected last_event_type=user and immediately respawned all 4 killed sessions (~5 GB of new processes) into the same memory pressure. This caused a death spiral where sessions were killed and respawned repeatedly. Fix: _should_auto_continue now checks proc_returncode — signal deaths (rc>128 or rc<0) are excluded. The upstream bug #34142/#30333 exits with rc=0, so auto-continue still works for its intended purpose. - Add _is_signal_death() helper to runner_bridge.py - Add proc_returncode field to JsonlStreamState - Store returncode on stream state after process exit - Pass proc_returncode through to _should_auto_continue - 12 new tests for signal death detection and auto-continue gating Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Auto-continue was causing a death spiral when earlyoom killed Claude sessions. Now suppressed on signal deaths (rc=143/SIGTERM, rc=137/SIGKILL).
The death spiral: earlyoom kills 4 sessions → all have
last_event_type=user→ auto-continue respawns all 4 (~5 GB new processes) → earlyoom kills them again → repeat.The fix:
_should_auto_continuenow checksproc_returncode— signal deaths (rc>128 or rc<0) are excluded. The upstream bug #34142/#30333 exits with rc=0, so auto-continue still triggers for its intended purpose.Closes #222
Changes
src/untether/runner_bridge.py—_is_signal_death()helper +proc_returncodeparam on_should_auto_continuesrc/untether/runner.py—proc_returncodefield onJsonlStreamState, set afterproc.wait()tests/test_exec_bridge.py— 12 new tests (7 auto-continue + 5 signal death)tests/test_exec_runner.py— default assertion forproc_returncodeTest plan
🤖 Generated with Claude Code