docs(oauth): describe retry jitter as spreading accounts, list Google ids

The jitter is derived from the account id and attempt, so it spreads
different accounts, not replicas of one account. The Google refresh gap
covers antigravity, agy and gemini.
This commit is contained in:
serenity
2026-11-19 00:01:23 -03:00
committed by diegosouzapw
parent d17d44fffd
commit ca5e0e680c
4 changed files with 6 additions and 6 deletions

View File

@@ -3260,10 +3260,10 @@ APP_LOG_TO_FILE=true
# Used by: src/lib/tokenHealthCheck.ts. Default: 20 (Issue #7875, regression of #7719).
# HEALTHCHECK_BATCH_SIZE=20
# Set to 1 to scale each token-refresh retry delay by 75-125 percent, derived from the account id and attempt, so replicas do not retry in lockstep. Off by default.
# Set to 1 to scale each token-refresh retry delay by 75-125 percent, derived from the account id and attempt, so different accounts spread their retries. Off by default.
# Used by: open-sse/services/tokenRefresh/circuitBreaker.ts. Default: off.
# TOKEN_REFRESH_RETRY_JITTER=
# Base gap in ms between background token refreshes of Google OAuth accounts (antigravity, gemini-cli); each refresh start also gets up to one third of the base as jitter. Unset or 0 keeps today's behaviour (no spacing); 12000 gives a 12 s gap plus up to 4 s jitter.
# Base gap in ms between background token refreshes of Google OAuth accounts (antigravity, agy, gemini); each refresh start also gets up to one third of the base as jitter. Unset or 0 keeps today's behaviour (no spacing); 12000 gives a 12 s gap plus up to 4 s jitter.
# Used by: src/lib/tokenHealthGoogleGap.ts. Default: off.
# BG_REFRESH_GOOGLE_DELAY_MS=
# Opt-in cap on proactive token refreshes in flight per provider during the healthcheck

View File

@@ -1 +1 @@
- **feat(oauth):** opt-in `BG_REFRESH_GOOGLE_DELAY_MS` spaces background token refreshes of Google OAuth accounts (antigravity, gemini-cli) by a base gap plus jitter, to avoid anti-abuse limits (off by default).
- **feat(oauth):** opt-in `BG_REFRESH_GOOGLE_DELAY_MS` spaces background token refreshes of Google OAuth accounts (antigravity, agy, gemini) by a base gap plus jitter, to avoid anti-abuse limits (off by default).

View File

@@ -1 +1 @@
- **feat(oauth):** opt-in `TOKEN_REFRESH_RETRY_JITTER=1` spreads token-refresh retry delays by 75-125% per account, so replicas stop retrying in lockstep (off by default).
- **feat(oauth):** opt-in `TOKEN_REFRESH_RETRY_JITTER=1` spreads token-refresh retry delays by 75-125% per account, so different accounts spread their retries (off by default).

View File

@@ -1421,8 +1421,8 @@ Anthropic-compatible provider instead.
| `HEALTHCHECK_JITTER_MIN_MS` | `500` | `src/lib/tokenHealthCheck.ts` | Minimum randomized jitter (ms) added on top of `HEALTHCHECK_STAGGER_MS` between provider token healthchecks, to prevent bursting (Issue #1220). |
| `HEALTHCHECK_JITTER_MAX_MS` | `5000` | `src/lib/tokenHealthCheck.ts` | Maximum randomized jitter (ms) added on top of `HEALTHCHECK_STAGGER_MS` between provider token healthchecks, to prevent bursting (Issue #1220). |
| `HEALTHCHECK_BATCH_SIZE` | `20` | `src/lib/tokenHealthCheck.ts` | Concurrent-check batch size for the startup token-healthcheck sweep; larger values check more connections in parallel, smaller values reduce burst load (Issue #7875, regression of #7719). |
| `TOKEN_REFRESH_RETRY_JITTER` | `off` | `open-sse/services/tokenRefresh/circuitBreaker.ts` | Set to 1 to scale each token-refresh retry delay by 75-125 percent, derived from the account id and attempt, so replicas do not retry in lockstep. Off by default. |
| `BG_REFRESH_GOOGLE_DELAY_MS` | `off` | `src/lib/tokenHealthGoogleGap.ts` | Base gap in ms between background token refreshes of Google OAuth accounts (antigravity, gemini-cli); each refresh start also gets up to one third of the base as jitter. Unset or 0 keeps today's behaviour (no spacing); 12000 gives a 12 s gap plus up to 4 s jitter. |
| `TOKEN_REFRESH_RETRY_JITTER` | `off` | `open-sse/services/tokenRefresh/circuitBreaker.ts` | Set to 1 to scale each token-refresh retry delay by 75-125 percent, derived from the account id and attempt, so different accounts spread their retries. Off by default. |
| `BG_REFRESH_GOOGLE_DELAY_MS` | `off` | `src/lib/tokenHealthGoogleGap.ts` | Base gap in ms between background token refreshes of Google OAuth accounts (antigravity, agy, gemini); each refresh start also gets up to one third of the base as jitter. Unset or 0 keeps today's behaviour (no spacing); 12000 gives a 12 s gap plus up to 4 s jitter. |
| `HEALTHCHECK_PER_PROVIDER_CONCURRENCY` | `0` (no cap) | `src/lib/tokenHealthCheck.ts` | Opt-in cap on proactive token refreshes in flight per provider during the healthcheck sweep. Batches still run together, but a provider with more accounts than the cap refreshes them in turn. `0`, unset or invalid values mean no cap. |
| `CLIENT_RETRY_AFTER_MAX_SECONDS` | `unset` | `src/shared/middleware/clientRetryAfterCap.ts` | Caps the Retry-After header sent to clients on error responses (4xx and 5xx), in seconds. Seconds and HTTP-date values both count. The account rest the gateway computes from the upstream header is not changed. Unset or invalid keeps today's behaviour. |
| `REQUEST_RETRY` | `2` | `src/sse/services/cooldownAwareRetry.ts` | Number of automatic retries on model-scoped cooldown responses before returning error to client. |