open-webui/backend/open_webui/socket
Claude 46d54c6557
fix(stream): replace delayed-truncate task with TTL shortening on done
The background asyncio task scheduled in the previous fix had a race:
if a second emitter for the same message_id started within the 30s
grace window, the pending DELETE would fire mid-stream and wipe the
new run's log.

Switch to shortening the key's TTL instead. EXPIRE is race-free —
a second emitter's eager truncate at creation resets the key and its
subsequent EXPIRE calls in _stream_log_append extend the TTL normally.
Same 30s post-done retention window, same clean-up behavior, no
background task to reason about.
2026-04-14 21:44:16 +00:00
..
main.py fix(stream): replace delayed-truncate task with TTL shortening on done 2026-04-14 21:44:16 +00:00
utils.py refac 2026-03-22 05:48:05 -05:00