diff options
| author | Tommaso Sciortino <[email protected]> | 2025-06-30 17:11:54 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-01 00:11:54 +0000 |
| commit | 3587054d32372874a4e067ae050f861ad1cec2b4 (patch) | |
| tree | 129c31f55176eec8ea8607f1090f63b77c7ab4c5 /packages/core/src | |
| parent | 0ca5c071352b1ab37da3fb44959bb1e88bdd69e3 (diff) | |
Rename AuthType LOGIN_WITH_GOOGLE_PERSONAL -> LOGIN_WITH_GOOGLE (#2769)
Diffstat (limited to 'packages/core/src')
| -rw-r--r-- | packages/core/src/code_assist/codeAssist.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/core/client.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/core/contentGenerator.test.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/core/contentGenerator.ts | 6 | ||||
| -rw-r--r-- | packages/core/src/core/geminiChat.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/utils/flashFallback.integration.test.ts | 4 | ||||
| -rw-r--r-- | packages/core/src/utils/retry.ts | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/packages/core/src/code_assist/codeAssist.ts b/packages/core/src/code_assist/codeAssist.ts index 8a3c6939..c3cb9293 100644 --- a/packages/core/src/code_assist/codeAssist.ts +++ b/packages/core/src/code_assist/codeAssist.ts @@ -13,7 +13,7 @@ export async function createCodeAssistContentGenerator( httpOptions: HttpOptions, authType: AuthType, ): Promise<ContentGenerator> { - if (authType === AuthType.LOGIN_WITH_GOOGLE_PERSONAL) { + if (authType === AuthType.LOGIN_WITH_GOOGLE) { const authClient = await getOauthClient(); const projectId = await setupUser(authClient); return new CodeAssistServer(authClient, projectId, httpOptions); diff --git a/packages/core/src/core/client.ts b/packages/core/src/core/client.ts index 3f9a69a7..9a74add6 100644 --- a/packages/core/src/core/client.ts +++ b/packages/core/src/core/client.ts @@ -491,7 +491,7 @@ export class GeminiClient { */ private async handleFlashFallback(authType?: string): Promise<string | null> { // Only handle fallback for OAuth users - if (authType !== AuthType.LOGIN_WITH_GOOGLE_PERSONAL) { + if (authType !== AuthType.LOGIN_WITH_GOOGLE) { return null; } diff --git a/packages/core/src/core/contentGenerator.test.ts b/packages/core/src/core/contentGenerator.test.ts index d020fd26..4c6134f2 100644 --- a/packages/core/src/core/contentGenerator.test.ts +++ b/packages/core/src/core/contentGenerator.test.ts @@ -20,7 +20,7 @@ describe('contentGenerator', () => { ); const generator = await createContentGenerator({ model: 'test-model', - authType: AuthType.LOGIN_WITH_GOOGLE_PERSONAL, + authType: AuthType.LOGIN_WITH_GOOGLE, }); expect(createCodeAssistContentGenerator).toHaveBeenCalled(); expect(generator).toBe(mockGenerator); diff --git a/packages/core/src/core/contentGenerator.ts b/packages/core/src/core/contentGenerator.ts index 82fe5ee9..4740c4ee 100644 --- a/packages/core/src/core/contentGenerator.ts +++ b/packages/core/src/core/contentGenerator.ts @@ -35,7 +35,7 @@ export interface ContentGenerator { } export enum AuthType { - LOGIN_WITH_GOOGLE_PERSONAL = 'oauth-personal', + LOGIN_WITH_GOOGLE = 'oauth-personal', USE_GEMINI = 'gemini-api-key', USE_VERTEX_AI = 'vertex-ai', } @@ -66,7 +66,7 @@ export async function createContentGeneratorConfig( }; // if we are using google auth nothing else to validate for now - if (authType === AuthType.LOGIN_WITH_GOOGLE_PERSONAL) { + if (authType === AuthType.LOGIN_WITH_GOOGLE) { return contentGeneratorConfig; } @@ -108,7 +108,7 @@ export async function createContentGenerator( 'User-Agent': `GeminiCLI/${version} (${process.platform}; ${process.arch})`, }, }; - if (config.authType === AuthType.LOGIN_WITH_GOOGLE_PERSONAL) { + if (config.authType === AuthType.LOGIN_WITH_GOOGLE) { return createCodeAssistContentGenerator(httpOptions, config.authType); } diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts index ed0189d3..537d55a0 100644 --- a/packages/core/src/core/geminiChat.ts +++ b/packages/core/src/core/geminiChat.ts @@ -193,7 +193,7 @@ export class GeminiChat { */ private async handleFlashFallback(authType?: string): Promise<string | null> { // Only handle fallback for OAuth users - if (authType !== AuthType.LOGIN_WITH_GOOGLE_PERSONAL) { + if (authType !== AuthType.LOGIN_WITH_GOOGLE) { return null; } diff --git a/packages/core/src/utils/flashFallback.integration.test.ts b/packages/core/src/utils/flashFallback.integration.test.ts index cffe9aa5..6554425f 100644 --- a/packages/core/src/utils/flashFallback.integration.test.ts +++ b/packages/core/src/utils/flashFallback.integration.test.ts @@ -78,14 +78,14 @@ describe('Flash Fallback Integration', () => { return status === 429; }, onPersistent429: mockFallbackHandler, - authType: AuthType.LOGIN_WITH_GOOGLE_PERSONAL, + authType: AuthType.LOGIN_WITH_GOOGLE, }); // Verify fallback was triggered expect(fallbackCalled).toBe(true); expect(fallbackModel).toBe(DEFAULT_GEMINI_FLASH_MODEL); expect(mockFallbackHandler).toHaveBeenCalledWith( - AuthType.LOGIN_WITH_GOOGLE_PERSONAL, + AuthType.LOGIN_WITH_GOOGLE, ); expect(result).toBe('success after fallback'); // Should have: 2 failures, then fallback triggered, then 1 success after retry reset diff --git a/packages/core/src/utils/retry.ts b/packages/core/src/utils/retry.ts index 372a7976..f3f5f2d2 100644 --- a/packages/core/src/utils/retry.ts +++ b/packages/core/src/utils/retry.ts @@ -97,7 +97,7 @@ export async function retryWithBackoff<T>( if ( consecutive429Count >= 2 && onPersistent429 && - authType === AuthType.LOGIN_WITH_GOOGLE_PERSONAL + authType === AuthType.LOGIN_WITH_GOOGLE ) { try { const fallbackModel = await onPersistent429(authType); |
