Skip to content

Revert claude-review to single-step + add Anthropic API key preflight#14

Merged
TimJohns merged 1 commit into
mainfrom
revert-claude-review-to-single-step
Jul 26, 2026
Merged

Revert claude-review to single-step + add Anthropic API key preflight#14
TimJohns merged 1 commit into
mainfrom
revert-claude-review-to-single-step

Conversation

@TimJohns

Copy link
Copy Markdown
Member

Two changes, both following from the July 2026 debugging incident where the claude-review failures turned out to be the Anthropic API rejecting the key ($0 cost / is_error), not a workflow-config problem.

1. Revert PR #12 / #13 back to the single-step config

Restores the claude-review job to its pre-#12 form: one claude-code-action call (track_progress for the rich comment + --json-schema for the gate). The two-step rebuild was chasing a misdiagnosis and doubled the Claude cost for no benefit.

2. Add an Anthropic key preflight (the detection mechanism)

Before the costly review runs, a minimal 1-token Anthropic call checks that the key/account can actually make requests:

  • 200 → proceed.
  • 401 → posts a PR comment: the ANTHROPIC_API_KEY is invalid/revoked — rotate it.
  • 400 / 402 → posts a PR comment: the account likely has no credit / a billing issue — check the balance & billing at the Anthropic Console — and fails fast.
  • 429 / network / other → warn and let the review run (don't block on transients).

This replaces the opaque did not return structured_output failure with a clear, actionable message pointing at the real cause.

Note: this restores track_progress + --json-schema in one call. Whether that combination reliably yields both a comment and structured output was never actually validated (every prior run failed on the key first). Once the Anthropic account is healthy, the preflight passes and we can confirm the review works end-to-end — and revisit the config then if needed.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TimJohns
TimJohns merged commit 94f6b5f into main Jul 26, 2026
1 check passed
@TimJohns
TimJohns deleted the revert-claude-review-to-single-step branch July 26, 2026 04:23
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