Respect previewFeatures value from the remote flag if undefined (#15214)

This commit is contained in:
Sehoon Shon
2025-12-17 16:36:50 -05:00
committed by GitHub
parent 0a655c7f8b
commit 871bf1795c
2 changed files with 26 additions and 9 deletions
+10
View File
@@ -38,6 +38,7 @@ import {
DEFAULT_GEMINI_MODEL,
DEFAULT_GEMINI_MODEL_AUTO,
PREVIEW_GEMINI_MODEL,
PREVIEW_GEMINI_MODEL_AUTO,
} from './models.js';
vi.mock('fs', async (importOriginal) => {
@@ -1862,6 +1863,15 @@ describe('Config Quota & Preview Model Access', () => {
expect(config.getModel()).toBe(nonPreviewModel);
});
it('should switch to preview auto model if enabling preview features while using default auto model', () => {
config.setPreviewFeatures(false);
config.setModel(DEFAULT_GEMINI_MODEL_AUTO);
config.setPreviewFeatures(true);
expect(config.getModel()).toBe(PREVIEW_GEMINI_MODEL_AUTO);
});
it('should NOT reset model if enabling preview features', () => {
config.setPreviewFeatures(false);
config.setModel(PREVIEW_GEMINI_MODEL); // Just pretending it was set somehow