fix: older responses keep a loading cursor forever after opening a chat (#31895)

Opening a chat only cleared the loading cursor on the newest response that never finished, so an older one (from a cancelled generation, or a turn an earlier Open WebUI version left unfinished) kept spinning and never showed its copy and regenerate buttons. Now, when no generation is running in the chat, every unfinished response shows as finished on load, except one waiting for the user to answer a tool's question. While a generation is running nothing changes, because another model's response to the same message may still be streaming in.

Fixes #14806
This commit is contained in:
Classic298 2026-10-03 15:04:29 +02:00 • committed by GitHub
parent 7e6c8d7b6f
commit 394295ec76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2470,12 +2470,16 @@
} else {
taskIds = null;
// No active tasks and message incomplete → generation was interrupted
if (
currentMessage?.role === 'assistant' &&
!currentMessage.done &&
!messageHasPendingAskUser(currentMessage)
) {
currentMessage.done = true;
if (pendingTaskIds.length === 0) {
for (const message of Object.values(history.messages)) {
if (
message?.role === 'assistant' &&
!message.done &&
!messageHasPendingAskUser(message)
) {
message.done = true;
}
}
}
}