Skip to content

feat(gemini): park 429-exhausted API keys + orange on-hold badge - #4348

Open
scottchristian wants to merge 5 commits into
decolua:masterfrom
scottchristian:feat/gemini-429-key-cooldown
Open

scottchristian wants to merge 5 commits into
decolua:masterfrom
scottchristian:feat/gemini-429-key-cooldown

Conversation

@scottchristian

Copy link
Copy Markdown

Free-tier Gemini keys that hit 429s were retried with blind exponential backoff, burning through every key in seconds. This change:

  • Parses RetryInfo.retryDelay / Please retry in Xs from Gemini 429s into an exact per-key cooldown (modelLock___all, so rotation skips the key entirely — chat, native v1beta, TTS/STT paths included)
  • Escalates daily-quota exhaustion (PerDay violations in QuotaFailure) and hintless 429s to a random 1-3h park, since the seconds-scale hint never clears those
  • Dashboard: parked keys show an orange on hold · 22s badge with live countdown (was misleading green active), plus N On hold on overview/media-provider cards, and hold state (return time, parked models, last error) in the edit modal
  • Keys re-enable automatically on next success

Verified live against 8 real free-tier keys: one request parked 7 exhausted keys (64-172 min each) and served via the healthy one. 37 new/related unit tests pass (gemini-429-cooldown, connection-status-badge); the 2 failing suites (gemini-native-endpoint, auth-status) fail identically on unmodified main due to missing undici in tests/node_modules — pre-existing, unrelated.

…literals

Review follow-ups:
- EditConnectionModal: read the lock clock from state instead of Date.now()
  during render (react-hooks/purity); the modal now re-reads each second so a
  hold that lapses while open is reflected.
- OnHoldBadge: single updater in the effect body instead of a bare setState
  branch (react-hooks/set-state-in-effect).
- CHANGELOG: add an "# Unreleased" section, matching how other contributors
  land entries between releases (v0.5.86 is already tagged).
- i18n: add "on hold", "all models", and the cooldown-expired notice to all 33
  literal files.

Verified: full `eslint .` output is now byte-identical to master (341 problems,
139 errors), and the test suite shows 0 new failures vs master (+29 passing).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant