What happened
On PR #148, the merge queue ejected the PR because the 001-clean-approve review eval case failed. The review agent performed correctly — it approved, posted a thorough comment (scored 5/5 on review_quality), and stayed within cost/turn limits. But post-review.sh received a 422 Unprocessable Entity from the GitHub API when submitting the formal PR review to the ephemeral fixture repo (halfsend/eval-001-clean-approve-1400fa2d). This caused post-review.sh to exit 1, which meant the ready-for-merge label was never applied. The required_labels judge then failed because ready-for-merge was absent. The human had to diagnose the root cause from CI logs, post a detailed analysis, and re-queue the PR, adding ~45 minutes to merge time.
What could go better
The human noted this is not just an eval concern: 'If post-review.sh fails hard on a 422, the same thing will happen in production: a valid review gets posted as a comment but the label never lands, so the PR sits unmerged. That needs separate follow-up (error handling / retry in post-review.sh).' The 422 can occur when the PR is in a transitional state (e.g., just created, merging, or when the head SHA changes during the review submission window). No existing issue covers this failure mode. Confidence is high — the human's analysis is credible and the fix is straightforward.
Proposed change
Add retry logic with backoff to the formal PR review submission step in scripts/post-review.sh. Specifically: (1) wrap the gh api or gh pr review call that submits the formal review in a retry loop (max 3 attempts with 5-second/15-second backoff), (2) on 422, log the response body for debugging and retry, (3) if all retries are exhausted but the review comment was already posted successfully, attempt to apply the ready-for-merge label directly as a degraded-mode fallback, (4) include the HTTP status code and response body in the error message for diagnosability. This improves both eval reliability (no false eval failures from transient API errors) and production reliability (reviews don't silently fail to trigger merge labels).
Validation criteria
When post-review.sh encounters a 422 on formal PR review submission: (1) it retries up to 3 times with backoff, (2) retry attempts are logged with the response body, (3) if retries succeed, the label is applied normally, (4) if retries are exhausted but the comment was posted, it attempts to apply the label directly. Unit test: add a test case to scripts/post-review-test.sh that mocks a 422 response and verifies the retry behavior.
Generated by retro agent from #148
What happened
On PR #148, the merge queue ejected the PR because the
001-clean-approvereview eval case failed. The review agent performed correctly — it approved, posted a thorough comment (scored 5/5 onreview_quality), and stayed within cost/turn limits. Butpost-review.shreceived a 422 Unprocessable Entity from the GitHub API when submitting the formal PR review to the ephemeral fixture repo (halfsend/eval-001-clean-approve-1400fa2d). This causedpost-review.shto exit 1, which meant theready-for-mergelabel was never applied. Therequired_labelsjudge then failed becauseready-for-mergewas absent. The human had to diagnose the root cause from CI logs, post a detailed analysis, and re-queue the PR, adding ~45 minutes to merge time.What could go better
The human noted this is not just an eval concern: 'If post-review.sh fails hard on a 422, the same thing will happen in production: a valid review gets posted as a comment but the label never lands, so the PR sits unmerged. That needs separate follow-up (error handling / retry in post-review.sh).' The 422 can occur when the PR is in a transitional state (e.g., just created, merging, or when the head SHA changes during the review submission window). No existing issue covers this failure mode. Confidence is high — the human's analysis is credible and the fix is straightforward.
Proposed change
Add retry logic with backoff to the formal PR review submission step in
scripts/post-review.sh. Specifically: (1) wrap thegh apiorgh pr reviewcall that submits the formal review in a retry loop (max 3 attempts with 5-second/15-second backoff), (2) on 422, log the response body for debugging and retry, (3) if all retries are exhausted but the review comment was already posted successfully, attempt to apply theready-for-mergelabel directly as a degraded-mode fallback, (4) include the HTTP status code and response body in the error message for diagnosability. This improves both eval reliability (no false eval failures from transient API errors) and production reliability (reviews don't silently fail to trigger merge labels).Validation criteria
When
post-review.shencounters a 422 on formal PR review submission: (1) it retries up to 3 times with backoff, (2) retry attempts are logged with the response body, (3) if retries succeed, the label is applied normally, (4) if retries are exhausted but the comment was posted, it attempts to apply the label directly. Unit test: add a test case toscripts/post-review-test.shthat mocks a 422 response and verifies the retry behavior.Generated by retro agent from #148