feat(api): retry configuration for api block#3329
Merged
waleedlatif1 merged 7 commits intostagingfrom Feb 25, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
The API block docs described automatic retries, but the block didn't expose any retry controls and requests were executed only once. This adds tool-level retry support with exponential backoff (including Retry-After support) for timeouts, 429s, and 5xx responses, exposes retry settings in the API block and http_request tool, and updates the docs to match. Fixes #3225
3e93b76 to
218a492
Compare
Contributor
Greptile SummaryThis PR adds configurable retry logic to the API block, allowing users to specify retry attempts, delays, and exponential backoff for handling transient failures like timeouts, rate limits (429), and server errors (5xx). Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[API Request] --> B{Retry Config Enabled?}
B -->|No| C[Execute Request Once]
B -->|Yes| D{Method Idempotent?}
D -->|Yes| E[Execute Request]
D -->|No| F{retryNonIdempotent?}
F -->|No| C
F -->|Yes| E
E --> G{Request Successful?}
G -->|Yes| H[Return Response]
G -->|No| I{Retryable Error?}
I -->|No| J[Return Error]
I -->|Yes| K{Attempts Remaining?}
K -->|No| J
K -->|Yes| L{429 with Retry-After?}
L -->|Yes| M{Retry-After > maxDelay?}
M -->|Yes| J
M -->|No| N[Wait Retry-After]
L -->|No| O[Calculate Backoff]
N --> E
O --> P[Wait with Jitter]
P --> E
C --> Q{Success?}
Q -->|Yes| H
Q -->|No| J
Last reviewed commit: 3b1fd86 |
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
add configurable request retries to api block
Fixes #3225
Type of Change
Testing
Tested manually
Checklist