fix(runtime): truncate assistant summary on UTF-8 char boundary to prevent CJK panic (#2167)

This commit is contained in:
dongchao
2026-05-26 23:10:06 +08:00
committed by GitHub
parent 7c0e242895
commit 5fcc460c33
+1 -1
View File
@@ -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()
};