stats: log auto routing per prompt, hx stats routing report

This commit is contained in:
hermes committed 2026-11-10 22:08:55 +00:00
1 parent 478c007271
commit c6c4add124
5 files changed
+87 -1

No files matched your search

+9
View File
@@ -250,6 +250,13 @@ impl Switcher {
self.apply_inner(agent, pick.kind, pick.model.clone(), false, false)?
};
agent.set_effort(effort);
route::log(
agent.session().path(),
&sig,
&pick,
effort,
forced.is_some(),
);
Ok(Some(Routed {
pick: route::Pick { effort, ..pick },
sw,
@@ -528,6 +535,8 @@ mod tests {
("claude-haiku-x", "claude-haiku-x")
);
assert!(made.lock().unwrap().is_empty(), "same provider: no rebuild");
let rep = crate::stats::route_report(a.session().path());
assert!(rep.contains("fast: 1 prompts"), "{rep}");
sw.set_model(&mut a, "claude-sonnet-x").unwrap();
assert!(!sw.is_auto());
assert!(