Push model-switching logging into loadCliConfig (#815)

This commit is contained in:
Tommaso Sciortino
2025-06-07 11:12:30 -07:00
committed by GitHub
parent 680f4cdd61
commit 6ea4479064
5 changed files with 45 additions and 112 deletions

View File

@@ -66,18 +66,11 @@ export async function main() {
process.exit(1);
}
const { config, modelWasSwitched, originalModelBeforeSwitch, finalModel } =
await loadCliConfig(settings.merged, geminiIgnorePatterns);
const config = await loadCliConfig(settings.merged, geminiIgnorePatterns);
// Initialize centralized FileDiscoveryService
await config.getFileService();
if (modelWasSwitched && originalModelBeforeSwitch) {
console.log(
`[INFO] Your configured model (${originalModelBeforeSwitch}) was temporarily unavailable. Switched to ${finalModel} for this session.`,
);
}
if (settings.merged.theme) {
if (!themeManager.setActiveTheme(settings.merged.theme)) {
// If the theme is not found during initial load, log a warning and continue.
@@ -176,9 +169,8 @@ async function loadNonInteractiveConfig(
...settings.merged,
coreTools: nonInteractiveTools,
};
const nonInteractiveConfigResult = await loadCliConfig(
return await loadCliConfig(
nonInteractiveSettings,
config.getGeminiIgnorePatterns(),
);
return nonInteractiveConfigResult.config;
}