From a87c9c3299a451ea0cb96896e36ce619e84f9ee6 Mon Sep 17 00:00:00 2001 From: pakrym-oai Date: Fri, 20 Feb 2026 23:32:59 -0800 Subject: [PATCH] Collapse waited message (#12430) image --- ...ified_exec_empty_then_non_empty_after.snap | 3 +- ...ified_exec_non_empty_then_empty_after.snap | 3 +- ...d_exec_wait_after_final_agent_message.snap | 3 +- ...ec_wait_before_streamed_agent_message.snap | 3 +- ...ied_exec_waiting_multiple_empty_after.snap | 3 +- codex-rs/tui/src/history_cell.rs | 29 ++++++++++--------- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_empty_then_non_empty_after.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_empty_then_non_empty_after.snap index 400845c82..dcfad97ba 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_empty_then_non_empty_after.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_empty_then_non_empty_after.snap @@ -2,8 +2,7 @@ source: tui/src/chatwidget/tests.rs expression: combined --- -↳ Interacted with background terminal · just fix - └ (waited) +• Waited for background terminal · just fix ↳ Interacted with background terminal · just fix └ ls diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_non_empty_then_empty_after.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_non_empty_then_empty_after.snap index f6f0188f9..952205e73 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_non_empty_then_empty_after.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_non_empty_then_empty_after.snap @@ -5,5 +5,4 @@ expression: combined ↳ Interacted with background terminal · just fix └ pwd -↳ Interacted with background terminal · just fix - └ (waited) +• Waited for background terminal · just fix diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_after_final_agent_message.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_after_final_agent_message.snap index 5caf42e1b..fdbdffc5d 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_after_final_agent_message.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_after_final_agent_message.snap @@ -2,7 +2,6 @@ source: tui/src/chatwidget/tests.rs expression: combined --- -↳ Interacted with background terminal · cargo test -p codex-core - └ (waited) +• Waited for background terminal · cargo test -p codex-core • Final response. diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_before_streamed_agent_message.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_before_streamed_agent_message.snap index cfea4f8a6..f91637e2d 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_before_streamed_agent_message.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_before_streamed_agent_message.snap @@ -2,7 +2,6 @@ source: tui/src/chatwidget/tests.rs expression: combined --- -↳ Interacted with background terminal · cargo test -p codex-core - └ (waited) +• Waited for background terminal · cargo test -p codex-core • Streaming response. diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_waiting_multiple_empty_after.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_waiting_multiple_empty_after.snap index 782ecb1ea..99bf8e2bd 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_waiting_multiple_empty_after.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_waiting_multiple_empty_after.snap @@ -2,5 +2,4 @@ source: tui/src/chatwidget/tests.rs expression: combined --- -↳ Interacted with background terminal · just fix - └ (waited) +• Waited for background terminal · just fix diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index 878919694..8c4d0147d 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -589,8 +589,13 @@ impl HistoryCell for UnifiedExecInteractionCell { return Vec::new(); } let wrap_width = width as usize; + let waited_only = self.stdin.is_empty(); - let mut header_spans = vec!["↳ ".dim(), "Interacted with background terminal".bold()]; + let mut header_spans = if waited_only { + vec!["• Waited for background terminal".bold()] + } else { + vec!["↳ ".dim(), "Interacted with background terminal".bold()] + }; if let Some(command) = &self.command_display && !command.is_empty() { @@ -603,14 +608,15 @@ impl HistoryCell for UnifiedExecInteractionCell { let header_wrapped = word_wrap_line(&header, RtOptions::new(wrap_width)); push_owned_lines(&header_wrapped, &mut out); - let input_lines: Vec> = if self.stdin.is_empty() { - vec![vec!["(waited)".dim()].into()] - } else { - self.stdin - .lines() - .map(|line| Line::from(line.to_string())) - .collect() - }; + if waited_only { + return out; + } + + let input_lines: Vec> = self + .stdin + .lines() + .map(|line| Line::from(line.to_string())) + .collect(); let input_wrapped = word_wrap_lines( input_lines, @@ -2465,10 +2471,7 @@ mod tests { fn unified_exec_interaction_cell_renders_wait() { let cell = new_unified_exec_interaction(None, String::new()); let lines = render_transcript(&cell); - assert_eq!( - lines, - vec!["↳ Interacted with background terminal", " └ (waited)"], - ); + assert_eq!(lines, vec!["• Waited for background terminal"]); } #[test]