Skip to content

fix: add Alibaba/DashScope rate-limit pattern to error classifier#6860

Closed
teknium1 wants to merge 1 commit intomainfrom
opencode-port/alibaba-rate-limit-retry
Closed

fix: add Alibaba/DashScope rate-limit pattern to error classifier#6860
teknium1 wants to merge 1 commit intomainfrom
opencode-port/alibaba-rate-limit-retry

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

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 neither rate limit nor too many requests, so it fell through to the unknown error category instead of being properly classified as rate_limit with backoff/rotation.

The fix: Add "rate increased too quickly" to _RATE_LIMIT_PATTERNS in agent/error_classifier.py.

Changes

  • agent/error_classifier.py: Add Alibaba/DashScope pattern to rate-limit detection
  • tests/agent/test_error_classifier.py: Add test with the exact upstream error message

Test plan

  • python -m pytest tests/agent/test_error_classifier.py -n0 -q → 93 passed

Discovered via weekly OpenCode PR scout (cron job).

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.
@teknium1
Copy link
Copy Markdown
Contributor Author

Merged via PR #7187. Cherry-picked with authorship preserved.

@teknium1 teknium1 closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant