🎪 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

@ -66,7 +66,8 @@ export default function ChatRoute() {
}
if (conversationId === Constants.NEW_CONVO && endpointsQuery.data && modelsQuery.data) {
const spec = getDefaultModelSpec(startupConfig);
const result = getDefaultModelSpec(startupConfig);
const spec = result?.default ?? result?.last;
logger.log('conversation', 'ChatRoute, new convo effect', conversation);
newConversation({
modelsData: modelsQuery.data,
@ -90,7 +91,8 @@ export default function ChatRoute() {
assistantListMap[EModelEndpoint.assistants] &&
assistantListMap[EModelEndpoint.azureAssistants]
) {
const spec = getDefaultModelSpec(startupConfig);
const result = getDefaultModelSpec(startupConfig);
const spec = result?.default ?? result?.last;
logger.log('conversation', 'ChatRoute new convo, assistants effect', conversation);
newConversation({
modelsData: modelsQuery.data,