Skip to content

Say why a Claude review execution failed - #1140

Merged
blove merged 1 commit into
mainfrom
blove/claude-review-error-reason
Sep 23, 2026
Merged

blove merged 1 commit into
mainfrom
blove/claude-review-error-reason

Conversation

@blove

@blove blove commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

AI review hasn't run on any PR since 2026-07-08. This PR makes the failure name its cause.

What I found

Every Claude Review run errors on its first API call: is_error: true, one turn, ~250ms, $0. Bisecting ~900 runs:

Run Time (UTC)
Last real review 28920061808 2026-07-08 05:34 (9 turns, $0.20 on 2026-07-07)
First failure 28924198235 2026-07-08 07:05

claude-review.yml didn't change between those runs — the last edit was #756 two days earlier, and reviews kept working after it. So the cause is outside the repo: most likely the ANTHROPIC_API_KEY secret or the account's balance, possibly the pinned model claude-sonnet-4-6.

Until #1137 these failures reported success, so every green review check since July 8 was false.

Change

#1137's verifier prints one identical line for every failure, and the action's log strips the error text. So nothing on record distinguishes a revoked key from an empty balance or a retired model. This prints the terminal result's error on failure:

Claude review execution failed or did not finish. No completed review is verified.
Reason: API Error: 400 {...credit balance is too low...}
  • Only when the result reports is_error: true. A finished review's result is the review itself, so Report failed Claude review executions honestly #1137's rule against printing transcript contents still holds and is still tested.
  • One line, capped at 300 characters, with anything key-shaped (sk-ant-…) redacted before truncation, so a key can't be cut in half and leak the other half.

This PR runs its own copy of the verifier (the workflow uses pull_request and checks out the PR head), so its own review job will print the real cause.

Verification

  • node --test scripts/verify-claude-review.spec.mjs — 16/16 (3 new: the reason is printed; it's one bounded, redacted line; no reason is printed without is_error)
  • node --test scripts/ci-workflow.spec.mjs (the suite CI runs) — 61/61
  • eslint clean

🤖 Generated with Claude Code

Every Claude Review run since 2026-07-08 ~06:00 UTC has errored on its first
API call (is_error: true, one turn, ~250ms, $0), so no PR has been AI-reviewed
since. The last real review ran at 05:34 that day; the workflow did not
change in between, so the cause is outside the repo. But the verifier from
#1137 prints the same line for every failure, so the log cannot tell a
revoked key from an empty balance or a retired model.

On an execution that reports is_error: true, print the terminal result's
error text: one line, capped at 300 characters, with anything key-shaped
redacted before truncating. A finished review's result is the review itself,
so nothing is printed unless is_error is true; #1137's rule against printing
transcript contents still holds and is still tested.

This PR runs its own copy of the verifier, so its own review job will name
the cause.
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 23, 2026 7:23pm UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove enabled auto-merge (squash) September 23, 2026 19:21
@blove
blove merged commit d05814d into main Sep 23, 2026
32 of 33 checks passed
@blove
blove deleted the blove/claude-review-error-reason branch September 23, 2026 20:53

This branch was successfully deployed

1 active deployment
Preview – threadplane b7485f88 Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant