feat(backend): implement gemini quota simulation and rate limiting

- feat: add local quota tracking for gemini tiers (Legacy/Pro/Ultra)
- feat: implement PreCheckUsage in RateLimitService
- feat: align gemini daily reset window with PST
- fix: sticky session fallback logic
This commit is contained in:
IanShaw027
2026-01-01 04:22:39 +08:00
parent 7e70093117
commit 06d483fa8d
15 changed files with 537 additions and 39 deletions

View File

@@ -156,3 +156,19 @@ gemini:
client_secret: "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"
# Optional scopes (space-separated). Leave empty to auto-select based on oauth_type.
scopes: ""
quota:
# Optional: local quota simulation for Gemini Code Assist (local billing).
# These values are used for UI progress + precheck scheduling, not official Google quotas.
tiers:
LEGACY:
pro_rpd: 50
flash_rpd: 1500
cooldown_minutes: 30
PRO:
pro_rpd: 1500
flash_rpd: 4000
cooldown_minutes: 5
ULTRA:
pro_rpd: 2000
flash_rpd: 0
cooldown_minutes: 5