Skip to content

fix: add CLAUDE_CODE_USE_GEMINI to is3P check to prevent login screen - #56

Merged
kevincodex1 merged 1 commit into
Twigpine:mainfrom
gnanam1990:fix/gemini-auth-login-screen
Apr 1, 2026
Merged

kevincodex1 merged 1 commit into
Twigpine:mainfrom
gnanam1990:fix/gemini-auth-login-screen

Conversation

@gnanam1990

Copy link
Copy Markdown
Collaborator

Problem

Gemini users see the Anthropic/gcloud login screen at startup even when CLAUDE_CODE_USE_GEMINI=1 and GEMINI_API_KEY are correctly set. Reported in #43.

Root Cause

isAnthropicAuthEnabled() in src/utils/auth.ts uses an is3P check to decide whether to skip Anthropic auth. CLAUDE_CODE_USE_OPENAI was included but CLAUDE_CODE_USE_GEMINI was missing:

const is3P =
  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)
  // CLAUDE_CODE_USE_GEMINI missing ← bug

With is3P = false, shouldDisableAuth = false, so isAnthropicAuthEnabled() returns true → login screen appears.

Fix

One line — add CLAUDE_CODE_USE_GEMINI to the is3P check, consistent with CLAUDE_CODE_USE_OPENAI.

Test

CLAUDE_CODE_USE_GEMINI=1 GEMINI_API_KEY=your-key openclaude
# Before: Anthropic/gcloud login screen appears
# After: starts directly, no login prompt

Closes #43.

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 Gitlawb#43.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gnanam1990 gnanam1990 mentioned this pull request Apr 1, 2026
@kevincodex1
kevincodex1 merged commit b8ea6f8 into Twigpine:main Apr 1, 2026
euxaristia pushed a commit to euxaristia/openclaude that referenced this pull request Apr 13, 2026
…screen

fix: add CLAUDE_CODE_USE_GEMINI to is3P check to prevent login screen
reymaster pushed a commit to reymaster/openclaude that referenced this pull request May 5, 2026
…screen

fix: add CLAUDE_CODE_USE_GEMINI to is3P check to prevent login screen
thedeveloloper pushed a commit to thedeveloloper/openclaude that referenced this pull request Jun 8, 2026
…screen

fix: add CLAUDE_CODE_USE_GEMINI to is3P check to prevent login screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insufficient credits.

2 participants