feat(agent): 移除未使用的导入并简化条件表达式

This commit is contained in:
徐涛
2026-07-03 13:55:24 +08:00
parent 9e4f50c955
commit e54edbc037
9 changed files with 16 additions and 25 deletions
+2 -3
View File
@@ -174,8 +174,8 @@ impl ConversationMemory {
}
}
if let Some(ref compact_config) = self.config.compact_config {
if should_compact(&self.messages, compact_config, &self.compact_state) {
if let Some(ref compact_config) = self.config.compact_config
&& should_compact(&self.messages, compact_config, &self.compact_state) {
let keep_recent = compact_config.keep_recent;
let freed = microcompact(&mut self.messages, keep_recent);
if freed > 0 {
@@ -184,7 +184,6 @@ impl ConversationMemory {
let _ = self.compact_state.record_failure();
}
}
}
}
}