diff options
| author | Michelle Tilley <michelle@michelletilley.net> | 2026-04-14 18:44:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-14 18:44:03 -0700 |
| commit | 48b197781f7cee93b733484698fc7fee3cc5f0c8 (patch) | |
| tree | fba04cf2e8926c165f469390e12d6356cbafff70 /crates/atuin-ai/src/tui/state.rs | |
| parent | feat: Allow resuming previous AI sessions (#3407) (diff) | |
| download | atuin-48b197781f7cee93b733484698fc7fee3cc5f0c8.zip | |
fix: loss of loading spinners + tokio panic on exit (#3415)
Diffstat (limited to 'crates/atuin-ai/src/tui/state.rs')
| -rw-r--r-- | crates/atuin-ai/src/tui/state.rs | 10 |
1 files changed, 7 insertions, 3 deletions
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; |
