From 1e3c0042eb6613ef3843c45562c5618b1eced071 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 29 Jul 2026 16:17:42 +0000 Subject: [PATCH] Display title-only reasoning summaries in the TUI (#35989) ## What changed - Treat a single non-empty bold span as a title-only reasoning summary instead of transcript-only content. - Render title-only summaries consistently in the TUI history and transcript. - Add a regression test covering both render paths. GitOrigin-RevId: e3cda451b3fa0ad92985463b14427384bcae4a8d --- codex-rs/tui/src/history_cell/messages.rs | 6 +++++- codex-rs/tui/src/history_cell/tests.rs | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/src/history_cell/messages.rs b/codex-rs/tui/src/history_cell/messages.rs index f8fe26e7ad..6f9ea937bc 100644 --- a/codex-rs/tui/src/history_cell/messages.rs +++ b/codex-rs/tui/src/history_cell/messages.rs @@ -553,7 +553,11 @@ pub(crate) fn new_reasoning_summary_block( cwd: &Path, ) -> Box { let (header, content) = split_reasoning_summary_parts(&reasoning_parts); - let transcript_only = header.is_empty(); + let title_only = content + .strip_prefix("**") + .and_then(|content| content.strip_suffix("**")) + .is_some_and(|content| !content.is_empty() && !content.contains("**")); + let transcript_only = header.is_empty() && !title_only; Box::new(ReasoningSummaryCell::new( header, content, diff --git a/codex-rs/tui/src/history_cell/tests.rs b/codex-rs/tui/src/history_cell/tests.rs index 2402a6a595..9010894d69 100644 --- a/codex-rs/tui/src/history_cell/tests.rs +++ b/codex-rs/tui/src/history_cell/tests.rs @@ -2496,6 +2496,26 @@ fn reasoning_summary_block_falls_back_when_summary_is_missing() { assert_eq!(rendered, vec!["• High level reasoning without closing"]); } +#[test] +fn reasoning_summary_block_displays_title_only_summary() { + let cell = new_reasoning_summary_block( + vec!["**Confirming backend JSONL source**".to_string()], + &test_cwd(), + ); + + let rendered_display = render_lines(&cell.display_lines(/*width*/ 80)); + insta::assert_snapshot!( + rendered_display.join("\n"), + @"• Confirming backend JSONL source" + ); + + let rendered_transcript = render_transcript(cell.as_ref()); + assert_eq!( + rendered_transcript, + vec!["• Confirming backend JSONL source"] + ); +} + #[test] fn reasoning_summary_block_splits_header_and_summary_when_present() { let cell = new_reasoning_summary_block(