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 tests for chat types

Steven Enamakel2d9b461e78f1
diff --git a/crates/openhuman-core/src/web_chat/types_tests.rs b/crates/openhuman-core/src/web_chat/types_tests.rs
new file mode 100644
index 0000000000..139c3330f8
--- /dev/null
+++ b/crates/openhuman-core/src/web_chat/types_tests.rs
@@ -0,0 +1,18 @@
+use super::*;
+
+#[test]
+fn queued_chat_ack_serializes_request_identity_and_sanitized_parts() {
+ let ack = QueuedChatAck {
+ queued: true,
+ queue_mode: "followup".into(),
+ client_id: "client".into(),
+ thread_id: "thread".into(),
+ request_id: "request".into(),
+ queue_depth: 1,
+ queued_attachments: vec![],
+ };
+ let value = serde_json::to_value(ack).unwrap();
+ assert_eq!(value["request_id"], "request");
+ assert_eq!(value["queued_attachments"], serde_json::json!([]));
+ assert!(value.get("requestId").is_none());
+}