[GH-ISSUE #33] Rate limiter not reset when switching accounts via POST /v1/token #30

Closed
opened 2026-02-27 15:38:00 +03:00 by kerem · 1 comment
Owner

Originally created by @yulin0629 on GitHub (Feb 20, 2026).
Original GitHub issue: https://github.com/NikkeTryHard/zerogravity/issues/33

Rate limiter not reset when token is updated via POST /v1/token

Description

When switching Google accounts, injecting a new OAuth token via POST /v1/token does not reset the per-model rate limiter state. The proxy continues to reject requests based on the previous account's 429 status, even though the new account has full quota.

Steps to Reproduce

  1. Use Account A until a model hits RESOURCE_EXHAUSTED (429)
  2. Switch to Account B in Antigravity app
  3. Inject new token: curl -X POST http://localhost:8741/v1/token -d '{"token":"ya29.new_token"}'
  4. Send a request to the same model

Expected

Request succeeds (new account has quota).

Actual

Rate limiter rejected request: Model gemini-3-flash is rate-limited
(2x consecutive RESOURCE_EXHAUSTED). Retry in 10068s.

The rate limiter still holds the old account's 429 delay.

Workaround

docker compose down && docker compose up -d (full container recreate clears in-memory state). docker compose restart is not sufficient.

Suggested Fix

Reset all per-model rate limiter state when POST /v1/token receives a new token.

Version

v1.1.9 (ghcr.io/nikketryhard/zerogravity:v1.1.9), macOS Docker arm64.

Originally created by @yulin0629 on GitHub (Feb 20, 2026). Original GitHub issue: https://github.com/NikkeTryHard/zerogravity/issues/33 ## Rate limiter not reset when token is updated via POST /v1/token ### Description When switching Google accounts, injecting a new OAuth token via `POST /v1/token` does not reset the per-model rate limiter state. The proxy continues to reject requests based on the **previous** account's 429 status, even though the new account has full quota. ### Steps to Reproduce 1. Use Account A until a model hits `RESOURCE_EXHAUSTED` (429) 2. Switch to Account B in Antigravity app 3. Inject new token: `curl -X POST http://localhost:8741/v1/token -d '{"token":"ya29.new_token"}'` 4. Send a request to the same model ### Expected Request succeeds (new account has quota). ### Actual ``` Rate limiter rejected request: Model gemini-3-flash is rate-limited (2x consecutive RESOURCE_EXHAUSTED). Retry in 10068s. ``` The rate limiter still holds the old account's 429 delay. ### Workaround `docker compose down && docker compose up -d` (full container recreate clears in-memory state). `docker compose restart` is **not** sufficient. ### Suggested Fix Reset all per-model rate limiter state when `POST /v1/token` receives a new token. ### Version v1.1.9 (`ghcr.io/nikketryhard/zerogravity:v1.1.9`), macOS Docker arm64.
kerem closed this issue 2026-02-27 15:38:00 +03:00
Author
Owner

@NikkeTryHard commented on GitHub (Feb 20, 2026):

should be fixed for v1.2.0 please wait for stable release and test when it releases

<!-- gh-comment-id:3932282997 --> @NikkeTryHard commented on GitHub (Feb 20, 2026): should be fixed for v1.2.0 please wait for stable release and test when it releases
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zerogravity#30
No description provided.