Repository navigation
Description
What
PR #397's first principal-review run (32457396797) completed a full review — posted as a CHANGES_REQUESTED GitHub PR review with an explicit ## Principal review — verdict: \human-merge`line, plus two newly-filed issues (#406, #400) — but crashed withis_error: true/api_error_status: 429on the very next turn (writingprincipal-verdict.txt`), because it hit the org's 7-day/weekly Claude API usage cap:
"type": "rate_limit_event",
"rate_limit_info": {
"status": "rejected",
"resetsAt": 1787346000,
"rateLimitType": "seven_day",
"overageStatus": "rejected",
"overageDisabledReason": "org_level_disabled",
"isUsingOverage": false
}
...immediately followed by a synthetic zero-token assistant turn and "result": "You've hit your weekly limit · resets 9pm (UTC)". 48 turns in, well under the --max-turns 65 cap raised by #297, so this is not that issue's turn-budget failure mode — it's a distinct trigger with the same "crash discards already-valid work" shape.
Because principal-verdict.txt was never written, principal-review.yml's crash-handling branch (~lines 309-333) found "no usable verdict file" and routed the PR to status:needs-info with a generic "crashed or exhausted its turn budget" comment — discarding a fully valid, already-posted review and its two filed sub-issues. The PR then sat in that state for ~18 hours (2026-08-21 07:28 → 2026-08-22 01:27) until the pipeline health-check routine independently diagnosed the real cause and the human-merge-sweep-agent retried it. That retry (32543462572) re-ran the entire review from scratch and reached byte-for-byte the same conclusions (compare review #4990818640 vs. review #4998543494) — a second, fully paid ~$2+/30k-output-token run that added no information over the first one.
Why
Two compounding gaps:
principal-review.yml's crash-recovery only trusts the localprincipal-verdict.txtfile. The agent's actual verdict was already durably posted viagh pr reviewbefore the crash — viewable any time viagh api repos/LibraVault/reader/pulls/397/reviews— but the workflow has no fallback that checks the most recent PR review body for averdict: \X`line when the file is missing. It only recovers a verdict from the file (theCRASH_VERDICT` check at line ~312-315), not from GitHub's own record of what the agent already posted.- The pipeline health-check routine has no authorized self-heal pattern for this. Its own comment on this PR (2026-08-21T22:32:27Z) states explicitly: "it does not match any of the 5 known failure patterns this routine tracks, and is not self-healing" and recommends filing this as its own tracked issue if it recurs.
resetsAtis deterministic and present in the crash log, so an auto-retry after that timestamp is mechanically straightforward — today it requires a human or the (much less frequent) human-merge-sweep pass to notice and retry.
Fix
- Before falling back to
status:needs-infoon a crashed agent step, haveprincipal-review.ymlcheckgh pr view <PR> --json reviewsfor the latest review's body for averdict: \(auto-merge|human-merge)`` line and use it (flagging the crash in the routing comment, same as the existing "had already written verdict before dying" path) rather than discarding a completed review. - Add "org weekly/7-day rate-limit hit mid-run" (
rate_limit_info.rateLimitType == "seven_day",api_error_status: 429) as a recognized, self-healable pattern (pattern 6) for the pipeline health-check routine: label it distinctly from a generic crash, and auto-retry (status:needs-review) onceresetsAthas passed, instead of requiring a human-merge-sweep pass to notice. - Optional/lower priority: some early-warning signal (even just the health-check routine surfacing remaining weekly quota) before the cap is hit outright — the pipeline now runs dev-agent + qa-agent + principal-review-agent + human-merge-sweep-agent + the 2-hourly health check off the same shared org quota with overage deliberately disabled (
org_level_disabled), so this can recur as the agent fleet's usage grows.
Evidence
- Crash run: https://github.com/LibraVault/reader/actions/runs/32457396797 (job
review, step "Run principal review agent") — raw log has therate_limit_infoblock above, thenis_error: true,api_error_status: 429,num_turns: 48,terminal_reason: "api_error". - Already-posted (then-discarded) review: feat(android): real Google Play Billing for the play flavour #397 (review)
- Duplicate retry review reaching identical conclusions: feat(android): real Google Play Billing for the play flavour #397 (review)
- Original crash-routing comment: feat(android): real Google Play Billing for the play flavour #397 (comment)
- Health-check routine's own diagnosis (confirms this is a real, distinct, non-self-healing failure mode): feat(android): real Google Play Billing for the play flavour #397 (comment) and feat(android): real Google Play Billing for the play flavour #397 (comment)
- Retry trigger: feat(android): real Google Play Billing for the play flavour #397 (comment)
- Related but distinct prior fix: principal-review.yml: --max-turns 40 is too tight and a crash discards a valid verdict #297 (turn-budget crash discards valid work — same shape, different trigger; already fixed)
Activity
libravault-xyz commentedon Aug 22, 2026
Automated pipeline health check: This issue's own
status:ready-for-dev/status:in-progresslabels are stale — its linked PR, #430, already exists and has advanced tostatus:needs-review.Same already-flagged gap as #401/#402/#403/#386/#371/#351/#138/#428: the triage-and-implement step's success/routing paths never revisit the originating issue's status labels once a PR is opened. Not self-healing (label cleanup on an already-advanced issue isn't in this routine's authorized action set); noting this as another instance (9th so far).
Generated by Claude Code
fix(ci): recover a crashed principal-review's already-posted verdict (#…