Skip to content

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

fix(channels): drop unnecessary mut on web channel event receiver

Steven Enamakel56e0ebedf9a5
diff --git a/crates/openhuman-core/src/channels/bus/subscriber.rs b/crates/openhuman-core/src/channels/bus/subscriber.rs
index 8d29b7b5ed..4023892b36 100644
--- a/crates/openhuman-core/src/channels/bus/subscriber.rs
+++ b/crates/openhuman-core/src/channels/bus/subscriber.rs
@@ -94,7 +94,7 @@ impl EventHandler<DomainEvent> for ChannelInboundSubscriber {
let thread_id = identity.thread_id;
let client_id = identity.client_id;
- let mut event_rx = crate::web_chat::subscribe_web_channel_events();
+ let event_rx = crate::web_chat::subscribe_web_channel_events();
let reply =
match ModuleProgressiveReply::open(config, channel.clone(), session.clone()).await {
Ok(reply) => reply,
diff --git a/crates/openhuman-core/src/channels/bus/subscriber_tests.rs b/crates/openhuman-core/src/channels/bus/subscriber_tests.rs
index ca6102f981..25d2e28ee5 100644
--- a/crates/openhuman-core/src/channels/bus/subscriber_tests.rs
+++ b/crates/openhuman-core/src/channels/bus/subscriber_tests.rs
@@ -89,10 +89,13 @@ async fn backend_channel_wait_does_not_cut_off_a_live_turn_after_180_seconds() {
tokio::join!(producer, consumer);
crate::web_chat::set_test_run_chat_task_block(None).await;
- assert_eq!(
- *sink.progress.lock().unwrap(),
- vec![ProgressiveEvent::TextDelta("still working".into())]
- );
+ let progress = sink.progress.lock().unwrap();
+ assert_eq!(progress.len(), 1);
+ assert!(matches!(
+ progress.first(),
+ Some(ProgressiveEvent::TextDelta(text)) if text == "still working"
+ ));
+ drop(progress);
assert_eq!(
*sink.finalized.lock().unwrap(),
vec!["parked reply".to_string()],