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
- Why SwiftUI feels janky: it ditches Core Animation, the backbone of iOS smoothness — dotey · 2026-09-16
- GMI launches MCP server exposing 150+ multimodal models to Claude, ChatGPT and Cursor — _jaydeepkarale · 2026-09-16
- Lovable rewrites Vite dev server in Rust: 2x faster cold starts, 4x less memory; Evan You responds — cnakazawa · 2026-09-16
- Codex CLI Users Angry: Two Unwanted Features Added in Quick Succession, One Wastes Tokens — ssh4net · 2026-09-16
- Google's Gary Illyes: keep important content in HTML as LLMs crawl the web — lilyraynyc · 2026-09-16
- PenEcho: open-source canvas turns AI chats into shared visual workspaces via MCP — abhishek__AI · 2026-09-16