Skip to content

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

refactor(channels): update channel bus and test dependencies

Steven Enamakel3f064b5972bf
diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rs
index da1798d008..a8c54f2ed3 100644
--- a/crates/openhuman-core/src/channels/bus/delivery.rs
+++ b/crates/openhuman-core/src/channels/bus/delivery.rs
@@ -2,17 +2,17 @@
use crate::backend::{BackendApiError, BackendClient};
use crate::modules::channel_runtime::ChannelRuntimeLease;
use crate::security::credentials::session_support::{
- get_session_token, is_local_session_token, BackendCredential,
+ BackendCredential, get_session_token, is_local_session_token,
};
-use serde_json::json;
#[cfg(test)]
use serde_json::Value;
+use serde_json::json;
use tinybus::module::ModuleCallError;
use tinychannels_bus::module_progressive::{
ChannelOutputEvent, ProgressiveCommand, ProgressiveEvent, ProgressiveResult,
ProgressiveTransportRequest, ProgressiveTransportResult,
};
-use tinychannels_bus::{methods, ChannelBackendRequest, ChannelBackendResult};
+use tinychannels_bus::{ChannelBackendRequest, ChannelBackendResult, methods};
/// Transport refusals are typed facts; recovery and retry budgets belong to the module.
pub(super) fn map_backend_error(error: anyhow::Error) -> ProgressiveTransportResult {
diff --git a/crates/openhuman-core/src/channels/bus/delivery_tests.rs b/crates/openhuman-core/src/channels/bus/delivery_tests.rs
index 9e8d49c9fa..f50da2e333 100644
--- a/crates/openhuman-core/src/channels/bus/delivery_tests.rs
+++ b/crates/openhuman-core/src/channels/bus/delivery_tests.rs
@@ -16,12 +16,14 @@ async fn transport_captures_no_local_or_missing_hosted_credential() {
let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("temporary workspace");
let _workspace_env = EnvVarGuard::workspace_unlocked(workspace.path());
- assert!(ManagedTransport::capture(
- &crate::config::Config::default(),
- "telegram".into(),
- tokio_util::sync::CancellationToken::new()
- )
- .is_err());
+ assert!(
+ ManagedTransport::capture(
+ &crate::config::Config::default(),
+ "telegram".into(),
+ tokio_util::sync::CancellationToken::new()
+ )
+ .is_err()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/channels/bus_inbound_thread_id_tests_tests.rs b/crates/openhuman-core/src/channels/bus_inbound_thread_id_tests_tests.rs
index f71f9a2de1..bffce5fba7 100644
--- a/crates/openhuman-core/src/channels/bus_inbound_thread_id_tests_tests.rs
+++ b/crates/openhuman-core/src/channels/bus_inbound_thread_id_tests_tests.rs
@@ -15,10 +15,12 @@ fn channel_message_body_adds_deterministic_idempotency_key() {
assert_eq!(left["text"], "hello");
assert_eq!(left["threadId"], "topic-1");
assert_eq!(left["idempotencyKey"], right["idempotencyKey"]);
- assert!(left["idempotencyKey"]
- .as_str()
- .expect("idempotency key")
- .starts_with("legacy-send:telegram:"));
+ assert!(
+ left["idempotencyKey"]
+ .as_str()
+ .expect("idempotency key")
+ .starts_with("legacy-send:telegram:")
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/channels/bus_test_support_tests.rs b/crates/openhuman-core/src/channels/bus_test_support_tests.rs
index 864dce2329..3158173a92 100644
--- a/crates/openhuman-core/src/channels/bus_test_support_tests.rs
+++ b/crates/openhuman-core/src/channels/bus_test_support_tests.rs
@@ -1,9 +1,9 @@
//! Debug-build seams for raw integration coverage of channel inbound helpers.
-use tinychannels_runtime::channel::derive_inbound_thread_id;
use tinychannels::delivery::progressive::{
- extract_message_id, latest_thinking_snippet, StreamingState,
+ StreamingState, extract_message_id, latest_thinking_snippet,
};
+use tinychannels_runtime::channel::derive_inbound_thread_id;
pub fn extract_message_id_for_test(resp: &serde_json::Value) -> Option<String> {
extract_message_id(resp)
diff --git a/crates/openhuman-core/src/channels/providers/relay/params.rs b/crates/openhuman-core/src/channels/providers/relay/params.rs
index b021539ac2..85f854bffe 100644
--- a/crates/openhuman-core/src/channels/providers/relay/params.rs
+++ b/crates/openhuman-core/src/channels/providers/relay/params.rs
@@ -4,9 +4,9 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
+use tinychannels_bus::ChannelMessage;
#[cfg(test)]
use tinychannels_runtime::channel::derive_inbound_thread_id;
-use tinychannels_bus::ChannelMessage;
/// Longest channel name: `telegram`, `imessage`, `discord`, ...
pub const MAX_CHANNEL_LEN: usize = 32;
diff --git a/crates/openhuman-core/src/profiles/surface_tests.rs b/crates/openhuman-core/src/profiles/surface_tests.rs
index 3865829ceb..439a5f977e 100644
--- a/crates/openhuman-core/src/profiles/surface_tests.rs
+++ b/crates/openhuman-core/src/profiles/surface_tests.rs
@@ -142,13 +142,12 @@ fn delete_purge_and_the_channel_relay_are_open_to_users() {
#[test]
fn users_still_cannot_mint_channel_threads() {
// The relay derives `channel:` ids itself; a user choosing one is refused.
- let relayed =
- tinychannels_runtime::channel::derive_inbound_thread_id(
- "telegram",
- Some("1"),
- Some("2"),
- None,
- );
+ let relayed = tinychannels_runtime::channel::derive_inbound_thread_id(
+ "telegram",
+ Some("1"),
+ Some("2"),
+ None,
+ );
assert!(relayed.starts_with("channel:"), "{relayed}");
assert!(validate_user_thread_id(&relayed).is_err());
}