open-webui/backend/open_webui/socket
Claude 9af2b478bb
fix(stream): keep seq state across terminal events, reply on auth fail, broaden terminal TTL
- Stopped deleting resumeSeqByMessageId entries on done / cancel /
  error. The map now only clears on chat/navigation transitions
  (loadChat, initNewChat, component unmount). Fixes a continuation-
  reuses-message_id duplication hole: if a message completes and its
  id is immediately reused for a continued/extended response, the
  log's 30s grace window can still serve old envelopes; resetting
  the client's lastSeq to 0 on done made those old envelopes replay.
  Keeping the seq alive until the message is truly retired avoids
  re-applying them.

- resume_stream now always replies when the payload has a message_id,
  even on auth failure (empty envelopes). Silent early-return branches
  could previously leave the client fence raised for the full 10s
  fallback timeout during reconnect/auth churn. Silent drops only
  remain for cases where the client couldn't have raised a fence.

- Terminal TTL shortening now also triggers on chat:tasks:cancel and
  error-finalized completions, not just done:True. Cancelled/errored
  streams no longer leak log+seq keys for the full 1h TTL.
2026-04-14 22:56:14 +00:00
..
main.py fix(stream): keep seq state across terminal events, reply on auth fail, broaden terminal TTL 2026-04-14 22:56:14 +00:00
utils.py refac 2026-03-22 05:48:05 -05:00