Skip to content

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

style(channels): reorder imports and reformat call sites

Steven Enamakelb886d201c4ad
diff --git a/crates/openhuman-tinyhumans/src/channels/delivery.rs b/crates/openhuman-tinyhumans/src/channels/delivery.rs
index 4572f25430..b381477256 100644
--- a/crates/openhuman-tinyhumans/src/channels/delivery.rs
+++ b/crates/openhuman-tinyhumans/src/channels/delivery.rs
@@ -6,10 +6,10 @@
use openhuman_embed::__host::channel_callback::ChannelCallbackCtx;
use openhuman_embed::__host::security::credentials::session_support::{
- get_session_token, is_local_session_token, BackendCredential,
+ BackendCredential, get_session_token, is_local_session_token,
};
use reqwest::Method;
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
use tinychannels_bus::module_progressive::{
ProgressiveTransportRequest, ProgressiveTransportResult,
};
@@ -261,15 +261,8 @@ async fn send(
channel_ref,
conversation,
} => {
- let context = transport_context(
- turn_id,
- channel_ref,
- conversation,
- None,
- None,
- None,
- None,
- );
+ let context =
+ transport_context(turn_id, channel_ref, conversation, None, None, None, None);
if context.is_empty() {
client
.send_channel_typing(&channel, credential.clone())
diff --git a/crates/openhuman-tinyhumans/src/channels/messaging.rs b/crates/openhuman-tinyhumans/src/channels/messaging.rs
index dc183f574d..09255a5ac2 100644
--- a/crates/openhuman-tinyhumans/src/channels/messaging.rs
+++ b/crates/openhuman-tinyhumans/src/channels/messaging.rs
@@ -6,14 +6,14 @@
use openhuman_embed::__host::config::Config;
use openhuman_embed::__host::security::credentials::session_support::{
- resolve_backend_credential, BackendCredential,
+ BackendCredential, resolve_backend_credential,
};
use serde_json::Value;
use tinychannels_bus::controllers::{
ChannelReactionResult, ChannelThreadListResult, ChannelThreadResult,
};
-use crate::client::{flatten_authed_error, BackendClient};
+use crate::client::{BackendClient, flatten_authed_error};
/// A result type that keeps the backend payload when its shape is unknown.
pub(super) trait RawFallback {
diff --git a/crates/openhuman-tinyhumans/src/channels/mod.rs b/crates/openhuman-tinyhumans/src/channels/mod.rs
index 3d53e9076a..be1770eae7 100644
--- a/crates/openhuman-tinyhumans/src/channels/mod.rs
+++ b/crates/openhuman-tinyhumans/src/channels/mod.rs
@@ -19,7 +19,7 @@ mod messaging;
#[cfg(feature = "channels")]
use openhuman_embed::__host::channel_callback::{
- register_channel_callback, CallbackFuture, ChannelCallbackCtx,
+ CallbackFuture, ChannelCallbackCtx, register_channel_callback,
};
#[cfg(feature = "channels")]
use tinychannels_bus::{ChannelBackendRequest, ChannelBackendResult};
diff --git a/crates/openhuman-tinyhumans/src/channels/mod_tests.rs b/crates/openhuman-tinyhumans/src/channels/mod_tests.rs
index 2ce211c02a..510a7dbb4d 100644
--- a/crates/openhuman-tinyhumans/src/channels/mod_tests.rs
+++ b/crates/openhuman-tinyhumans/src/channels/mod_tests.rs
@@ -22,9 +22,12 @@ fn ctx(
}
fn typing(channel: &str) -> ChannelBackendRequest {
- ChannelBackendRequest::ProgressiveTransport(ProgressiveTransportRequest::Typing {
+ ChannelBackendRequest::ProgressiveTransport(Box::new(ProgressiveTransportRequest::Typing {
channel: channel.to_string(),
- })
+ turn_id: None,
+ channel_ref: None,
+ conversation: None,
+ }))
}
// Route absence and message absence need different recoveries in the
@@ -133,24 +136,22 @@ async fn progressive_send_forwards_turn_and_delivery_context() {
let config = test_support::signed_in(&tmp, &server.uri());
let answer = serve(
ctx(config, Some("telegram")),
- ChannelBackendRequest::ProgressiveTransport(Box::new(
- ProgressiveTransportRequest::Send {
- channel: "telegram".into(),
- turn_id: Some("turn-7".into()),
- channel_ref: Some(tinychannels_bus::ChannelRef {
- id: "telegram".into(),
- account_id: Some("account-2".into()),
- }),
- conversation: Some(tinychannels_bus::ConversationRef {
- kind: tinychannels_bus::ConversationKind::Dm,
- id: "chat-3".into(),
- ..Default::default()
- }),
- sequence: Some(4),
- idempotency_key: Some("turn-7:reply".into()),
- message: json!({"text": "hello"}),
- },
- )),
+ ChannelBackendRequest::ProgressiveTransport(Box::new(ProgressiveTransportRequest::Send {
+ channel: "telegram".into(),
+ turn_id: Some("turn-7".into()),
+ channel_ref: Some(tinychannels_bus::ChannelRef {
+ id: "telegram".into(),
+ account_id: Some("account-2".into()),
+ }),
+ conversation: Some(tinychannels_bus::ConversationRef {
+ kind: tinychannels_bus::ConversationKind::Dm,
+ id: "chat-3".into(),
+ ..Default::default()
+ }),
+ sequence: Some(4),
+ idempotency_key: Some("turn-7:reply".into()),
+ message: json!({"text": "hello"}),
+ })),
)
.await
.unwrap();