Skip to content

bug: csa review silent failure — zero output on subprocess crash #273

@RyderFreeman4Logos

Description

@RyderFreeman4Logos

Summary

When a csa review subprocess crashes (e.g., SIGTERM, EPIPE), the caller receives zero stdout output and only a generic error message. The subprocess's stderr (containing the actual crash details) is lost because the pipe is already closed when the crash occurs.

Related

Companion to #272 (recursive invocation root cause). This issue focuses on the observability problem: even after #272 is fixed, future subprocess crashes will be equally opaque without better error reporting.

Current Behavior

$ csa review --branch main
# stdout: (empty)
# stderr: "Error: Execution interrupted by SIGTERM"
# exit code: 143 or 144

The actual crash information (Node.js EPIPE stack trace, claude-code-acp error details) is written to the subprocess's stderr but never reaches the caller because:

  1. CSA sends SIGTERM to the subprocess
  2. Subprocess tries to write error to stderr → EPIPE (pipe already closed)
  3. CSA only reports the SIGTERM, not what caused the subprocess to hang/fail

Expected Behavior

$ csa review --branch main
# stderr should include:
# Error: Subprocess 'claude-code' crashed with EPIPE
# Last 10 lines of subprocess stderr:
#   node:events:486  throw er;
#   Error: write EPIPE at ...utils.js:50:28
# Session: 01KJEVXNPXJSK8JD18AQVPHP27

Suggested Fix

  1. Keep subprocess stderr pipe open until after the process fully exits
  2. Capture the last N lines of subprocess stderr before reporting the error
  3. Include subprocess stderr in the session metadata for post-mortem analysis
  4. If subprocess exits non-zero, always include its stderr in the error report

Environment

  • csa 0.1.43 (v0.1.15-38-g718232d-dirty)
  • Linux 6.1.0-43-amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions