mirror of
https://github.com/NikkeTryHard/zerogravity.git
synced 2026-04-25 15:15:59 +03:00
[GH-ISSUE #19] Respect "retry-after-ms" or "retryDelay" when 429 or 503 response given #17
Labels
No labels
bug
enhancement
enhancement
notice
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/zerogravity#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hwang-pixel on GitHub (Feb 19, 2026).
Original GitHub issue: https://github.com/NikkeTryHard/zerogravity/issues/19
What do you want?
We should retry another request with given time from server response (respect it) so it doesnt just incremental backoff.
Use Case
Everytime google response 503 or 429, it will have time to respect given by them.
Example
In example above, it shows only 2s to wait before trying another request. But sometimes you have 42s, 58s, etc etc. So incremental backoff sometime wont respect time given by google response
Please also note that, time given by google can be 5h20m123123.31231s. So you have to craft a logic to ignore if X < time retry given by google response, by X is configurable number by user env (not magic number or hardcode).
Here example regex to catch time from google format
Alternatives Considered
No response
@NikkeTryHard commented on GitHub (Feb 19, 2026):
good point. i added time back off since it consumed all of my quota.
@NikkeTryHard commented on GitHub (Feb 19, 2026):
are you on v1.1.4? just to be sure
@hwang-pixel commented on GitHub (Feb 19, 2026):
yup im on 1.1.4
@hwang-pixel commented on GitHub (Feb 19, 2026):
i will just drop my rate-limit-parser.js so you can implement this on rust easily. you just need to convert it
@hwang-pixel commented on GitHub (Feb 19, 2026):
feel free to use & implement. no copyright, i vibe it using opus 4.6. notice
[cloudcode], it is log info from other project proxy if you know lol. but that rate-limit-parse.js is 100% my own customization , you can search to make sure i am not giving you others code (its 100% mine)@NikkeTryHard commented on GitHub (Feb 19, 2026):
Cant thank you enough. im vibe coding too rn lol. reviewing as much as i can
@NikkeTryHard commented on GitHub (Feb 19, 2026):
v1.1.5-beta.2 — Server-Specified Retry Delays
This is now implemented. The proxy will:
retryDelayfromgoogle.rpc.RetryInfo(e.g."2.463586755s")quotaResetDelayfromgoogle.rpc.ErrorInfometadata (e.g."2h57m16.9s")quotaResetTimeStampfrom metadata (ISO 8601 → delta from now)Configuration
How it works
Credit to @hwang-pixel for the
quotaResetTimeStampparsing idea and sanity floor — adapted from your JS parser 🤝Commit: a23cd72
@hwang-pixel commented on GitHub (Feb 19, 2026):
wow so fast, thank you so much to make this happen.
@NikkeTryHard commented on GitHub (Feb 19, 2026):
v1.1.5-beta.2 is out with this fix. Please test and report back!
Binary:
Docker:
New env var
ZEROGRAVITY_MAX_RETRY_DELAY(default 120s) — delays beyond this cap will return the error immediately instead of waiting.@hwang-pixel commented on GitHub (Feb 19, 2026):
hey, did you just commit the entire source?
@hwang-pixel commented on GitHub (Feb 19, 2026):
because i try to look it up with incognito, and it shows src
@hwang-pixel commented on GitHub (Feb 19, 2026):
brother be careful @NikkeTryHard
@NikkeTryHard commented on GitHub (Feb 19, 2026):
bro yeah it was so dangerous
@NikkeTryHard commented on GitHub (Feb 19, 2026):
added github actions for PR and Pushes so it will hopefulyl never happen again