aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-ai/src/tui/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/atuin-ai/src/tui/state.rs')
-rw-r--r--crates/atuin-ai/src/tui/state.rs10
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;