diff --git a/codex-rs/tui/src/app/thread_events.rs b/codex-rs/tui/src/app/thread_events.rs index f49f7826e9..282074b878 100644 --- a/codex-rs/tui/src/app/thread_events.rs +++ b/codex-rs/tui/src/app/thread_events.rs @@ -331,12 +331,12 @@ impl ThreadEventStore { _ => {} } - // These notifications are either handled before routing or ignored by ChatWidget on - // replay. In particular, raw response items and realtime audio can carry large payloads, - // so cloning them into every thread's replay buffer only retains data the TUI cannot use. + // These notifications add no replayable content. Turn diffs only refresh the status + // line, which replay_thread_snapshot already refreshes after rebuilding the widget. if matches!( notification.as_ref(), ServerNotification::RawResponseItemCompleted(_) + | ServerNotification::TurnDiffUpdated(_) | ServerNotification::FileChangePatchUpdated(_) | ServerNotification::ServerRequestResolved(_) | ServerNotification::McpToolCallProgress(_) @@ -744,6 +744,7 @@ mod tests { use codex_app_server_protocol::ThreadRealtimeAudioChunk; use codex_app_server_protocol::ThreadRealtimeOutputAudioDeltaNotification; use codex_app_server_protocol::TurnCompletedNotification; + use codex_app_server_protocol::TurnDiffUpdatedNotification; use codex_app_server_protocol::TurnStartedNotification; use codex_app_server_protocol::UserInput; use codex_config::types::ApprovalsReviewer; @@ -1002,6 +1003,13 @@ mod tests { let large_payload = "x".repeat(1024 * 1024); for _ in 0..32 { + store.push_notification_ref(&ServerNotification::TurnDiffUpdated( + TurnDiffUpdatedNotification { + thread_id: thread_id.to_string(), + turn_id: "turn-1".to_string(), + diff: large_payload.clone(), + }, + )); store.push_notification_ref(&ServerNotification::ThreadAttachmentUpdated( ThreadAttachmentUpdatedNotification { thread_id: thread_id.to_string(),