fix: add Alibaba/DashScope rate-limit pattern to error classifier#6860
Closed
fix: add Alibaba/DashScope rate-limit pattern to error classifier#6860
Conversation
Port from anomalyco/opencode#21355: Alibaba's DashScope API returns a unique throttling message ('Request rate increased too quickly...') that doesn't match standard rate-limit patterns ('rate limit', 'too many requests'). This caused Alibaba errors to fall through to the 'unknown' category rather than being properly classified as rate_limit with appropriate backoff/rotation. Add 'rate increased too quickly' to _RATE_LIMIT_PATTERNS and test with the exact error message observed from the Alibaba provider.
Contributor
Author
|
Merged via PR #7187. Cherry-picked with authorship preserved. |
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
Port from anomalyco/opencode#21355: Alibaba's DashScope API returns a unique throttling message that doesn't match hermes-agent's existing rate-limit patterns.
The gap: Alibaba returns
"Request rate increased too quickly. To ensure system stability, please adjust your client logic to scale requests more smoothly over time."— this contains neitherrate limitnortoo many requests, so it fell through to theunknownerror category instead of being properly classified asrate_limitwith backoff/rotation.The fix: Add
"rate increased too quickly"to_RATE_LIMIT_PATTERNSinagent/error_classifier.py.Changes
agent/error_classifier.py: Add Alibaba/DashScope pattern to rate-limit detectiontests/agent/test_error_classifier.py: Add test with the exact upstream error messageTest plan
python -m pytest tests/agent/test_error_classifier.py -n0 -q→ 93 passedDiscovered via weekly OpenCode PR scout (cron job).