open-webui/backend
Claude cffe1537ec
fix(stream): preserve ack cb on buffered frames, fail-closed on DB, per-message lock
- chatEventHandler queue now stores {event, cb} pairs. Live frames
  buffered during a replay fence used to lose their Socket.IO ack
  callback because we only pushed the event. When replayed, callback-
  style events (confirmation / execute / input) would silently never
  respond. Now we preserve cb and pass it through to chatEventHandler
  on flush.

- resume_stream ownership check is now fail-CLOSED on DB exception.
  Previous fail-open skipped the check precisely when infra was
  unstable. Client still gets a deterministic reply (empty envelopes)
  so the fence clears; it just can't resume in that specific failure
  mode. Absent chat_id still falls through to the user-scoped key
  guarantee.

- Added per-message asyncio.Lock via a WeakValueDictionary keyed by
  (user_id, message_id). Serializes seq-alloc + log-append + emit so
  concurrent emitters for the same message_id within a worker can't
  interleave and produce out-of-seq live frames. WeakValueDictionary
  cleans up automatically once no coroutine holds the lock.
  Cross-worker concurrency is still unprotected (would need a
  distributed lock) but that's an even rarer scenario.
2026-04-15 07:32:50 +00:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui fix(stream): preserve ack cb on buffered frames, fail-closed on DB, per-message lock 2026-04-15 07:32:50 +00:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt refac 2026-04-13 23:40:09 -05:00
requirements.txt refac 2026-04-13 23:40:09 -05:00
start.sh refac 2026-03-24 19:43:30 -05:00
start_windows.bat refac 2026-03-24 19:43:30 -05:00