Skip to content

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

chore: reorder imports and reformat long function calls

Steven Enamakel89ea4c3e6c82
diff --git a/crates/openhuman-core/src/channels/controllers/backend.rs b/crates/openhuman-core/src/channels/controllers/backend.rs
index 898c0b91a6..e5b2f52785 100644
--- a/crates/openhuman-core/src/channels/controllers/backend.rs
+++ b/crates/openhuman-core/src/channels/controllers/backend.rs
@@ -255,13 +255,8 @@ impl ChannelBackend for OpenHumanChannelBackend {
channels_config: &ChannelsConfig,
intent: ChannelOutboundIntent,
) -> anyhow::Result<ChannelSendMessageResult> {
- if tinychannels::relay::relay_runtime_fronts_channel(
- channels_config,
- &intent.channel_id,
- ) {
- if let Some(result) =
- tinychannels::relay::send_outbound_intent(&intent).await?
- {
+ if tinychannels::relay::relay_runtime_fronts_channel(channels_config, &intent.channel_id) {
+ if let Some(result) = tinychannels::relay::send_outbound_intent(&intent).await? {
return Ok(result);
}
}
diff --git a/crates/openhuman-core/src/channels/host/channel_events_tests.rs b/crates/openhuman-core/src/channels/host/channel_events_tests.rs
index 79b46d4614..eaa2ae8276 100644
--- a/crates/openhuman-core/src/channels/host/channel_events_tests.rs
+++ b/crates/openhuman-core/src/channels/host/channel_events_tests.rs
@@ -40,7 +40,12 @@ fn approval_subscriber(channels: &[Arc<RecordingChannel>]) -> ChannelApprovalSur
ChannelApprovalSurfaceSubscriber::new(Arc::new(map))
}
-fn received(channel: &str, reply_target: &str, thread_ts: Option<&str>, ws: &PathBuf) -> DomainEvent {
+fn received(
+ channel: &str,
+ reply_target: &str,
+ thread_ts: Option<&str>,
+ ws: &PathBuf,
+) -> DomainEvent {
DomainEvent::ChannelMessageReceived {
channel: channel.into(),
message_id: "m1".into(),
@@ -95,7 +100,8 @@ async fn approval_prompts_reach_every_chat_channel() {
let sub = approval_subscriber(&[Arc::clone(&ch)]);
assert_eq!(sub.name(), "channels::approval_surface");
assert_eq!(sub.domains(), Some(&["channel", "approval"][..]));
- sub.handle(&received(channel, "chat-1", thread_ts, &ws)).await;
+ sub.handle(&received(channel, "chat-1", thread_ts, &ws))
+ .await;
assert!(sub.surface().reply_context(key).is_some(), "{channel}");
sub.handle(&approval(Some(key), Some(channel))).await;
let sent = ch.sent.lock().unwrap().clone();
@@ -113,12 +119,15 @@ async fn approvals_for_web_email_or_unrouted_requests_are_ignored() {
let discord = recording("discord");
let sub = approval_subscriber(&[Arc::clone(&email), Arc::clone(&discord)]);
sub.handle(&received("email", "[email protected]", None, &ws)).await;
- sub.handle(&approval(Some("[email protected]"), Some("email"))).await;
- sub.handle(&approval(Some("web-thread"), Some("web-client-1"))).await;
+ sub.handle(&approval(Some("[email protected]"), Some("email")))
+ .await;
+ sub.handle(&approval(Some("web-thread"), Some("web-client-1")))
+ .await;
sub.handle(&approval(Some("x"), None)).await;
sub.handle(&approval(None, Some("discord"))).await;
// No recorded context for this conversation → nothing sent.
- sub.handle(&approval(Some("discord_bob_c"), Some("discord"))).await;
+ sub.handle(&approval(Some("discord_bob_c"), Some("discord")))
+ .await;
sub.handle(&DomainEvent::SystemStartup {
component: "test".into(),
})
@@ -154,6 +163,7 @@ async fn turn_state_ignores_non_remote_channels_and_stale_workspaces() {
sub.handle(&received("email", "[email protected]", None, &ws)).await;
assert!(!busy(&ws, "email", "[email protected]"));
let other = tempdir().unwrap().path().to_path_buf();
- sub.handle(&received("telegram", "chat-1", None, &other)).await;
+ sub.handle(&received("telegram", "chat-1", None, &other))
+ .await;
assert!(!busy(&ws, "telegram", "chat-1"));
}
diff --git a/crates/openhuman-core/src/channels/host/remote_control.rs b/crates/openhuman-core/src/channels/host/remote_control.rs
index d7f8823cb4..a8c483f7a0 100644
--- a/crates/openhuman-core/src/channels/host/remote_control.rs
+++ b/crates/openhuman-core/src/channels/host/remote_control.rs
@@ -9,7 +9,9 @@
use async_trait::async_trait;
use tinychannels::remote::{NewRemoteThread, RemoteControlHost, RemoteRoute, RemoteThreadSummary};
-use crate::channels::context::{clear_sender_history, ChannelRouteSelection, ChannelRuntimeContext};
+use crate::channels::context::{
+ clear_sender_history, ChannelRouteSelection, ChannelRuntimeContext,
+};
use crate::memory::conversations::{self as conversations, CreateConversationThread};
/// Remote-control host state for one command, borrowed from the runtime.
diff --git a/crates/openhuman-core/src/channels/providers/mod.rs b/crates/openhuman-core/src/channels/providers/mod.rs
index cfa885c751..297d692b86 100644
--- a/crates/openhuman-core/src/channels/providers/mod.rs
+++ b/crates/openhuman-core/src/channels/providers/mod.rs
@@ -5,9 +5,9 @@
pub use tinychannels::providers::email_channel;
pub use tinychannels::providers::lark;
+#[cfg(feature = "whatsapp-web")]
+pub use tinychannels::providers::whatsapp_web;
pub use tinychannels::providers::{
dingtalk, discord, imessage, irc, linq, mattermost, qq, signal, slack, telegram, whatsapp,
yuanbao,
};
-#[cfg(feature = "whatsapp-web")]
-pub use tinychannels::providers::whatsapp_web;
diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rs
index 03fd5f39b9..fcd83626bf 100644
--- a/crates/openhuman-core/src/channels/routes.rs
+++ b/crates/openhuman-core/src/channels/routes.rs
@@ -7,8 +7,8 @@ use super::traits;
use super::{Channel, ChannelSendExt, SendMessage};
use crate::inference::provider;
use std::sync::Arc;
-use tinychannels::remote::{execute_remote_command, parse_remote_command, RemoteCommand};
use tinychannels::remote::RemoteCommandContext;
+use tinychannels::remote::{execute_remote_command, parse_remote_command, RemoteCommand};
use tinychannels::routes::{
build_models_help_response, build_providers_help_response,
parse_runtime_command as parse_portable_runtime_command,
diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rs
index 0745bced5a..82b4825f8d 100644
--- a/crates/openhuman-core/src/channels/routes_tests.rs
+++ b/crates/openhuman-core/src/channels/routes_tests.rs
@@ -430,9 +430,7 @@ async fn handle_runtime_command_telegram_help_replies_with_remote_command_list()
let sent = channel_impl.sent.lock().unwrap();
assert_eq!(sent.len(), 1);
- assert!(sent[0]
- .content
- .contains("Remote control:"));
+ assert!(sent[0].content.contains("Remote control:"));
assert!(sent[0].content.contains("`/status`"));
assert!(sent[0].content.contains("`/sessions`"));
assert!(sent[0].content.contains("`/new`"));
diff --git a/crates/openhuman-core/src/channels/runtime/mod.rs b/crates/openhuman-core/src/channels/runtime/mod.rs
index ace3eece5b..65177edf7e 100644
--- a/crates/openhuman-core/src/channels/runtime/mod.rs
+++ b/crates/openhuman-core/src/channels/runtime/mod.rs
@@ -5,9 +5,9 @@ pub(crate) mod session;
mod startup;
mod supervision;
-pub(crate) use startup::{hydrate_channel_credentials, RuntimeProxyClients};
pub use startup::start_channels;
pub(crate) use startup::start_channels_with_session;
+pub(crate) use startup::{hydrate_channel_credentials, RuntimeProxyClients};
#[cfg(any(test, debug_assertions))]
pub mod test_support;