From b9596a9640a81bff590ed11ba36cd680ea336c96 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Tue, 26 May 2026 13:39:57 -0500 Subject: [PATCH] fix(tui): flush active cell before inserting steer message in transcript Steered/queued user messages were being inserted into app.history before the active cell (holding streaming thinking/tool content) was flushed, causing the user's message to render above (before) the thinking block that chronologically preceded it. Now call app.flush_active_cell() before app.add_message() in steer_user_message(), matching the pattern used in MessageStarted and MessageDelta handlers. Fixes #2225. --- crates/tui/src/tui/ui.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/tui/src/tui/ui.rs b/crates/tui/src/tui/ui.rs index 7c77715d..c0f1dad4 100644 --- a/crates/tui/src/tui/ui.rs +++ b/crates/tui/src/tui/ui.rs @@ -5384,6 +5384,11 @@ async fn steer_user_message( engine_handle.steer(content.clone()).await?; app.last_submitted_prompt = Some(message.display.clone()); + // Flush any streaming thinking/tool content into history before + // inserting the steer message, so the steer appears after (below) + // the content that chronologically preceded it. + app.flush_active_cell(); + // Mirror steer input in local transcript/session state. app.add_message(HistoryCell::User { content: format!("+ {}", message.display),