mirror of
https://github.com/openai/codex.git
synced 2026-06-01 19:02:59 +00:00
Drop redundant summary check for incoming compaction items
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user