open-webui/backend/open_webui/socket
Claude 5533368699
style+fix(stream): tighten comments and address two review findings
Comment cleanup: cut the essay-length explanations on the resume-stream
feature down to single-line navigation aids. Logic is unchanged by the
tone-down itself.

Finding 1 (resume depended on DB presence of in-flight message):
scoped the Redis stream key by user_id — `stream:{user_id}:{message_id}`
instead of `stream:{message_id}`. An authenticated session can now only
ever read its own user's logs, so the separate chat-ownership +
message-in-chat DB lookups are no longer needed for auth. This also
fixes the case the review flagged: if the assistant stub has not yet
been persisted to the DB at refresh time (the exact scenario
ENABLE_REALTIME_CHAT_SAVE=False exposes), the prior message-in-chat
check would reject resume; now it doesn't apply. Frontend drops the
now-unused chat_id from the resume payload.

Finding 2 (resumeSeqByMessageId accumulated on non-done terminal paths):
prune the map in every terminal transition, not just the happy-path
chatCompletionEventHandler done branch:
  - chat:tasks:cancel (both same-message and sibling arms)
  - the HTTP error-finalization path (responseMessage.done + error)
  - the generic error handler that marks all siblings done
Long-lived sessions with cancelled/errored generations no longer leak
stale seq entries.
2026-04-14 21:54:43 +00:00
..
main.py style+fix(stream): tighten comments and address two review findings 2026-04-14 21:54:43 +00:00
utils.py refac 2026-03-22 05:48:05 -05:00