From 5fcc460c336b8df5effca8d2d1f37844cce50ab0 Mon Sep 17 00:00:00 2001 From: dongchao <2193993758@qq.com> Date: Tue, 26 May 2026 23:10:06 +0800 Subject: [PATCH] fix(runtime): truncate assistant summary on UTF-8 char boundary to prevent CJK panic (#2167) --- crates/tui/src/runtime_threads.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tui/src/runtime_threads.rs b/crates/tui/src/runtime_threads.rs index 49cd02d1..23cad864 100644 --- a/crates/tui/src/runtime_threads.rs +++ b/crates/tui/src/runtime_threads.rs @@ -1434,7 +1434,7 @@ impl RuntimeThreadManager { if let Some(assistant_text) = assistant_text { let asst_summary = if assistant_text.len() > SUMMARY_LIMIT { - format!("{}...", &assistant_text[..SUMMARY_LIMIT.saturating_sub(3)]) + crate::utils::truncate_with_ellipsis(&assistant_text, SUMMARY_LIMIT, "...") } else { assistant_text.clone() };