From 6fce68b90cca4bbe560c4e4752a4cf4d6d008c6c Mon Sep 17 00:00:00 2001 From: gitdevine <210788251+gitdevine@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:34:50 +0200 Subject: [PATCH] fix(gemini-vertex): add CLAUDE_CODE_USE_GEMINI_VERTEX to isUsing3PServices() The exported isUsing3PServices() helper was missing the Gemini Vertex flag, causing /login //logout to remain visible and auth status to report as first-party when CLAUDE_CODE_USE_GEMINI_VERTEX=1. The local is3P check inside isAnthropicAuthEnabled() was already correct; this aligns the exported helper to match. Adds a dedicated drift guard test targeting isUsing3PServices() directly, since the existing test only covered the separate local is3P block. Co-Authored-By: Claude Sonnet 4.6 --- src/__tests__/bugfixes.test.ts | 11 +++++++++++ src/utils/auth.ts | 1 + 2 files changed, 12 insertions(+) diff --git a/src/__tests__/bugfixes.test.ts b/src/__tests__/bugfixes.test.ts index 9b3cf3f54..bdb5dcf4c 100644 --- a/src/__tests__/bugfixes.test.ts +++ b/src/__tests__/bugfixes.test.ts @@ -594,6 +594,17 @@ describe('Gemini Vertex provider drift guards', () => { expect(is3PSection).toContain('CLAUDE_CODE_USE_GEMINI_VERTEX') }) + test('isUsing3PServices() includes Gemini Vertex flag', async () => { + const content = await file('utils/auth.ts').text() + const using3PSection = sectionBetween( + content, + 'export function isUsing3PServices', + 'function getConfiguredOtelHeadersHelper', + ) + + expect(using3PSection).toContain('CLAUDE_CODE_USE_GEMINI_VERTEX') + }) + test('API preconnect skips Gemini Vertex routing', async () => { const content = await file('utils/apiPreconnect.ts').text() const cloudSkipSection = sectionBetween( diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 1e975a113..aba9d401d 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1759,6 +1759,7 @@ export function isUsing3PServices(): boolean { isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) || isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI) || + isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI_VERTEX) || isEnvTruthy(process.env.CLAUDE_CODE_USE_MISTRAL) || isEnvTruthy(process.env.CLAUDE_CODE_USE_GITHUB) )