huskies: merge 1017

This commit is contained in:
dave
2026-05-13 23:55:35 +00:00
parent 29e800da21
commit 52180bc402
8 changed files with 651 additions and 35 deletions
+7 -8
View File
@@ -104,14 +104,13 @@ pub(crate) fn build_status_from_items(
.map(|a| (a.story_id.clone(), a))
.collect();
// Read token usage once for all stories to avoid repeated file I/O.
let cost_by_story: HashMap<String, f64> = crate::agents::token_usage::read_all(project_root)
.unwrap_or_default()
.into_iter()
.fold(HashMap::new(), |mut map, r| {
*map.entry(r.story_id).or_insert(0.0) += r.usage.total_cost_usd;
map
});
// Build a per-story cost map from the in-memory rollup register.
// Only completed stories have entries; in-progress stories show no cost.
let cost_by_story: HashMap<String, f64> =
crate::service::agents::cost_rollup::all_rollups(project_root)
.into_iter()
.map(|r| (r.story_id, r.total_cost_usd))
.collect();
let config = ProjectConfig::load(project_root).ok();