feat: update thinking mode support to exclude gemini-2.0 models and simplify logic. (#13454)

This commit is contained in:
kevin-ramdass
2025-11-19 15:35:35 -08:00
committed by GitHub
parent 0f845407f1
commit e4c4bb265e
2 changed files with 9 additions and 9 deletions
+8 -3
View File
@@ -137,6 +137,7 @@ async function fromAsync<T>(promise: AsyncGenerator<T>): Promise<readonly T[]> {
describe('isThinkingSupported', () => { describe('isThinkingSupported', () => {
it('should return true for gemini-2.5', () => { it('should return true for gemini-2.5', () => {
expect(isThinkingSupported('gemini-2.5')).toBe(true); expect(isThinkingSupported('gemini-2.5')).toBe(true);
expect(isThinkingSupported('gemini-2.5-flash')).toBe(true);
}); });
it('should return true for gemini-2.5-pro', () => { it('should return true for gemini-2.5-pro', () => {
@@ -147,9 +148,13 @@ describe('isThinkingSupported', () => {
expect(isThinkingSupported('gemini-3-pro')).toBe(true); expect(isThinkingSupported('gemini-3-pro')).toBe(true);
}); });
it('should return false for other models', () => { it('should return false for gemini-2.0 models', () => {
expect(isThinkingSupported('gemini-1.5-flash')).toBe(false); expect(isThinkingSupported('gemini-2.0-flash')).toBe(false);
expect(isThinkingSupported('some-other-model')).toBe(false); expect(isThinkingSupported('gemini-2.0-pro')).toBe(false);
});
it('should return true for other models', () => {
expect(isThinkingSupported('some-other-model')).toBe(true);
}); });
}); });
+1 -6
View File
@@ -33,7 +33,6 @@ import type {
import type { ContentGenerator } from './contentGenerator.js'; import type { ContentGenerator } from './contentGenerator.js';
import { import {
DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_MODEL,
DEFAULT_GEMINI_MODEL_AUTO,
DEFAULT_THINKING_MODE, DEFAULT_THINKING_MODE,
getEffectiveModel, getEffectiveModel,
} from '../config/models.js'; } from '../config/models.js';
@@ -56,11 +55,7 @@ import { debugLogger } from '../utils/debugLogger.js';
import type { ModelConfigKey } from '../services/modelConfigService.js'; import type { ModelConfigKey } from '../services/modelConfigService.js';
export function isThinkingSupported(model: string) { export function isThinkingSupported(model: string) {
return ( return !model.startsWith('gemini-2.0');
model.startsWith('gemini-2.5') ||
model.startsWith('gemini-3') ||
model === DEFAULT_GEMINI_MODEL_AUTO
);
} }
const MAX_TURNS = 100; const MAX_TURNS = 100;