mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-15 23:31:05 +00:00
* fix(embedding): retry 429 rate-limit errors instead of dropping the batch openai.RateLimitError is not a TimeoutError/ConnectionError/OSError, so _call_with_retry's except Exception branch caught it and returned None on the first attempt with zero backoff. Add _is_rate_limited, mirroring the existing _is_insufficient_quota duck-typed check, and retry a 429 with the same exponential backoff used for network errors. * fix(embedding): insufficient_quota errors carrying status_code=429 no longer bypass quota handling _is_rate_limited() checked status_code == 429 first, so an OpenAI-compatible insufficient_quota error (which also carries status_code=429) matched the generic rate-limit branch before the code=insufficient_quota check ever ran. That meant a real quota exhaustion retried on the wrong backoff (or not at all, when quota_retry_delay is unset) instead of the dedicated quota_retry_delay wait. _is_rate_limited() now defers to _is_insufficient_quota() first. The existing quota test double now sets status_code=429 to match the real OpenAI error shape, which is what exposes the regression without the fix. Signed-off-by: Amir Fathi <amirfathi.me@gmail.com> * fix(embedding): log rate-limit retries --------- Signed-off-by: Amir Fathi <amirfathi.me@gmail.com> Co-authored-by: jinli.yl <jinli.yl@alibaba-inc.com> |
||
|---|---|---|
| .. | ||
| fixtures/config | ||
| integration | ||
| unit | ||