@@ -18,6 +18,7 @@ import kotlinx.coroutines.CancellationException
1818import kotlinx.coroutines.ExperimentalCoroutinesApi
1919import kotlinx.coroutines.Job
2020import kotlinx.coroutines.channels.BufferOverflow
21+import kotlinx.coroutines.delay
2122import kotlinx.coroutines.flow.MutableSharedFlow
2223import kotlinx.coroutines.flow.MutableStateFlow
2324import kotlinx.coroutines.flow.SharedFlow
@@ -228,7 +229,9 @@ class SessionListViewModel(private val container: AppContainer) : ViewModel() {
228229 /**
229230 * Reload the preview for a single session (used by the live SSE handler).
230231 * Cancels any prior in-flight load for the same session so a burst of
231− * [SessionUpdated] events coalesces into a single request.
232+ * [SessionUpdated] events coalesces into a single request. A short debounce
233+ * delay before the fetch avoids launching one full-history download per event
234+ * during active streaming — the fetch runs only after events quiet down.
232235 */
233236 private fun loadPreview(sessionId: String) {
234237 val conn = container.activeConnection.value ?: return
@@ -238,6 +241,7 @@ class SessionListViewModel(private val container: AppContainer) : ViewModel() {
238241 livePreviewJobs[sessionId] = viewModelScope.launch {
239242 val job = coroutineContext[kotlinx.coroutines.Job]
240243 try {
244+ delay(NetworkConfig.previewDebounceMs)
241245 val preview = fetchSessionPreview(api, sessionId) ?: return@launch
242246 _state.update { s -> s.copy(previews = s.previews + (sessionId to preview)) }
243247 } catch (e: CancellationException) {