Skip to content

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

style: apply rustfmt import ordering and assertion formatting

Steven Enamakel536885fbbbc5
diff --git a/crates/openhuman-core/src/channels/host/remote_control.rs b/crates/openhuman-core/src/channels/host/remote_control.rs
index 5d54630579..a81543a393 100644
--- a/crates/openhuman-core/src/channels/host/remote_control.rs
+++ b/crates/openhuman-core/src/channels/host/remote_control.rs
@@ -1,6 +1,6 @@
//! Captured host conversation and session state supplied to the channel module.
-use crate::channels::context::{ChannelRuntimeContext, clear_sender_history};
+use crate::channels::context::{clear_sender_history, ChannelRuntimeContext};
use crate::threads::store::{self as conversations, CreateConversationThread};
/// Serves product-owned conversation state to the captured module runtime.
diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rs
index 703a8c268d..f7fd070e82 100644
--- a/crates/openhuman-core/src/channels/routes.rs
+++ b/crates/openhuman-core/src/channels/routes.rs
@@ -1,17 +1,17 @@
//! Per-sender routing and runtime command handling.
-use super::context::{ChannelRouteSelection, ChannelRuntimeContext, clear_sender_history};
+use super::context::{clear_sender_history, ChannelRouteSelection, ChannelRuntimeContext};
use super::traits;
use super::{Channel, ChannelSendExt, SendMessage};
use crate::inference::provider;
use std::sync::Arc;
#[cfg(test)]
-use tinychannels::remote::{RemoteCommand, parse_remote_command};
+use tinychannels::remote::{parse_remote_command, RemoteCommand};
#[cfg(test)]
use tinychannels::routes::{
- ChannelRuntimeCommand as PortableCommand,
parse_runtime_command as parse_portable_runtime_command,
resolve_provider_alias as resolve_portable_provider_alias,
+ ChannelRuntimeCommand as PortableCommand,
};
use tinychannels_bus::module_control::{
ChannelControlRequest, ChannelControlResult, ProviderDescriptor,
diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rs
index 73a031a1f0..982371b87f 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::channels::traits::ChannelMessage;
@@ -322,11 +322,9 @@ async fn handle_runtime_command_unknown_provider_sends_helpful_error() {
let sent = channel_impl.sent.lock().unwrap();
assert_eq!(sent.len(), 1);
- assert!(
- sent[0]
- .content
- .contains("Unknown provider `definitely-not-a-provider`")
- );
+ assert!(sent[0]
+ .content
+ .contains("Unknown provider `definitely-not-a-provider`"));
assert_eq!(sent[0].thread_ts.as_deref(), Some("thread-1"));
}
@@ -360,13 +358,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 {
@@ -461,11 +458,9 @@ async fn handle_runtime_command_telegram_help_replies_with_remote_command_list()
assert!(sent[0].content.contains("`/status`"));
assert!(sent[0].content.contains("`/sessions`"));
assert!(sent[0].content.contains("`/new`"));
- assert!(
- sent[0]
- .content
- .contains("Model routing: `/model`, `/models`")
- );
+ assert!(sent[0]
+ .content
+ .contains("Model routing: `/model`, `/models`"));
}
#[tokio::test]
@@ -496,11 +491,9 @@ async fn handle_runtime_command_telegram_sessions_reports_empty_store() {
let sent = channel_impl.sent.lock().unwrap();
assert_eq!(sent.len(), 1);
- assert!(
- sent[0]
- .content
- .contains("No conversation threads yet. Send `/new` to create one.")
- );
+ assert!(sent[0]
+ .content
+ .contains("No conversation threads yet. Send `/new` to create one."));
assert_eq!(sent[0].thread_ts.as_deref(), Some("42"));
}
@@ -536,13 +529,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().unwrap().insert(
sender_key.to_string(),
@@ -614,11 +606,9 @@ async fn handle_runtime_command_telegram_new_status_and_sessions_round_trip() {
let sent = channel_impl.sent.lock().unwrap();
assert_eq!(sent.len(), 3);
assert!(sent[0].content.contains("Started new session"));
- assert!(
- sent[0]
- .content
- .contains("In-memory channel history cleared for this chat.")
- );
+ assert!(sent[0]
+ .content
+ .contains("In-memory channel history cleared for this chat."));
assert!(sent[1].content.contains("**Status**"));
assert!(sent[1].content.contains("Thread: `Telegram"));
@@ -629,8 +619,7 @@ async fn handle_runtime_command_telegram_new_status_and_sessions_round_trip() {
assert!(sent[2].content.contains("**Recent sessions**"));
assert!(sent[2].content.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")));
}