fix(gateway): 429 同 key 只再试一次,换 key 前拉长退避 - #818
Merged
johnnyzhang-eng merged 2 commits intoAug 27, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #818 +/- ##
==========================================
- Coverage 87.09% 86.51% -0.59%
==========================================
Files 288 293 +5
Lines 21559 21918 +359
Branches 3299 3329 +30
==========================================
+ Hits 18777 18962 +185
- Misses 1852 2026 +174
Partials 930 930
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 26 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
审阅了共享退避策略以及 chat、image、video 三条 Gateway 的 429 重试、换 key 和非 429 重试路径。改动符合 #817 的契约:同一 key 仍执行三次调用,等待为 2s/4s,Retry-After 作为下限并保留 30s 封顶;UNREACHED 等其他策略未被改动。
未发现达到报告阈值的 correctness、可靠性或兼容性问题。验证方面,compileall 与 git diff --check 通过;PR 描述中的 pytest 命令未能执行,因为当前环境没有 uv 或 pytest。
Contributor
|
LGTM |
johnnyzhang-eng
approved these changes
Aug 27, 2026
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
Retry-After作下限)再切下一把 key;新 key 同样只再试一次。Closes #817
Test plan
uv run pytest tests/test_gateway_policy.py tests/test_gateway_image.py tests/test_gateway_video.py tests/test_gateway_chat.py -q