Fix Claude Code CLI abnormal exit (code 159): classify fatal-signal crashes in harness retry logic - #52837
Conversation
…e harness retry logic Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
PR TriageCategory: bug | Risk: medium | Score: 66/100
Recommended action:
|
PR Triage
Improves harness crash-signal classification to avoid corrupted-session retries. CI unstable — verify before merge. Automated triage — see [PR Triage Report] for full context.
|
|
@copilot generalize to all harnesses |
There was a problem hiding this comment.
Pull request overview
Adds fatal-signal classification to Claude harness retry logic so crashes should restart with a fresh session.
Changes:
- Maps known fatal-signal exit codes to signal names.
- Disables
--continueafter classified crashes. - Adds helper and retry-decision tests.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/claude_harness.cjs |
Adds crash classification, logging, and fresh-session retries. |
actions/setup/js/claude_harness.test.cjs |
Tests crash-code helpers and retry behavior. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| return false; | ||
| } | ||
| if (isSignalTerminationExitCode(exitCode)) { | ||
| if (isSignalTerminationExitCode(exitCode) || isCrashSignalExitCode(exitCode)) { |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Generalized in 8a1c0e6: extracted the crash-signal classification (SIGILL/SIGABRT/SIGBUS/SIGFPE/SIGSEGV/SIGSYS) into a shared |
|
@copilot Quick triage for maintainer-ready follow-up: Please refresh the branch if needed, verify the current unstable status is fully explained or resolved, and run the Outstanding review items:
Failed checks from the compact candidate set:
Branch update was requested automatically for this run when GitHub allows it.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed the outstanding blocking review item in 6f... (see latest commit): |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |
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
actions/setup/js/claude_harness.cjs: added aCRASH_SIGNAL_EXIT_CODESmap for known fatal-signal exit codes (SIGILL=132, SIGABRT=134, SIGBUS=135, SIGFPE=136, SIGSEGV=139, SIGSYS=159), withisCrashSignalExitCode()andcrashSignalNameForExitCode()helpers.shouldRetryWithContinue()now treats these crash codes like the existing SIGKILL/SIGTERM handling —--continueis disabled and the next attempt starts a fresh session instead of resuming corrupted state.crashSignal=SIGSYS) alongside the exit code, giving future occurrences a clearer trail without requiring a core dump.shouldRetryWithContinuebehavior on crash exit codes (134/139/159).branch refresh requested from run https://github.com/github/gh-aw/actions/runs/31886878354> Generated by 👨🍳 PR Sous Chef · gpt54 · 11.7 AIC · ⌖ 5.9 AIC · ⊞ 8.7K · ◷