Skip to content

claude-review + claude-security-review fail inside the SDK on every PR, while the check row still reports passΒ #1327

Closed

Description

@kyle-sexton

πŸ€– AI-generated (self-observation from the /work-items:work-loop worker lane, cycle 5, while executing #1082 β†’ PR #1311).

Observation

claude-review and claude-security-review are failing inside the Claude SDK on essentially every open PR. The workflows themselves succeed β€” the failure is inside them.

Observed on PR #1311:

{"subtype":"success","is_error":true,"num_turns":1,"duration_ms":594,"total_cost_usd":0}
{"subtype":"success","is_error":true,"num_turns":1,"duration_ms":757,"total_cost_usd":0}

num_turns: 1, sub-second, total_cost_usd: 0 β€” it fails before doing any work. The only comment
claude[bot] leaves is the placeholder "I'll analyze this and get back to you."

Retry does not help. I re-ran both runs (30160800194, 30160800163); both failed identically
(1s, then 0s). Not transient.

It is repo-wide, not branch-specific. 4 of the 5 most recently opened PRs carry the infra-status
warning: #1323, #1322, #1320, #1319 (and #1311). #1326 was too new to have run yet.

The part that matters most

The check row reports review / review pass. The workflow exits 0 while the review inside it
did nothing. So a green gh pr checks row is not evidence that an AI review ran β€” and any lane
that gates on check status alone (/source-control:babysit-prs' readiness gate, the babysit_loop
merge rung, a human skimming the checks list) will read "reviewed, clean" where the truth is
"never ran."

The repo's claude-review-infra-status gate already exists and is doing its job correctly β€” it
posts the warning and says in as many words: "Treat any Claude comment on this PR ... as
incomplete, not 'no findings.'"
That warning is a PR comment, though, while the merge signal
most consumers read is the check row, and the two currently disagree.

Why this is ours

The workflows, the infra-status gate, and the lanes that consume their output are all org-owned.
The underlying SDK failure may be credential/environment-level (the zero cost and zero turns point
that way), but the green-check-on-absent-review mismatch is a design question we own regardless of
what caused the SDK error.

Suggested shape of a fix

Not prescribing, but the load-bearing pieces:

  • Diagnose the SDK failure itself β€” is_error: true at num_turns: 1 with $0 spend suggests
    auth/credential rather than anything about the diffs, given it reproduces across unrelated PRs.
  • Decide whether an errored review should fail the check row, so the merge signal matches the
    comment. If it should stay non-blocking by design, that is a legitimate answer β€” but then the
    lanes that gate on checks need to read the infra-status marker explicitly, since the check row
    alone cannot carry the distinction.
  • Consider whether "review ran and found nothing" and "review never ran" should be
    distinguishable without parsing comment bodies
    for a marker comment.

Reproduction

Open any PR in this repo and read repos/melodic-software/claude-code-plugins/issues/<N>/comments
for the <!-- claude-review-infra-status --> marker. Filed on the observation across five PRs
rather than a reduced case.

Activity

  1. added
    needs-triage
    needs-human
    and removed
    needs-triage
    on Jul 25, 2026
  2. added theissue type on Jul 25, 2026
  3. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Triage result

    Verified. Reproduced directly against PR #1311's live checks:

    • review / review β€” pass, 26s
    • security-review / security-review β€” pass, 29s

    Both green. The PR's <!-- claude-review-infra-status --> comment (posted by the repo's own
    infra-status gate) confirms the SDK call underneath both jobs errored: {"subtype":"success", "is_error":true,"num_turns":1,"duration_ms":582,"total_cost_usd":0}. So the claim holds exactly as
    reported: the check row says "reviewed, clean" while the true state is "review never ran." The
    infra-status gate is doing its documented job (warning comment posted, correctly worded) β€” the gap
    is that the check row it doesn't control still reports pass.

    Root-cause boundary confirmed by reading .github/workflows/claude-review.yml: this repo's workflow
    is a thin caller (skip-actors, runner, secret pass-through only) around
    melodic-software/ci-workflows/.github/workflows/claude-review.yml β€” the reusable workflow that
    actually invokes the SDK and decides the job's exit code. Same shape for claude-security-review.yml.
    The fix surface (SDK-error β†’ job-exit-code mapping) lives in the ci-workflows repo, not here.

    Agent Brief

    Type: Bug
    Summary: The claude-review and claude-security-review reusable-workflow callers report a
    passing check row even when the underlying Claude SDK call errors out before performing any review,
    so a green check is not reliable evidence a review occurred.

    Current behavior:
    When the SDK call inside the reusable review workflow fails immediately (observed: is_error: true,
    num_turns: 1, sub-second duration, total_cost_usd: 0), the calling job still exits success. The
    PR-level infra-status gate (this repo's own automation) detects the failure pattern and posts a
    warning comment, but nothing changes the check row itself. A consumer reading only gh pr checks (or
    any status-check API) cannot distinguish "reviewed, no findings" from "review never ran."

    Desired behavior:
    Downstream consumers of the review check status β€” this repo's babysit-prs readiness gate, the
    babysit_loop merge rung, and any human skimming gh pr checks β€” must be able to trust the check
    row alone (no comment-body parsing) to know whether an AI review actually completed. Concretely, one
    of:

    • The reusable workflow surfaces the SDK error as a failing/non-passing check status, so the merge
      signal and the infra-status comment agree; or
    • The check row stays intentionally non-blocking by design, and every consumer that gates on check
      status is updated to also read the infra-status marker (or an equivalent structured signal) before
      treating "review passed" as "review ran."

    Either path is legitimate; picking between them is the open call below.

    Key interfaces:

    • The reusable claude-review / claude-security-review workflows in melodic-software/ci-workflows
      β€” specifically whatever step maps the Claude SDK's JSON result (is_error, num_turns,
      total_cost_usd) to the job's exit status.
    • This repo's claude-review-infra-status gate β€” already correctly detects and reports the failure
      pattern in a PR comment; any fix should keep it as the source of truth for "did a review actually
      run," or fold its signal into the check status directly.
    • Any consumer that gates merge/readiness on check status alone (/source-control:babysit-prs
      readiness gate, babysit_loop merge rung) β€” scope only if the decision below keeps the check row
      non-blocking by design.

    Acceptance criteria:

    • An SDK-level review failure (the is_error: true / zero-turn / zero-cost pattern, or any
      equivalent "did not actually run" signal) is distinguishable from a genuine "reviewed, no
      findings" outcome without parsing comment bodies.
    • Re-running the failing job type (or opening a fresh PR) after the fix produces a check-row
      state that matches the infra-status comment's verdict.
    • Whichever consumers gate on check status alone (if the non-blocking-by-design path is chosen)
      are updated to also honor the infra-status/structured signal, and that update is verified against
      each consumer's actual gating logic, not assumed.

    Out of scope:

    • Diagnosing why the SDK call itself errors (credential/auth/environment root cause) β€” this brief
      covers the reporting mismatch, not the underlying SDK failure.
    • Any change to review content or prompt quality; this is purely about failure-signal fidelity.

    Why human-gated

    Two things put this outside autonomous-eligible:

    1. Cross-repo policy decision. The actual fix surface is the reusable workflow in
      melodic-software/ci-workflows, shared by every consuming repo β€” a fix here is really a fix (or a
      documented behavior decision) upstream, and this session/repo has no authority to make that change
      unilaterally.
    2. Genuinely open design fork. "Should an errored review fail the check row" vs. "stay
      non-blocking and push consumers to read the infra-status marker" are both legitimate, and the
      choice has real blast radius (a stricter check row could start blocking merges repo-wide). That is
      product/process intent, not a reversible implementation detail a maintainer could veto after the
      fact β€” it needs a human call up front.

    Priority: set to priority: high (reserved for items that block other work). Rationale: this
    silently invalidates the trustworthiness of the check-row signal that /source-control:babysit-prs
    and any human relies on across every open PR in the repo (4 of the 5 most recent), not a single
    isolated case β€” reporter did not self-label a severity.

    Redundancy / ledger check

    No existing implementation handles SDK-error β†’ check-status mapping (the infra-status gate covers
    comment-posting only, confirmed by reading its output on PR #1311). No docs/out-of-scope/ directory
    in this repo, so no rejected-concept ledger to check. Not a duplicate of open intake β€” no other open
    item addresses this failure-signal mismatch.

  4. kyle-sexton commented on Jul 29, 2026

    @kyle-sexton
    MemberAuthor

    πŸ€– Agent-authored (autonomous triage lane) β€” AI-generated, not human-reviewed at authoring time. Evidence is linked; verify before acting.

    New instance of this gap, with a live log β€” and the incoming fix does not close it

    Surfaced while triaging #1684 (the bump of the claude-security-review pin to ci-workflows 66073e5, the fail-closed fix). Recording it here rather than only on that PR, because the defect outlives the PR and this issue is the durable home for the class.

    security-review / security-review is a required status check on main (confirmed via the branch ruleset). On PR #1684 it reported success in 11s with no security review performed.

    Job 90475836554:

    ##[warning]Skipping action due to workflow validation: Workflow validation failed.
    The workflow file must exist and have identical content to the version on the
    repository's default branch.
    Error is not retryable, giving up immediately
    Exiting due to workflow validation skip
    

    The action exits 0 on that skip. Step-conclusion chain confirms the lane read it as a completed review:

    • Claude security review β†’ success
    • Report review outcome β†’ success
    • Comment on genuine review failure β†’ skipped
    • Clear stale failure comment after successful review β†’ success
    • job conclusion β†’ success

    Why this matters for the fix already in flight

    ci-workflows#269 (66073e5) fails closed by keying on review_failed, which is derived from the action's outcome. A clean exit-0 skip is indistinguishable from a completed review, so the new mapping does not catch this class. Verified empirically: the run above was produced by the new pin on #1684's head β€” its Back off before the review retry / Claude security review (retry) steps are present, so 66073e5 was in effect and still reported green.

    Scope, stated fairly:

    • Not a regression from chore(ci): bump claude-security-review pin to 66073e5 for the fail-closed fixΒ #1684 β€” this is upstream action behavior, present on the old pin (e295107) too, and orthogonal to the pin value.
    • Narrow but sharply aimed: it fires only on PRs whose caller workflow file differs from the default branch β€” i.e. exactly the security-sensitive CI-surface PRs.
    • Structural, not incidental: it means the first PR to bump this pin can never be validated by the lane it is bumping. A re-run cannot clear it; only merging can.

    Net: after #1684 merges, the 429/SDK class this issue reports is closed for the security-review lane, and the workflow-validation-skip class remains open on a required context.

    Remaining action for a human

    An upstream issue on melodic-software/ci-workflows for the exit-0 skip class β€” this lane does not open issues there. Candidate shape: treat "action skipped without producing an execution result" as a no-verdict path that fails closed, distinguished from a completed review by the presence of an execution file rather than by the step's exit status.

    Also worth noting from #269's own body, and unratified: fork PRs now skip at job level, and a skipped job reads as success to a ruleset β€” a second unreviewed-but-green path on this required context, which (unlike the skip-actors exception) never got operator ratification.

  5. kyle-sexton commented on Aug 6, 2026

    @kyle-sexton
    MemberAuthor

    Root cause, and where this now sits in the lane taxonomy

    Not closing this β€” it carries needs-human, and that label bars autonomous resolution. Everything below is the evidence a human needs to close it; the close itself is yours.

    Root cause

    The symptom here β€” both lanes failing inside the SDK on every PR while the check row still reports pass β€” is the gate-passes-by-design property working as intended on top of an infrastructure failure. The lanes are advisory: an infra failure is not a code-quality signal, so the check concludes green. That is correct behavior for a PR gate and catastrophic for a fleet, because nothing aggregated those failures.

    That aggregation gap is what melodic-software/ci-workflows#238 built and Phase 4 has now acceptance-tested end to end.

    What now exists

    The reusable lane emits a machine-readable class=<token> annotation plus a marker comment naming the failure class. A scheduled aggregator in ci-workflows polls consumer repos for those annotations and maintains exactly one incident issue, auto-closing after three clean cycles. Demonstrated live against a forced-failure fixture: a green check carrying class=auth with api_error_status: 401, an incident opened, and auto-closed on recovery.

    So the 19-hour-mystery shape that motivated this issue and #1122 is now a one-minute diagnosis: the class token names the failure, and the incident issue names the affected repos.

    The part that matters for THIS issue, and it is not good news

    This issue's own failure signature classifies as class=other, which is non-escalating by design. Detection is real β€” the class is recognized and tallied β€” but no incident opens, and a reader must not expect one. That was a deliberate choice: other covers failures that are transient or benign often enough that escalating them would page a human for noise.

    The consequence for the instant-fail shape described here is that the taxonomy sees it without escalating it. If a repeat of this incident should page someone, that is a decision about whether the instant-fail signature deserves its own escalating class rather than falling into other β€” and it needs a human to make it. That is the substantive question I would want answered before this closes.

    Related finding worth reading before you close

    Phase 4 also uncovered a failure mode the taxonomy cannot see at all, tracked as melodic-software/ci-workflows#363: when claude-code-action skips itself on workflow validation it exits 0, the check concludes green, nothing is reviewed, and no class= token is emitted. An annotation-based aggregator is structurally blind to it. That is the same harm class as this issue, still uncovered, and it is the strongest argument for the synthetic canary that #228 deferred.

    Pointers

    πŸ€– Generated with Claude Code

  6. kyle-sexton commented on Aug 8, 2026

    @kyle-sexton
    MemberAuthor

    Closing on operator authorization (interactive session, 2026-08-07). Root cause and pointer are recorded in the 2026-08-06 comment above; no further action here. This comment was written by an AI agent on the operator's behalf, on explicit operator instruction.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions