style: apply nix fmt

This commit is contained in:
müde 2026-07-05 22:24:42 +02:00
commit e1e3bda94a
7 changed files with 22 additions and 10 deletions

View file

@ -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<S: Surface>(
}
},
};
let ctrl =
handle_turn::<S>(socket, &bus, stats.as_ref(), files, &session, next).await;
let ctrl = handle_turn::<S>(socket, &bus, stats.as_ref(), files, &session, next).await;
if ctrl.auth_failed {
*login_state.lock().unwrap() = LoginState::NeedsLogin;
login::wait_for_login(

View file

@ -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

View file

@ -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]

View file

@ -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<AppState>) -> 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()

View file

@ -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();
}

View file

@ -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

View file

@ -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: