Skip to content

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

test(web_chat): add presentation tests for web chat rendering

Steven Enamakel9c5fcae28041
diff --git a/crates/openhuman-core/src/web_chat/presentation_tests.rs b/crates/openhuman-core/src/web_chat/presentation_tests.rs
index 575717c4a5..c5227d3f61 100644
--- a/crates/openhuman-core/src/web_chat/presentation_tests.rs
+++ b/crates/openhuman-core/src/web_chat/presentation_tests.rs
@@ -92,6 +92,9 @@ async fn chat_done_carries_timing_when_a_snapshot_is_supplied() {
assert_eq!(payload.total_ms, Some(2000));
// 40 output tokens / (2000ms / 1000) = 20 tokens/sec.
assert_eq!(payload.tokens_per_second, Some(20.0));
+ // The gauge numerator travels beside the spend totals, unsummed.
+ let usage = done.usage.expect("chat_done.usage must be Some");
+ assert_eq!((usage.input_tokens, usage.context_tokens), (100, 60));
}
/// A caller with no timing snapshot in scope (e.g. the flows stream