diff --git a/hive-ag3nt/src/bin/hive.rs b/hive-ag3nt/src/bin/hive.rs index 9fbd5b30..1bc1df0d 100644 --- a/hive-ag3nt/src/bin/hive.rs +++ b/hive-ag3nt/src/bin/hive.rs @@ -8,7 +8,6 @@ use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use std::time::Duration; - use anyhow::Result; use clap::{Parser, Subcommand}; use hive_ag3nt::events::{Bus, LiveEvent, TurnState}; @@ -549,8 +548,7 @@ async fn serve_loop( } }, }; - let ctrl = - handle_turn::(socket, &bus, stats.as_ref(), files, &session, next).await; + let ctrl = handle_turn::(socket, &bus, stats.as_ref(), files, &session, next).await; if ctrl.auth_failed { *login_state.lock().unwrap() = LoginState::NeedsLogin; login::wait_for_login( diff --git a/hive-ag3nt/src/events.rs b/hive-ag3nt/src/events.rs index d9721b34..1b94893c 100644 --- a/hive-ag3nt/src/events.rs +++ b/hive-ag3nt/src/events.rs @@ -433,7 +433,6 @@ impl EventStore { } } - /// Authoritative turn-loop state. The harness owns it; the web UI /// reads via `/api/state` and renders. Lives alongside the bus /// because everyone who has a `Bus` already has the right handle to diff --git a/hive-ag3nt/src/login.rs b/hive-ag3nt/src/login.rs index 363c7102..18468e85 100644 --- a/hive-ag3nt/src/login.rs +++ b/hive-ag3nt/src/login.rs @@ -227,7 +227,10 @@ mod tests { let dir = tempfile::tempdir().unwrap(); fs::write(dir.path().join("history.jsonl"), b"{}").unwrap(); let snap = snapshot_dir(dir.path()); - assert_eq!(snap.file_count, 0, "history files must not count as session"); + assert_eq!( + snap.file_count, 0, + "history files must not count as session" + ); } #[test] diff --git a/hive-ag3nt/src/web_ui/stats.rs b/hive-ag3nt/src/web_ui/stats.rs index 29555d22..183a0d9e 100644 --- a/hive-ag3nt/src/web_ui/stats.rs +++ b/hive-ag3nt/src/web_ui/stats.rs @@ -35,8 +35,11 @@ pub(super) async fn api_stats( /// the `mcp__hyperhive__get_loose_ends` tool sees from inside the /// container. pub(super) async fn api_loose_ends(State(state): State) -> Response { - match super::broker_request(&state.socket, &hive_sh4re::Request::GetLooseEnds { agent: None }) - .await + match super::broker_request( + &state.socket, + &hive_sh4re::Request::GetLooseEnds { agent: None }, + ) + .await { Ok(hive_sh4re::Response::LooseEnds { loose_ends }) => { axum::Json(serde_json::json!({ "loose_ends": loose_ends })).into_response() diff --git a/hive-claude/src/driver.rs b/hive-claude/src/driver.rs index 76c3d267..b790522f 100644 --- a/hive-claude/src/driver.rs +++ b/hive-claude/src/driver.rs @@ -58,7 +58,10 @@ impl Claude { })?; if let Some(mut stdin) = child.stdin.take() { - stdin.write_all(prompt.as_bytes()).await.map_err(Error::Stdin)?; + stdin + .write_all(prompt.as_bytes()) + .await + .map_err(Error::Stdin)?; // Best-effort flush/close; claude sees EOF and starts the turn. stdin.shutdown().await.ok(); } diff --git a/hive-claude/src/policy.rs b/hive-claude/src/policy.rs index 998b0968..63218078 100644 --- a/hive-claude/src/policy.rs +++ b/hive-claude/src/policy.rs @@ -41,7 +41,11 @@ impl CompactionPolicy for PercentPolicy { if self.percent == 0 { return false; } - let Some(window) = usage.context_window.or(self.default_window).filter(|&w| w > 0) else { + let Some(window) = usage + .context_window + .or(self.default_window) + .filter(|&w| w > 0) + else { return false; }; usage.context_tokens.saturating_mul(100) >= u64::from(self.percent) * window diff --git a/hive-claude/src/session.rs b/hive-claude/src/session.rs index 4fded3b5..074da067 100644 --- a/hive-claude/src/session.rs +++ b/hive-claude/src/session.rs @@ -4,7 +4,9 @@ use std::sync::Mutex; use serde_json::Value; -use crate::{Attach, Claude, CompactionPolicy, Config, Error, Result, SessionStore, Sink, Telemetry}; +use crate::{ + Attach, Claude, CompactionPolicy, Config, Error, Result, SessionStore, Sink, Telemetry, +}; /// A named claude session that outlives the model's context window by /// compacting itself. Bundles the three things a durable session needs: