open-webui/backend/open_webui/socket
Claude fd1cf4221e
fix(stream): env-tunable timeouts, request_id correlation, doc concurrent-emitter limit
- Timeouts split and env-configurable. RESUME_STREAM_REDIS_TIMEOUT_SEC
  (hot path, default 100ms) stays tight to protect live streaming.
  RESUME_STREAM_READ_TIMEOUT_SEC (replay XRANGE, default 1s) is looser
  since a resume is user-blocking and silently timing out is worse
  than a brief extra wait. Cross-region / non-colocated Redis setups
  can override either.

- resume-stream now carries a request_id; the server echoes it in
  resume-stream:replay and the client ignores replies whose id does
  not match the active request for that message. Prevents reconnect
  churn where a stale reply could clear a fence belonging to a
  newer in-flight request.

- Documented the concurrent-emitter live ordering caveat in
  get_event_emitter. Single-emitter flows are safe (streaming loop
  awaits sequentially). Replay is safe (sorted by seq on read).
  Overlapping emitters for the same message_id can produce live frames
  out of seq order — accepting as a known limitation; proper fix
  needs either a distributed per-message lock or a client reorder
  buffer, neither justified by the rarity of the scenario.
2026-04-14 22:49:12 +00:00
..
main.py fix(stream): env-tunable timeouts, request_id correlation, doc concurrent-emitter limit 2026-04-14 22:49:12 +00:00
utils.py refac 2026-03-22 05:48:05 -05:00