feat(config): add 'auto' alias for default model selection (#16661)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Sehoon Shon
2026-01-14 19:07:51 -05:00
committed by GitHub
parent b3527dc9e4
commit e58fca68ce
2 changed files with 21 additions and 5 deletions
+7 -5
View File
@@ -36,6 +36,7 @@ import {
type HookDefinition,
type HookEventName,
type OutputFormat,
GEMINI_MODEL_ALIAS_AUTO,
} from '@google/gemini-cli-core';
import type { Settings } from './settings.js';
import { saveModelChange, loadSettings } from './settings.js';
@@ -617,12 +618,13 @@ export async function loadCliConfig(
const defaultModel = settings.general?.previewFeatures
? PREVIEW_GEMINI_MODEL_AUTO
: DEFAULT_GEMINI_MODEL_AUTO;
const resolvedModel: string =
argv.model ||
process.env['GEMINI_MODEL'] ||
settings.model?.name ||
defaultModel;
const specifiedModel =
argv.model || process.env['GEMINI_MODEL'] || settings.model?.name;
const resolvedModel =
specifiedModel === GEMINI_MODEL_ALIAS_AUTO
? defaultModel
: specifiedModel || defaultModel;
const sandboxConfig = await loadSandboxConfig(settings, argv);
const screenReader =
argv.screenReader !== undefined