mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-22 07:41:23 -07:00
fix(core): handle non-string model flags in resolution (#26069)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -841,9 +841,16 @@ export async function loadCliConfig(
|
||||
);
|
||||
|
||||
const defaultModel = PREVIEW_GEMINI_MODEL_AUTO;
|
||||
const specifiedModel =
|
||||
const rawModel =
|
||||
argv.model || process.env['GEMINI_MODEL'] || settings.model?.name;
|
||||
|
||||
// Ensure specifiedModel is a string (e.g. if yargs parsed multiple --model as an array)
|
||||
const specifiedModel = Array.isArray(rawModel)
|
||||
? String(rawModel.at(-1) ?? '').trim() || ''
|
||||
: rawModel === undefined
|
||||
? undefined
|
||||
: String(rawModel ?? '').trim() || '';
|
||||
|
||||
const resolvedModel =
|
||||
specifiedModel === GEMINI_MODEL_ALIAS_AUTO
|
||||
? defaultModel
|
||||
|
||||
Reference in New Issue
Block a user