Fix exponential backoff for provider: {anthropic,openai}#12421
Open
leegarrett wants to merge 1 commit into
Open
Fix exponential backoff for provider: {anthropic,openai}#12421leegarrett wants to merge 1 commit into
leegarrett wants to merge 1 commit into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA. |
Author
|
recheck |
Exponential backoff was broken for anthropic. The reason is that ParseError() returned a plain Error with no .response property. withExponentialBackoff() only triggers the backoff logic when when error.response?.status == 429. Without that property, it immediately rethrows the error. With this fix, it correctly backs off on an HTTP 429 error. `provider: openai` bypasses BaseLLM.fetch() and uses the openai SDK. Fix the tests so that they pass again. Some APIs have a per minute rate-limt, so increase the max retries in both codepaths to 8 so that it it retries up to 127.5s until it fails.
Author
|
recheck |
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.
Exponential backoff was broken for anthropic. The reason is that ParseError() returned a plain Error with no .response property. withExponentialBackoff() only triggers the backoff logic when when error.response?.status == 429. Without that property, it immediately rethrows the error. With this fix, it correctly backs off on an HTTP 429 error.
provider: openaibypasses BaseLLM.fetch() and uses the openai SDK.Fix the tests so that they pass again.
Some APIs have a per minute rate-limt, so increase the max retries in both codepaths to 8 so that it it retries up to 127.5s until it fails.
I have built the extension and verified both codepaths now work with the rate-limited API in question.
Description
[ What changed? Feel free to be brief. ]
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]