Skip to content

fix(#159): retry fullsend post-review on transient API failures#161

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/159-retry-post-review
Open

fix(#159): retry fullsend post-review on transient API failures#161
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/159-retry-post-review

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Wrap the fullsend post-review call in a retry loop (max 3 attempts with 5s/15s backoff) to handle transient GitHub API errors such as 422 Unprocessable Entity during PR transitional states.

Previously, a single non-zero exit (other than code 10 for stale-head) caused post-review.sh to exit immediately. This meant a valid review comment could be posted while the formal review API call failed, leaving the PR without an outcome label and requiring human diagnosis.

Changes:

  • scripts/post-review.sh: add retry loop around fullsend post-review.
    Exit code 10 (stale-head) bypasses retry and uses existing handler.
    On exhausted retries, a degraded-mode fallback applies the outcome
    label directly so the PR is not left in limbo. The script still
    exits 1 to signal the formal review was not posted.
  • scripts/post-review-test.sh: add 7 integration tests covering
    retry-then-succeed, retries-exhausted with fallback for approve/
    comment/request-changes actions, stale-head bypass, and retry
    log message format.

POST_REVIEW_RETRY_DELAY env var overrides backoff for all retries (set to 0 in tests to skip sleep).


Closes #159

Post-script verification

  • Branch is not main/master (agent/159-retry-post-review)
  • Secret scan passed (gitleaks — 51561b23f669baf5e6ad027c5de39b0fdb199ab9..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Wrap the fullsend post-review call in a retry loop (max 3 attempts
with 5s/15s backoff) to handle transient GitHub API errors such as
422 Unprocessable Entity during PR transitional states.

Previously, a single non-zero exit (other than code 10 for stale-head)
caused post-review.sh to exit immediately. This meant a valid review
comment could be posted while the formal review API call failed,
leaving the PR without an outcome label and requiring human diagnosis.

Changes:
- scripts/post-review.sh: add retry loop around fullsend post-review.
  Exit code 10 (stale-head) bypasses retry and uses existing handler.
  On exhausted retries, a degraded-mode fallback applies the outcome
  label directly so the PR is not left in limbo. The script still
  exits 1 to signal the formal review was not posted.
- scripts/post-review-test.sh: add 7 integration tests covering
  retry-then-succeed, retries-exhausted with fallback for approve/
  comment/request-changes actions, stale-head bypass, and retry
  log message format.

POST_REVIEW_RETRY_DELAY env var overrides backoff for all retries
(set to 0 in tests to skip sleep).

Closes #159
@fullsend-ai-coder fullsend-ai-coder Bot requested a review from a team as a code owner July 13, 2026 20:04
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.

Post-review.sh should retry on transient GitHub API errors when submitting formal PR reviews

0 participants