style: apply nix fmt
This commit is contained in:
parent
9a0d525fdf
commit
e1e3bda94a
7 changed files with 22 additions and 10 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue