Gemini CLI PR fixes OAuth refresh token loss causing re-auth loop
villahernandez-coder · ghdev · 2026-09-16
A community PR (google-gemini/gemini-cli #29339, priority P1, help wanted) fixes GH-21691, where Google OAuth credentials lost their refreshtoken during token refreshes and stale credentials failed to clear, trapping users in a re-authentication error loop.
Key changes:
- cacheCredentials() in oauth2.ts now reads and merges the existing oauthcreds., preserving refreshtoken, scope, tokentype, expirydate, and idtoken when absent from the refreshed payload; OAuthCredentialStorage.saveCredentials() similarly merges optional fields like scope, tokenType, and expiresAt.
- KeychainTokenStorage.deleteCredentials() is now idempotent — deleting a missing credential silently succeeds instead of throwing cascading errors.
- Unsafe any assertions from JSON.parse were replaced with unknown assignments, with unit tests and lint/typecheck steps for validation.
More from coding & agent
- Tencent unveils Hyra 2.0, a research agent that builds reusable scientific tools — TencentHunyuan · 2026-11-02
- What broke when I ran a leaderless agent swarm with no orchestrator — 7 failure modes and fixes — LostHumanity67 · 2026-11-02
- Forced yes/no prompts push GPT and Claude to 95%+ confidence on Goldbach's unproved halt test — Nir777 · 2026-11-02
- Automation took over my daily work — so why am I still sitting in the office for 8 hours? — Am1rSori · 2026-11-02
- General Reasoning explains how to train agent swarms with RL and latency pressure — rosstaylor90 · 2026-11-02
- "Coding isn't the bottleneck anymore — usage windows are," says founder Kyle Gawley — kylegawley · 2026-11-02