refactor(agent): fire_and_forget helper, drop dead default_model + compact_percent fallback, fix stale comment

This commit is contained in:
müde 2026-07-05 22:43:23 +02:00
commit 77f31b44bb
3 changed files with 27 additions and 34 deletions

View file

@ -92,8 +92,8 @@ pub struct TurnFiles {
}
impl TurnFiles {
/// Write all three files into the per-agent runtime dir alongside
/// `socket`. Idempotent — overwrites whatever was there.
/// Write the two per-turn files (MCP config + system prompt) into the
/// agent's config dir. Idempotent — overwrites whatever was there.
///
/// # Errors
///
@ -238,7 +238,8 @@ fn compact_percent() -> u8 {
}
let pct =
env_u64("HIVE_COMPACT_WATERMARK_PERCENT").unwrap_or(u64::from(DEFAULT_COMPACT_PERCENT));
u8::try_from(pct.min(100)).unwrap_or(DEFAULT_COMPACT_PERCENT)
// `min(100)` is ≤ 100, so this `try_from` is infallible.
u8::try_from(pct.min(100)).expect("value clamped to <= 100 fits in u8")
}
/// The agent's durable session type: the constant-title [`InfiniteSession`]