Skip to content

review-batch: single-review JSON failure aborts entire session #132

Description

@don-petry

Problem

During the scheduled review run (run #25707852006), the single-review step invoked claude-opus-4-7 to confirm an approval for PR #129. The model ran for ~74 seconds and returned a non-JSON response, causing the entire batch session to abort — skipping all 35 remaining PR candidates.

Failure trace

[approve] triage cleared — running single confirmation (claude-opus-4-7)
##[error]single-review did not produce valid JSON
##[error]Review failed for .../pull/129 (exit code 1)
##[error]Session aborted early after failure on .../pull/129 (exit code 1). Skipped 35 remaining candidate(s)
Summary: 0 reviews posted, 0 no-ops skipped, 1 failures (processed 1/36 candidates) [SESSION ABORTED EARLY]

Root cause

The audit/confirmation model (claude-opus-4-7) did not return structured JSON — likely due to a verbose non-JSON response, a refusal, or a timeout/context-limit issue. The scripts/review-batch.sh script treats any per-PR failure as fatal and exits, aborting all remaining candidates.

Acceptance Criteria

  • Resilient JSON parsing: If single-review (or any review engine call) returns non-JSON output, the error is caught, logged with the raw output, and treated as a per-PR failure — not a fatal crash.
  • Per-PR isolation: A failure on one PR does not abort the session. Remaining candidates continue to be processed.
  • Retry logic: The single-review step retries at least once (with a short delay) before marking the PR as failed, to handle transient model errors.
  • Fallback behavior: If the audit model fails after retries, the system can optionally fall back to the triage-level decision (or skip and flag for manual review) rather than hard-failing.
  • Accurate summary: The final session summary correctly reports the number of skipped/failed PRs and does not claim SESSION ABORTED EARLY when only individual PRs fail.
  • No regression: Existing review logic (triage → escalation → deep review → audit flow) continues to work correctly for PRs that do not encounter errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions