306
307
if (session.kind === 'existing') {
309
>
return {
310
>
currentModel: sessionModel,
311
>
currentReason: ModelSelectionReason.SessionRestore,
312
>
pendingSelection: undefined,
313
>
effect: { kind: 'none' },
314
>
sessionKey,
315
>
lastPushedChatKey: chatKey,
316
>
};
317
>
}
318
if (fallbackModel) {
319
return applyResult(sessionKey, chatKey, fallbackModel, sessionModelId ? ModelSelectionReason.RemovedModelFallback : ModelSelectionReason.FirstAvailable);
320
}
322
323
const currentModelAvailable = !!currentModel && models.available.some(model => model.identifier === currentModel.identifier);