Repository navigation
feat(core): improve retry logic for better 429/5xx error handling - #1628
Merged
Merged
Conversation
- Increase max retry attempts from 5 to 7 for better resilience - Reduce initial delay from 5000ms to 1500ms for faster recovery - Simplify getErrorStatus() to handle more status field variations (status, statusCode, response.status, error.code) - Remove model fallback mechanism (onPersistent429 callback) - Remove isQwenThrottlingError() in favor of generic retry logic - Clean up retry logging and error handling code This improves the experience for users on services with throttling like Idealab by providing more robust and faster retry behavior. Related to #973
tanzhenxin
requested review from
DennisYu07,
LaZzyMan,
Mingholy,
gwinthis and
pomelo-nwu
as code owners
January 27, 2026 12:14
Contributor
📋 Review SummaryThis PR improves retry logic for handling 429 (throttling) and 5xx errors by increasing max retry attempts from 5 to 7, reducing initial delay from 5000ms to 1500ms, and simplifying error status detection. It also removes the model fallback mechanism in favor of a robust retry-only approach, which simplifies the codebase while maintaining resilience against transient errors. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
- Delete orphaned fallback/handler.ts and its tests (no longer imported after removing onPersistent429 callback) - Add JSDoc to getErrorStatus() documenting property check priority
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
…ments feat(core): improve retry logic for better 429/5xx error handling
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.
TLDR
Dive Deeper
This PR addresses part of the Idealab provider support requirements by improving how we handle transient errors:
Retry improvements:
getErrorStatus()to handle more variations of status codes (status,statusCode,response.status,error.code)Code cleanup:
onPersistent429callback and model fallback mechanism - retry logic should handle transient errors without switching modelsisQwenThrottlingError()function in favor of generic 429 handlingThese changes improve the experience for users on services with throttling (like Idealab's 429 errors mentioned in #973) by providing more robust and responsive retry behavior.
Reviewer Test Plan
Linked issues / bugs
This PR makes progress on #973