Skip to content

Commit 0423321

Browse files
committed
fix(test): update compact test to reflect flattened previous-context header
1 parent 06c126a commit 0423321

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

rust/crates/runtime/src/compact.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,9 @@ mod tests {
688688
second_session.messages = follow_up_messages;
689689
let second = compact_session(&second_session, config);
690690

691-
assert!(second
691+
// "Previously compacted context:" header is intentionally flattened
692+
// (no re-nesting) to avoid summary inflation on repeated compaction.
693+
assert!(!second
692694
.formatted_summary
693695
.contains("Previously compacted context:"));
694696
assert!(second
@@ -703,7 +705,7 @@ mod tests {
703705
assert!(matches!(
704706
&second.compacted_session.messages[0].blocks[0],
705707
ContentBlock::Text { text }
706-
if text.contains("Previously compacted context:")
708+
if !text.contains("Previously compacted context:")
707709
&& text.contains("Newly compacted context:")
708710
));
709711
assert!(matches!(

0 commit comments

Comments
 (0)