gemini-cli fix: any error containing '401' falsely triggered OAuth auth flow
urielefrenvirtusa · ghdev · 2026-10-20
PR #29835 on google-gemini/gemini-cli fixes a false-positive bug in isAuthenticationError:
- Root cause: the fallback used an unanchored message.includes('401') check, so any error containing "401" — e.g. ECONNREFUSED to localhost:4012, stack trace line 401, exit code 4010 — was misclassified as an auth error, triggering OAuth and masking the real connection failure.
- Fix: added structured checks for status/statusCode of 401 in addition to code; replaced the substring check with HTTP401REGEX matching genuine auth contexts (HTTP 401, Status code: 401, 401 Unauthorized, etc.); added comprehensive positive/negative tests.
- Fixes issue #28203; labeled priority/p2.
More from coding & agent
- Index Network open-sources Social Discovery Protocol: agents negotiate fit on your behalf — carsonfarmer · 2026-10-23
- Installed a formal-verification skill: it silently installed Java, MacBook runs 10 degrees hotter — zealcaiden · 2026-10-23
- OpenAI's Decisions API hits GA: near real-time routing up to 10x faster than GPT-6 Luna — OpenAIDevs · 2026-10-23
- Ruff author warns: upgrade Node/Bun now — --use-system-ca still accepts the eMudhra cert — charliermarsh · 2026-10-23
- Proof of Agent: paste one prompt and your AI mines, grades, and self-governs — adamamcbride · 2026-10-23
- DeepLearning.AI weekly: GPT-6.1 hits 97.9% byte parity on COBOL migration — DeepLearningAI · 2026-10-23