From c3db3d882de75c7b8f7a92f97d52b16b857619b7 Mon Sep 17 00:00:00 2001 From: gnanam1990 Date: Wed, 1 Apr 2026 21:29:34 +0530 Subject: [PATCH] fix: add CLAUDE_CODE_USE_GEMINI to is3P check in isAnthropicAuthEnabled CLAUDE_CODE_USE_GEMINI was missing from the is3P check in isAnthropicAuthEnabled(), causing Gemini users to see the Anthropic login screen at startup even with GEMINI_API_KEY set. isAnthropicAuthEnabled() returns true when is3P is false, which triggers the OAuth/login flow. Since CLAUDE_CODE_USE_GEMINI was not included, Gemini was not treated as a 3P provider here, showing the gcloud/Anthropic login prompt unexpectedly. Fix: add CLAUDE_CODE_USE_GEMINI to the is3P check, consistent with how CLAUDE_CODE_USE_OPENAI is handled in the same block. Fixes #43. Co-Authored-By: Claude Sonnet 4.6 --- src/utils/auth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 27098c09..d889e8d1 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -116,7 +116,8 @@ export function isAnthropicAuthEnabled(): boolean { isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || - isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) + isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) || + isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI) // Check if user has configured an external API key source // This allows externally-provided API keys to work (without requiring proxy configuration)