From 48b197781f7cee93b733484698fc7fee3cc5f0c8 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Tue, 14 Apr 2026 18:44:03 -0700 Subject: fix: loss of loading spinners + tokio panic on exit (#3415) --- crates/atuin-ai/src/tui/state.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'crates/atuin-ai/src/tui/state.rs') diff --git a/crates/atuin-ai/src/tui/state.rs b/crates/atuin-ai/src/tui/state.rs index a012386a..e122918e 100644 --- a/crates/atuin-ai/src/tui/state.rs +++ b/crates/atuin-ai/src/tui/state.rs @@ -525,10 +525,14 @@ impl Session { // ===== Streaming lifecycle methods ===== /// Start streaming response. - /// The Text event for streamed content is created lazily by - /// `append_streaming_text` when the first chunk arrives, so we - /// don't leave an empty assistant turn in the conversation. + /// Pushes an empty Text event so the UI immediately creates an agent + /// turn (which renders the spinner). The empty event is skipped by + /// `events_to_messages` so it never becomes an empty assistant turn + /// in the API payload. pub fn start_streaming(&mut self) { + self.conversation.events.push(ConversationEvent::Text { + content: String::new(), + }); self.interaction.streaming_status = None; self.interaction.was_interrupted = false; self.interaction.mode = AppMode::Streaming; -- cgit v1.3.1