From 8b290e8707cf11db346196934391ecb41c2690b3 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Tue, 17 Feb 2026 19:06:33 -0800 Subject: [PATCH] Drop redundant summary check for incoming compaction items --- codex-rs/core/src/compact.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/codex-rs/core/src/compact.rs b/codex-rs/core/src/compact.rs index 31203ba37b..b8606c29cb 100644 --- a/codex-rs/core/src/compact.rs +++ b/codex-rs/core/src/compact.rs @@ -308,8 +308,7 @@ async fn run_compact_task_inner( // TODO(ccunningham): Truncate user shell-command records before preserving them // in incoming compaction items so they cannot cause repeated context-window // overflows across pre-turn compaction attempts. - (should_keep_compacted_history_item(item) || is_user_shell_command_record(item)) - && !is_summary_user_message_item(item) + should_keep_compacted_history_item(item) || is_user_shell_command_record(item) }) .cloned() .collect(), @@ -445,13 +444,6 @@ fn is_real_user_message(item: &ResponseItem) -> bool { ) } -fn is_summary_user_message_item(item: &ResponseItem) -> bool { - matches!( - crate::event_mapping::parse_turn_item(item), - Some(TurnItem::UserMessage(user_message)) if is_summary_message(&user_message.message()) - ) -} - fn is_user_shell_command_record(item: &ResponseItem) -> bool { matches!( item,