🎪 refactor: Allow Last Model Spec Selection without Prioritizing (#10258)

* refactor: Default Model Spec Retrieval Logic, allowing last selected spec on new chat if last selection was a spec

* chore: Replace hardcoded 'new' conversation ID with Constants.NEW_CONVO for consistency

* chore: remove redundant condition for model spec preset selection in useNewConvo hook
This commit is contained in:
Danny Avila 2025-10-26 21:37:55 -04:00 committed by GitHub
parent cbbbde3681
commit 90e610ceda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 12 deletions

View file

@ -252,18 +252,20 @@ const useNewConvo = (index = 0) => {
};
let preset = _preset;
const defaultModelSpec = getDefaultModelSpec(startupConfig);
const result = getDefaultModelSpec(startupConfig);
const defaultModelSpec = result?.default ?? result?.last;
if (
!preset &&
startupConfig &&
(startupConfig.modelSpecs?.prioritize === true ||
(startupConfig.interface?.modelSelect ?? true) !== true) &&
(startupConfig.interface?.modelSelect ?? true) !== true ||
(result?.last != null && Object.keys(_template).length === 0)) &&
defaultModelSpec
) {
preset = getModelSpecPreset(defaultModelSpec);
}
if (conversation.conversationId === 'new' && !modelsData) {
if (conversation.conversationId === Constants.NEW_CONVO && !modelsData) {
const filesToDelete = Array.from(files.values())
.filter(
(file) =>