Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(agent): emit cached model response event on cache hits

Steven Enamakel03b38662c9b8
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
index 2241288203..b446ba5a93 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
@@ -103,6 +103,9 @@ impl SupplementalTrace {
) {
let mut native_usage = response.usage.or(response.message.usage);
if response.served_from_cache {
+ self.events.emit(AgentEvent::ModelResponseCached {
+ call_id: call_id.clone(),
+ });
if let Some(usage) = &mut native_usage {
usage.charged_amount = None;
}