mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-14 16:10:59 -07:00
chore(core): refactor model resolution and cleanup fallback logic (#15228)
This commit is contained in:
@@ -253,10 +253,7 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
[],
|
||||
);
|
||||
|
||||
// Helper to determine the effective model, considering the fallback state.
|
||||
const getEffectiveModel = useCallback(() => config.getModel(), [config]);
|
||||
|
||||
const [currentModel, setCurrentModel] = useState(getEffectiveModel());
|
||||
const [currentModel, setCurrentModel] = useState(config.getModel());
|
||||
|
||||
const [userTier, setUserTier] = useState<UserTierId | undefined>(undefined);
|
||||
|
||||
@@ -341,7 +338,7 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
return () => {
|
||||
coreEvents.off(CoreEvent.ModelChanged, handleModelChanged);
|
||||
};
|
||||
}, [getEffectiveModel, config]);
|
||||
}, [config]);
|
||||
|
||||
const { consoleMessages, clearConsoleMessages: clearConsoleMessagesState } =
|
||||
useConsoleMessages();
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
ToolCallEvent,
|
||||
debugLogger,
|
||||
ReadManyFilesTool,
|
||||
getEffectiveModel,
|
||||
resolveModel,
|
||||
createWorkingStdio,
|
||||
startupProfiler,
|
||||
} from '@google/gemini-cli-core';
|
||||
@@ -282,7 +282,7 @@ export class Session {
|
||||
const functionCalls: FunctionCall[] = [];
|
||||
|
||||
try {
|
||||
const model = getEffectiveModel(
|
||||
const model = resolveModel(
|
||||
this.config.getModel(),
|
||||
this.config.getPreviewFeatures(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user