Skip to content

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

style: format channel route adapter

Steven Enamakele0fc16efd090
diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rs
index 6c36445d76..8be045cd15 100644
--- a/crates/openhuman-core/src/channels/routes.rs
+++ b/crates/openhuman-core/src/channels/routes.rs
@@ -1,7 +1,7 @@
//! Per-sender routing and runtime command handling.
-use super::context::{ChannelRouteSelection, ChannelRuntimeContext, clear_sender_history};
-use super::{Channel, outbound::text_message};
+use super::context::{clear_sender_history, ChannelRouteSelection, ChannelRuntimeContext};
+use super::{outbound::text_message, Channel};
use crate::inference::provider;
use std::sync::Arc;
use tinychannels_bus as traits;
diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rs
index 34b67d8ed5..49d294bfdd 100644
--- a/crates/openhuman-core/src/channels/routes_tests.rs
+++ b/crates/openhuman-core/src/channels/routes_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::channels::context::{
- ChannelRuntimeContext, RouteSelectionMap, TurnModelSourceCacheMap, conversation_history_key,
+ conversation_history_key, ChannelRuntimeContext, RouteSelectionMap, TurnModelSourceCacheMap,
};
use crate::channels::host::ChannelTurnStateSubscriber;
use crate::core::events::DomainEvent;
@@ -452,13 +452,12 @@ async fn handle_runtime_command_set_model_clears_sender_history_and_persists_rou
.await;
assert!(handled);
- assert!(
- ctx.conversation_histories
- .lock()
- .unwrap()
- .get(key)
- .is_none()
- );
+ assert!(ctx
+ .conversation_histories
+ .lock()
+ .unwrap()
+ .get(key)
+ .is_none());
assert_eq!(
get_route_selection(&ctx, key),
ChannelRouteSelection {
@@ -580,9 +579,7 @@ async fn handle_runtime_command_telegram_sessions_reports_empty_store() {
let sent = channel_impl.sent.lock().unwrap();
assert_eq!(sent.len(), 1);
- assert!(
- sent_text(&sent[0]).contains("No conversation threads yet. Send `/new` to create one.")
- );
+ assert!(sent_text(&sent[0]).contains("No conversation threads yet. Send `/new` to create one."));
assert_eq!(sent[0].thread_id.as_deref(), Some("42"));
}
@@ -617,13 +614,12 @@ async fn handle_runtime_command_telegram_new_status_and_sessions_round_trip() {
)
.await
);
- assert!(
- ctx.conversation_histories
- .lock()
- .unwrap()
- .get(sender_key)
- .is_none()
- );
+ assert!(ctx
+ .conversation_histories
+ .lock()
+ .unwrap()
+ .get(sender_key)
+ .is_none());
ctx.conversation_histories
.lock()
@@ -702,10 +698,9 @@ async fn handle_runtime_command_telegram_new_status_and_sessions_round_trip() {
assert!(sent_text(&sent[2]).contains("**Recent sessions**"));
assert!(sent_text(&sent[2]).contains("→ `Telegram"));
- assert!(
- sent.iter()
- .all(|message| message.thread_ts.as_deref() == Some("42"))
- );
+ assert!(sent
+ .iter()
+ .all(|message| message.thread_ts.as_deref() == Some("42")));
}
#[tokio::test]