swap hive-claude to the crates.io registry dependency (#2931)
This commit is contained in:
parent
435ef193e1
commit
42fdd98a7a
4 changed files with 26 additions and 21 deletions
|
|
@ -572,7 +572,7 @@ fn claude_config(bus: &Bus, files: &TurnFiles) -> Config {
|
|||
state_dir.is_dir().then_some(state_dir)
|
||||
};
|
||||
Config {
|
||||
model: bus.model(),
|
||||
model: Some(bus.model()),
|
||||
effort: Some(bus.effort()),
|
||||
cwd,
|
||||
system_prompt_file: Some(files.system_prompt.clone()),
|
||||
|
|
|
|||
|
|
@ -299,18 +299,22 @@ impl TurnStats {
|
|||
let g = |i: usize| -> rusqlite::Result<u64> {
|
||||
Ok(u64::try_from(row.get::<_, i64>(i)?).unwrap_or(0))
|
||||
};
|
||||
let cost = hive_claude::TokenUsage {
|
||||
input_tokens: g(0)?,
|
||||
output_tokens: g(1)?,
|
||||
cache_read_input_tokens: g(2)?,
|
||||
cache_creation_input_tokens: g(3)?,
|
||||
};
|
||||
let last = hive_claude::TokenUsage {
|
||||
input_tokens: g(4)?,
|
||||
output_tokens: g(5)?,
|
||||
cache_read_input_tokens: g(6)?,
|
||||
cache_creation_input_tokens: g(7)?,
|
||||
};
|
||||
// `TokenUsage` is `#[non_exhaustive]` (hive-claude 0.1.0+) —
|
||||
// struct-expression construction is blocked for downstream
|
||||
// crates entirely, even with a `..base` (functional update
|
||||
// doesn't carve out an exception, per the non_exhaustive
|
||||
// reference semantics). Build off `Default` and assign the
|
||||
// (all-`pub`) fields instead.
|
||||
let mut cost = hive_claude::TokenUsage::default();
|
||||
cost.input_tokens = g(0)?;
|
||||
cost.output_tokens = g(1)?;
|
||||
cost.cache_read_input_tokens = g(2)?;
|
||||
cost.cache_creation_input_tokens = g(3)?;
|
||||
let mut last = hive_claude::TokenUsage::default();
|
||||
last.input_tokens = g(4)?;
|
||||
last.output_tokens = g(5)?;
|
||||
last.cache_read_input_tokens = g(6)?;
|
||||
last.cache_creation_input_tokens = g(7)?;
|
||||
let ctx = if last == hive_claude::TokenUsage::default() {
|
||||
None
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue