Gemini CLI PR Fixes Preview Model 404 Errors with Stable Fallback
alarcritty · ghdev · 2026-08-01
This PR addresses an issue in Gemini CLI where API key authentication users experienced 404 errors when accessing preview models.
- Background: The system previously assumed all API keys had preview model access. When a key lacking this access called gemini-3.1-pro-preview, it returned a 404 error. The fallback policy would then attempt another preview model, causing a second 404 and displaying an irrelevant admin prompt.
- Fix: The handleFallback logic now detects when a preview model throws a 404 on the API key path. It flags the key as lacking preview access and automatically resolves fallback candidates to stable models (gemini-2.5-pro and gemini-2.5-flash), showing an API-key-specific error message.
- Testing: New unit tests cover access downgrades, OAuth auth, non-preview models, and non-404 errors. End-to-end simulations confirm the CLI successfully recovers using stable models instead of crashing.
More from coding & agent
- Tencent Releases UI-Mate-27B, a Desktop GUI Agent Model — tencent · 2026-08-24
- Comparing AI Subscriptions: DeepSeek API vs. Claude Pro vs. Local LLMs — Unlikely_Bluejay5392 · 2026-08-24
- Claude Code introduces 'Remote Control' feature to boost coding efficiency — rohanpaul_ai · 2026-08-24
- rauchg lays out fx extension philosophy: MCP, Skills, Plugins and Unix composition — AccBalanced · 2026-08-24
- Netflix details its production LLM judge: hundreds of thousands of recommendations scored weekly — omarsar0 · 2026-08-24
- smolvm passes Simon Willison's Fable 5 agent test as a secure sandbox — yawnxyz · 2026-08-24