fix(core/rateLimit): add support for rate limit error code 1305 and custom retry error codes - #1995
Merged
Merged
Conversation
…1305 - Add error code 1305 to RATE_LIMIT_ERROR_CODES for DashScope/IdealTalk internal rate limit detection (issue #1918) - Add test case for 1305 error code detection - Update existing test cases to use 9999 as custom error code to avoid conflict - Remove unused sdk-java/.gitignore file Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
yiliang114
requested review from
DennisYu07,
LaZzyMan,
Mingholy,
gwinthis,
pomelo-nwu and
tanzhenxin
as code owners
February 28, 2026 03:11
Contributor
📋 Review SummaryThis PR adds support for rate limit error code 1305 and introduces a 🔍 General Feedback
🎯 Specific Feedback🔴 CriticalNo specific issues identified in this review. 🟡 HighNo specific issues identified in this review. 🟢 MediumNo specific issues identified in this review. 🔵 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. |
This was referenced Feb 28, 2026
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
fix(core/rateLimit): add support for rate limit error code 1305 and custom retry error codes
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
Add support for rate limit error code 1305 and introduce
retryErrorCodesconfig option to allow users to customize additional rate limit error codes for provider-specific scenarios.Dive Deeper
Problem Background:
Some service providers may return non-standard rate limit error codes (e.g., 1305) that were not previously recognized as rate limit errors, preventing the automatic retry mechanism from being triggered.
Key Changes:
rateLimit.ts): Added 1305 to the built-in rate limit error code setcontentGenerator.ts,geminiChat.ts): AddedretryErrorCodesconfig option allowing users to pass additional error codes as rate limit triggersconstants.ts,types.ts): AddedretryErrorCodesto model generation config fieldsrateLimit.test.ts): Added test cases for error code 1305 and custom error codesTechnical Details:
isRateLimitError()function now accepts optionalextraCodesparameter, merged with built-in error code set at runtimegeminiChat.tsnow prioritizes user-configuredmaxRetriesvalueReviewer Test Plan
retryErrorCodes: [9999]in config, simulate corresponding error to verify retry behaviorTesting Matrix
Linked issues / bugs
Fixes #1918