From 0423321cb12b4fabe4d1f70e8cda6a540a24cfeb Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 25 May 2026 12:49:34 +0900 Subject: [PATCH] fix(test): update compact test to reflect flattened previous-context header --- rust/crates/runtime/src/compact.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/crates/runtime/src/compact.rs b/rust/crates/runtime/src/compact.rs index 5b3076f1..797d3a6b 100644 --- a/rust/crates/runtime/src/compact.rs +++ b/rust/crates/runtime/src/compact.rs @@ -688,7 +688,9 @@ mod tests { second_session.messages = follow_up_messages; let second = compact_session(&second_session, config); - assert!(second + // "Previously compacted context:" header is intentionally flattened + // (no re-nesting) to avoid summary inflation on repeated compaction. + assert!(!second .formatted_summary .contains("Previously compacted context:")); assert!(second @@ -703,7 +705,7 @@ mod tests { assert!(matches!( &second.compacted_session.messages[0].blocks[0], ContentBlock::Text { text } - if text.contains("Previously compacted context:") + if !text.contains("Previously compacted context:") && text.contains("Newly compacted context:") )); assert!(matches!(