fix: chats started in a voice call keep the title "New Chat"

A chat started from a voice call is saved as soon as the first words are transcribed, before the chat model answers. The app then treats it as an existing chat, so it never gets a generated title or tags and stays named "New Chat". Now the first chat model answer in a chat that so far holds only the voice call gets a title and tags, like a chat started by typing.

Fixes #32258
This commit is contained in:
Classic298 2026-10-12 11:26:28 +02:00
parent 40df1542ce
commit 4826f93287

View file

@ -3980,6 +3980,13 @@
) => {
const responseMessage = _history.messages[responseMessageId];
const userMessage = _history.messages[responseMessage.parentId];
// A voice call saves the chat before the chat model first answers.
const isVoiceOnlyChat = Object.values(_history.messages).every(
(message) =>
message.id === responseMessageId ||
(message.meta?.voice &&
(message.role === 'user' || message.model === message.meta.voice.model))
);
const chatMessageFiles = _messages
.filter((message) => message.files)
@ -4183,7 +4190,8 @@
(!_chatId ||
(embedded &&
(userMessage?.parentId ?? null) === null &&
createMessagesList(_history, responseMessageId).length === 2))
createMessagesList(_history, responseMessageId).length === 2) ||
isVoiceOnlyChat)
? {
title_generation: $settings?.title?.auto ?? true,
tags_generation: $settings?.autoTags ?? true