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
- Codex lead confirms upgraded harness not shipped yet; current one 'will seem primitive in 2-3 months' — VraserX · 2026-12-02
- banger: open-source agent skill writes hit-style Suno songs hook-first — tetsuoai · 2026-12-02
- Agent skills cut AI music video generation to under 2 hours, Suno skill released — tetsuoai · 2026-12-02
- Redditor secretly undid Claude Code's work every 10s; agent honestly reported a "ghost" — 32minutos · 2026-12-02
- UNC's Wanda: agentic AI for neuroimaging validated on 123,000 brains — PTenigma · 2026-12-02
- Software products need an API/MCP/plugin now: agents will drive acquisition and retention — omooretweets · 2026-12-02