diff --git a/crates/hx-core/src/agent.rs b/crates/hx-core/src/agent.rs index 0dbfa51..c1157f8 100644 --- a/crates/hx-core/src/agent.rs +++ b/crates/hx-core/src/agent.rs @@ -1,10 +1,10 @@ //! Agent loop: stream -> tool calls -> hooks -> results -> repeat. use crate::compact; -use crate::window::ContextWindow; use crate::hook::{Bus, Event}; use crate::session::Session; use crate::tool::{Registry, ToolCtx}; +use crate::window::ContextWindow; use futures::StreamExt; use hx_ai::{ContentBlock, Message, Provider, Request, Role, StopReason, StreamEvent, Usage}; use std::sync::Arc; @@ -228,9 +228,7 @@ impl Agent { if self.aborted() { return Err(Error::Aborted); } - if self.window.should_compact(&self.session.messages()) - && self.compact(6).await? - { + if self.window.should_compact(&self.session.messages()) && self.compact(6).await? { self.emit(Event::Info("context compacted".into())).await; } self.emit(Event::TurnStart).await;