mirror of
https://github.com/coder/coder.git
synced 2026-11-12 20:50:29 +08:00
The in-memory stream buffer accumulated message-part events for the entire duration of a chat run. Late-joining subscribers received all buffered parts even though the backing messages had already been committed to the database, wasting memory and potentially duplicating content. Clear the buffer at the end of each `persistStep` call so that only in-flight (uncommitted) parts remain in the buffer.