fix: Continue on a reply whose model is no longer available breaks the next message (#35261)

Clicking Continue under a reply whose model was removed or is offline seemed to do nothing, but it marked the reply as still generating. The next message the user sent then flipped that old reply back into the generating state with a stop button, and was sent as queued behind a reply that was not running. Now Continue shows a "Model not found" error and leaves the reply as it was, and the next message sends normally.

Fixes #35260
This commit is contained in:
Classic298 authored and GitHub committed 2026-12-01 00:25:22 +04:00
1 parent 6438a63b35
commit bc40f60f6f
1 file changed
+6 -4
+6 -4
View File
@@ -5724,15 +5724,15 @@
if (history.messages[message.id].done == true) {
const responseMessage = history.messages[message.id];
responseMessage.done = false;
responseMessage.error = null;
await tick();
const model = ($models ?? [])
.filter((m) => m.id === (responseMessage?.selectedModelId ?? responseMessage.model))
.at(0);
if (model) {
responseMessage.done = false;
responseMessage.error = null;
await tick();
await sendMessageSocket(
model,
createMessagesList(history, responseMessage.id),
@@ -5741,6 +5741,8 @@
_chatId,
{ continueResponse: true }
);
} else {
toast.error($i18n.t('Model not found'));
}
}
};