Skip to content

fix(auth): don't retry rate-limited identity probes for direct credentials - #325

Merged
mattzcarey merged 1 commit into
mainfrom
fix/identity-probe-no-429-retry
Oct 22, 2026
Merged

mattzcarey merged 1 commit into
mainfrom
fix/identity-probe-no-429-retry

Conversation

@mattzcarey

Copy link
Copy Markdown
Member

Identity probes for direct Cloudflare credentials no longer retry a 429. The client gets 429 temporarily_unavailable with Cloudflare's Retry-After straight away. The OAuth callback probe, which runs once while a person waits to sign in, keeps its retries.

The retries made rate limiting worse:

  • fetchProbe used fetchWithRetry's default of 3 retries, and a user-token request probes /user and /accounts, so one request could send 8 calls with a token Cloudflare had already limited
  • the client retries on our 429 anyway, so the token stayed limited
  • api_token_identity_probe … after 4 attempts with status 429 logged ~149k errors in the 13.5 h after yesterday's incident

Tests ran (npm run check). The new tests/auth/identity-probe-retries.test.ts uses the real fetchWithRetry: a rate-limited direct probe sends 1 + 1 requests (4 + 4 without this change), and the OAuth callback probe still retries a 429.

Pairs with #324, which stops probing expired MCP access tokens.

…tials

fetchProbe used fetchWithRetry's default of three retries, so a direct
credential Cloudflare had rate-limited cost up to four calls per probe, two
probes per request, which kept the token limited. Send it once and return the
429 with Cloudflare's Retry-After. The OAuth callback probe, which a person
waits on while signing in, keeps its retries.
@mattzcarey
mattzcarey force-pushed the fix/identity-probe-no-429-retry branch from b16b915 to 5f0c9b7 Compare October 22, 2026 10:56
@mattzcarey
mattzcarey merged commit 6dc41e3 into main Oct 22, 2026
5 checks passed
@mattzcarey
mattzcarey deleted the fix/identity-probe-no-429-retry branch October 22, 2026 10:58
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