Centralized "Auto" Mode Description Logic and Resolved Legacy Resolution Divergence

This commit is contained in:
davidapierce
2026-05-12 19:33:40 +00:00
parent 4ab7b46f54
commit e9c78dba92
4 changed files with 32 additions and 29 deletions

View File

@@ -23,6 +23,7 @@ import {
AuthType,
ToolConfirmationOutcome,
getChannelFromVersion,
getAutoModelDescription,
} from '@google/gemini-cli-core';
import type * as acp from '@agentclientprotocol/sdk';
import { z } from 'zod';
@@ -293,19 +294,11 @@ export function buildAvailableModels(
}
// --- LEGACY PATH ---
const proModel =
releaseChannel === 'preview'
? useGemini31
? 'gemini-3.1-pro'
: 'gemini-3-pro'
: 'gemini-2.5-pro';
const flashModel = 'gemini-3-flash';
const mainOptions = [
{
value: GEMINI_MODEL_ALIAS_AUTO,
title: getDisplayString(GEMINI_MODEL_ALIAS_AUTO),
description: `Let Gemini CLI decide the best model for the task: ${proModel}, ${flashModel}`,
description: getAutoModelDescription(releaseChannel, useGemini31),
},
];

View File

@@ -27,6 +27,7 @@ import {
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
isProModel,
getChannelFromVersion,
getAutoModelDescription,
} from '@google/gemini-cli-core';
import { useKeypress } from '../hooks/useKeypress.js';
import { theme } from '../semantic-colors.js';
@@ -165,19 +166,11 @@ export function ModelDialog({ onClose }: ModelDialogProps): React.JSX.Element {
}
// --- LEGACY PATH ---
const proModel =
releaseChannel === 'preview'
? useGemini31
? 'gemini-3.1-pro'
: 'gemini-3-pro'
: 'gemini-2.5-pro';
const flashModel = 'gemini-3-flash';
const list = [
{
value: GEMINI_MODEL_ALIAS_AUTO,
title: getDisplayString(GEMINI_MODEL_ALIAS_AUTO),
description: `Let Gemini CLI decide the best model for the task: ${proModel}, ${flashModel}`,
description: getAutoModelDescription(releaseChannel, useGemini31),
key: GEMINI_MODEL_ALIAS_AUTO,
},
{