From cba272082d15a6b9fb4e21bc27ed1d56fa5b9a56 Mon Sep 17 00:00:00 2001 From: Sandy Tao Date: Tue, 15 Jul 2025 21:13:30 -0700 Subject: Run model availability check in the background to speed up startup (#4256) --- packages/core/src/config/config.test.ts | 6 ++---- packages/core/src/config/config.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'packages/core/src/config') diff --git a/packages/core/src/config/config.test.ts b/packages/core/src/config/config.test.ts index bb074a71..e34880a6 100644 --- a/packages/core/src/config/config.test.ts +++ b/packages/core/src/config/config.test.ts @@ -151,14 +151,12 @@ describe('Server Config (config.ts)', () => { apiKey: 'test-key', }; - (createContentGeneratorConfig as Mock).mockResolvedValue( - mockContentConfig, - ); + (createContentGeneratorConfig as Mock).mockReturnValue(mockContentConfig); await config.refreshAuth(authType); expect(createContentGeneratorConfig).toHaveBeenCalledWith( - MODEL, // Should be called with the original model 'gemini-pro' + config, authType, ); // Verify that contentGeneratorConfig is updated with the new model diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 268871ca..59f1e1ba 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -274,8 +274,8 @@ export class Config { } async refreshAuth(authMethod: AuthType) { - this.contentGeneratorConfig = await createContentGeneratorConfig( - this.model, + this.contentGeneratorConfig = createContentGeneratorConfig( + this, authMethod, ); -- cgit v1.2.3