Skip to content

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

test(presentation): add test for test support utilities

Steven Enamakelb493c863988d
diff --git a/crates/openhuman-core/src/web_chat/presentation_test_support_tests.rs b/crates/openhuman-core/src/web_chat/presentation_test_support_tests.rs
index 13d4b32725..7dce3d3e80 100644
--- a/crates/openhuman-core/src/web_chat/presentation_test_support_tests.rs
+++ b/crates/openhuman-core/src/web_chat/presentation_test_support_tests.rs
@@ -32,6 +32,33 @@ pub async fn deliver_response_for_test(
.await;
}
+/// `deliver_response` with an explicit `timing` snapshot and usage, so a
+/// test can assert `chat_done.timing` (and its `tokens_per_second`
+/// derivation) reaches the wire event.
+pub async fn deliver_response_with_timing_for_test(
+ client_id: &str,
+ thread_id: &str,
+ request_id: &str,
+ full_response: &str,
+ user_message: &str,
+ usage: Option<&super::LastTurnUsage>,
+ timing: Option<super::super::turn_timing::TurnTimingSnapshot>,
+) {
+ super::deliver_response(
+ client_id,
+ thread_id,
+ request_id,
+ full_response,
+ user_message,
+ &[],
+ usage,
+ None,
+ timing,
+ false,
+ )
+ .await;
+}
+
/// `deliver_response` with an explicit workspace, so a test can assert the
/// reply reached disk before the turn was announced (#6034).
pub async fn deliver_response_in_workspace_for_test(