Skip to content

Retry transient failures in the code review bot - #79

Merged
saarthak2002 merged 2 commits into
mainfrom
saarthak2002/code-review-bot-retries
Oct 7, 2026
Merged

saarthak2002 merged 2 commits into
mainfrom
saarthak2002/code-review-bot-retries

Conversation

@saarthak2002

@saarthak2002 saarthak2002 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

The Neuralink code review bot is running into API timeouts. These changes add robust retry logic and change to an HTTPS streaming request response model to mitigate this issue.

Saarthak Gupta added 2 commits October 5, 2026 20:29
The review step failed on a dropped model connection
(RemoteDisconnected) with an unlabeled error and no retry.

- Wrap transport errors with the failing operation and root cause,
  never including the model API URL.
- Retry transport errors and 429/5xx with exponential backoff and
  Retry-After for GitHub reads, GraphQL and the model call.
- Bound the model phase to a 12 minute budget (8 minutes per attempt)
  so retries fit in the 17 minute job timeout.
- On an ambiguous review POST failure, re-check existing reviews before
  posting again so a review is never duplicated.
Non-streamed model calls that run past ~4.5 minutes are cut with
RemoteDisconnected, and retrying the same request hits the same limit.
Request a streamed response so data keeps arriving, and assemble the
content from the server-sent events.

- An interrupted or incomplete stream is a retryable transport error.
- The per-read socket timeout is now an idle timeout (3 minutes); the
  12 minute model budget is also enforced while reading.
- A plain JSON reply is still accepted if the server ignores stream.
@saarthak2002
saarthak2002 merged commit 86b18c1 into main Oct 7, 2026
6 checks passed
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.

2 participants