The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(channels): add tests for host dispatching thread replies and reactions
Steven Enamakel3f4cbbbc8937
diff --git a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rsindex 1e26307687..d9c4d0c16e 100644--- a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs+++ b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs@@ -137,6 +137,58 @@ async fn dispatch_preserves_supplied_tinychannels_inbound_envelope() {assert_eq!(envelope.sender.name.as_deref(), Some("Alice"));}+#[tokio::test]+async fn host_dispatch_preserves_thread_reply_and_reaction_targets() {+ let threaded = run_dispatch_harness(DispatchHarnessOptions {+ channel_name: "telegram".into(),+ thread_ts: Some("topic-99".into()),+ response_text: Some("thread reply".into()),+ ..Default::default()+ })+ .await;+ assert_eq!(threaded.sends.len(), 1);+ assert_eq!(threaded.sends[0].recipient, "reply");+ assert_eq!(threaded.sends[0].thread_ts.as_deref(), Some("topic-99"));++ let unthreaded = run_dispatch_harness(DispatchHarnessOptions {+ channel_name: "telegram".into(),+ thread_ts: None,+ response_text: Some("plain reply".into()),+ ..Default::default()+ })+ .await;+ assert_eq!(unthreaded.sends.len(), 1);+ assert_eq!(unthreaded.sends[0].thread_ts, None);++ let reaction = run_dispatch_harness(DispatchHarnessOptions {+ channel_name: "telegram".into(),+ thread_ts: Some("message-42".into()),+ supports_reactions: true,+ response_text: Some("[REACTION:👍]".into()),+ ..Default::default()+ })+ .await;+ assert_eq!(reaction.sends.len(), 1, "one reaction is sent");+ assert_eq!(reaction.sends[0].content, "[REACTION:👍]");+ assert_eq!(reaction.sends[0].thread_ts.as_deref(), Some("message-42"));+}++#[tokio::test]+async fn discord_host_pipeline_dispatches_reply_with_thread_context() {+ let observation = run_dispatch_harness(DispatchHarnessOptions {+ channel_name: "discord".into(),+ thread_ts: Some("thread-42".into()),+ response_text: Some("hi from discord".into()),+ ..Default::default()+ })+ .await;++ assert_eq!(observation.sends.len(), 1);+ assert_eq!(observation.sends[0].recipient, "reply");+ assert!(observation.sends[0].content.contains("hi from discord"));+ assert_eq!(observation.sends[0].thread_ts.as_deref(), Some("thread-42"));+}+#[tokio::test]async fn message_dispatch_processes_messages_in_parallel() {// Install a deterministic stub that takes 250ms per turn and records