feat(core): Preliminary changes for subagent model routing. (#16035)

This commit is contained in:
joshualitt
2026-01-07 13:21:10 -08:00
committed by GitHub
parent 17b3eb730a
commit a1dd19738e
12 changed files with 200 additions and 15 deletions
+22
View File
@@ -9,6 +9,7 @@ import {
resolveModel,
resolveClassifierModel,
isGemini2Model,
isAutoModel,
getDisplayString,
DEFAULT_GEMINI_MODEL,
PREVIEW_GEMINI_MODEL,
@@ -18,6 +19,7 @@ import {
GEMINI_MODEL_ALIAS_PRO,
GEMINI_MODEL_ALIAS_FLASH,
GEMINI_MODEL_ALIAS_FLASH_LITE,
GEMINI_MODEL_ALIAS_AUTO,
PREVIEW_GEMINI_FLASH_MODEL,
PREVIEW_GEMINI_MODEL_AUTO,
DEFAULT_GEMINI_MODEL_AUTO,
@@ -171,6 +173,26 @@ describe('isGemini2Model', () => {
});
});
describe('isAutoModel', () => {
it('should return true for "auto"', () => {
expect(isAutoModel(GEMINI_MODEL_ALIAS_AUTO)).toBe(true);
});
it('should return true for "auto-gemini-3"', () => {
expect(isAutoModel(PREVIEW_GEMINI_MODEL_AUTO)).toBe(true);
});
it('should return true for "auto-gemini-2.5"', () => {
expect(isAutoModel(DEFAULT_GEMINI_MODEL_AUTO)).toBe(true);
});
it('should return false for concrete models', () => {
expect(isAutoModel(DEFAULT_GEMINI_MODEL)).toBe(false);
expect(isAutoModel(PREVIEW_GEMINI_MODEL)).toBe(false);
expect(isAutoModel('some-random-model')).toBe(false);
});
});
describe('resolveClassifierModel', () => {
it('should return flash model when alias is flash', () => {
expect(
+14
View File
@@ -146,6 +146,20 @@ export function isGemini2Model(model: string): boolean {
return /^gemini-2(\.|$)/.test(model);
}
/**
* Checks if the model is an auto model.
*
* @param model The model name to check.
* @returns True if the model is an auto model.
*/
export function isAutoModel(model: string): boolean {
return (
model === GEMINI_MODEL_ALIAS_AUTO ||
model === PREVIEW_GEMINI_MODEL_AUTO ||
model === DEFAULT_GEMINI_MODEL_AUTO
);
}
/**
* Checks if the model supports multimodal function responses (multimodal data nested within function response).
* This is supported in Gemini 3.