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 <noreply@anthropic.com>
This commit is contained in:
gitdevine
2026-06-26 11:37:40 +02:00
co-authored by Claude Sonnet 4.6
parent f4f6a27f97
commit 6fce68b90c
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -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(
+1
View File
@@ -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)
)