Skip to content

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

test(web_chat): pass viseme frames to store_synthesized_reply

Steven Enamakelc09b3456ed86
diff --git a/crates/openhuman-core/src/web_chat/reply_persistence_tests.rs b/crates/openhuman-core/src/web_chat/reply_persistence_tests.rs
index 615ec2baba..852b353794 100644
--- a/crates/openhuman-core/src/web_chat/reply_persistence_tests.rs
+++ b/crates/openhuman-core/src/web_chat/reply_persistence_tests.rs
@@ -234,7 +234,7 @@ fn a_spoken_reply_row_points_at_its_stored_audio() {
seed_thread(&ws, "t-voice");
let ctx = crate::core::runtime::DispatchCtx::ambient();
- crate::web_chat::voice_notes::store_synthesized_reply(&ws, "req-v", "YWJj", "audio/mpeg");
+ crate::web_chat::voice_notes::store_synthesized_reply(&ws, "req-v", "YWJj", "audio/mpeg", &[]);
persist_delivered_reply(&ctx, &ws, "t-voice", "req-v", "Hello", &[]).expect("append");
persist_delivered_reply(&ctx, &ws, "t-no-audio", "req-w", "Hi", &[]).ok();
diff --git a/crates/openhuman-core/src/web_chat/voice_notes_tests.rs b/crates/openhuman-core/src/web_chat/voice_notes_tests.rs
index fc757ec3ef..eb9453807f 100644
--- a/crates/openhuman-core/src/web_chat/voice_notes_tests.rs
+++ b/crates/openhuman-core/src/web_chat/voice_notes_tests.rs
@@ -60,7 +60,11 @@ fn synthesized_reply_metadata_preserves_its_viseme_timeline() {
tmp.path(),
"request-1",
"YWJj",
- "audio/mpeg"
+ "audio/mpeg",
+ &[
+ tinyinference_voice::VisemeFrame { viseme: "aa".into(), start_ms: 0, end_ms: 120 },
+ tinyinference_voice::VisemeFrame { viseme: "PP".into(), start_ms: 120, end_ms: 220 },
+ ]
));
let meta = reply_note_metadata(tmp.path(), "request-1").unwrap();
@@ -88,18 +92,20 @@ fn rpc_round_trip_and_bad_base64() {
#[test]
fn synthesized_reply_is_stored_only_with_decodable_audio() {
let tmp = tempfile::tempdir().unwrap();
- assert!(!store_synthesized_reply(tmp.path(), "r1", "", "audio/mpeg"));
+ assert!(!store_synthesized_reply(tmp.path(), "r1", "", "audio/mpeg", &[]));
assert!(!store_synthesized_reply(
tmp.path(),
"r1",
"***",
- "audio/mpeg"
+ "audio/mpeg",
+ &[]
));
assert!(store_synthesized_reply(
tmp.path(),
"r1",
"YWJj",
- "audio/mpeg"
+ "audio/mpeg",
+ &[]
));
assert!(reply_note_metadata(tmp.path(), "r1").is_some());
}