Skip to content

Fix Claude Code CLI abnormal exit (code 159): classify fatal-signal crashes in harness retry logic - #52837

Draft
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/aw-failures-fix-code-cli-crash
Draft

Fix Claude Code CLI abnormal exit (code 159): classify fatal-signal crashes in harness retry logic#52837
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/aw-failures-fix-code-cli-crash

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Avenger's Claude Code CLI step crashed with exit code 159 (128+31 = SIGSYS) twice in one day. The harness only special-cased SIGKILL(137)/SIGTERM(143) as non---continue-able termination signals; any other fatal-signal crash (SIGSYS, SIGSEGV, etc.) fell through to the generic "partial execution" retry path, which resumes the exact on-disk session via --continue — risking an immediate repeat of whatever crashed it.

Changes

  • New crash-signal classification in actions/setup/js/claude_harness.cjs: added a CRASH_SIGNAL_EXIT_CODES map for known fatal-signal exit codes (SIGILL=132, SIGABRT=134, SIGBUS=135, SIGFPE=136, SIGSEGV=139, SIGSYS=159), with isCrashSignalExitCode() and crashSignalNameForExitCode() helpers.
  • Retry decision update: shouldRetryWithContinue() now treats these crash codes like the existing SIGKILL/SIGTERM handling — --continue is disabled and the next attempt starts a fresh session instead of resuming corrupted state.
  • Improved diagnostics: retry logs now surface the resolved signal name (e.g. crashSignal=SIGSYS) alongside the exit code, giving future occurrences a clearer trail without requiring a core dump.
  • Tests: added coverage for the new helpers and the updated shouldRetryWithContinue behavior on crash exit codes (134/139/159).
// Before: exit 159 fell into the generic "partial execution" path → retried with --continue
// After: recognized as a fatal-signal crash → --continue disabled, fresh-run retry
isCrashSignalExitCode(159); // true (SIGSYS)
crashSignalNameForExitCode(159); // "SIGSYS"

…e harness retry logic

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Claude Code CLI abnormal exit (code 159) Fix Claude Code CLI abnormal exit (code 159): classify fatal-signal crashes in harness retry logic Aug 15, 2026
Copilot AI requested a review from pelikhan August 15, 2026 05:33
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: bug | Risk: medium | Score: 66/100

  • Impact: 28/50 (fixes harness mis-classification of fatal-signal crashes, improves retry reliability)
  • Urgency: 20/30 (recurring crash signature, no CI signal yet)
  • Quality: 18/20 (small targeted diff, clear root cause, no reviews yet)

Recommended action: fast_track
Targeted reliability fix for harness crash classification. Batched with reliability-fixes cluster (#52757, #52836, #52854).

Generated by 🔧 PR Triage Agent · auto · 46.6 AIC · ⌖ 2.63 AIC · ⊞ 8.1K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw-failures] [P0] Avenger: Claude Code CLI abnormal exit (code 159) — 2nd crash today, distinct from tracked exit-139

2 participants