Gemini CLI PR fixes OAuth cache poisoning: rejected init promises now evicted

adityajai119 · ghdev · 2026-11-14

A community PR (#30296) to google-gemini/gemini-cli fixes a cache defect in getOauthClient(): when initOauthClient() failed (authorization timeout, consent cancellation, or transient network errors), the rejected promise stayed in oauthClientPromises forever, so every later call for that authType rethrew the stale error until process restart.

The fix attaches a .catch() that evicts the entry only if the cache still points to that rejected promise—guarding against a late rejection evicting a newer client after clearOauthClientCache()—then rethrows. It closes issue #29052 and includes unit test, build, lint, and bundle smoke validation steps.

Original post →

More from coding & agent

coding & agent channel →