Add new fallback state as prefactor for routing (#5065)

This commit is contained in:
Abhi
2025-07-28 15:55:50 -04:00
committed by GitHub
parent b6c2c64f9b
commit b08679c906
7 changed files with 30 additions and 67 deletions

View File

@@ -152,6 +152,10 @@ describe('Server Config (config.ts)', () => {
(createContentGeneratorConfig as Mock).mockReturnValue(mockContentConfig);
// Set fallback mode to true to ensure it gets reset
config.setFallbackMode(true);
expect(config.isInFallbackMode()).toBe(true);
await config.refreshAuth(authType);
expect(createContentGeneratorConfig).toHaveBeenCalledWith(
@@ -163,6 +167,8 @@ describe('Server Config (config.ts)', () => {
expect(config.getContentGeneratorConfig().model).toBe(newModel);
expect(config.getModel()).toBe(newModel); // getModel() should return the updated model
expect(GeminiClient).toHaveBeenCalledWith(config);
// Verify that fallback mode is reset
expect(config.isInFallbackMode()).toBe(false);
});
});