The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore(channels): apply rustfmt import ordering
Steven Enamakel908b6d8d75bd
diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rsindex a8c54f2ed3..da1798d008 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::{- BackendCredential, get_session_token, is_local_session_token,+ get_session_token, is_local_session_token, BackendCredential,};+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::{ChannelBackendRequest, ChannelBackendResult, methods};+use tinychannels_bus::{methods, ChannelBackendRequest, ChannelBackendResult};/// 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.rsindex f50da2e333..9e8d49c9fa 100644--- a/crates/openhuman-core/src/channels/bus/delivery_tests.rs+++ b/crates/openhuman-core/src/channels/bus/delivery_tests.rs@@ -16,14 +16,12 @@ 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.rsindex bffce5fba7..f71f9a2de1 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,12 +15,10 @@ 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/context_tests.rs b/crates/openhuman-core/src/channels/context_tests.rsindex 6753bcd625..efc293cb22 100644--- a/crates/openhuman-core/src/channels/context_tests.rs+++ b/crates/openhuman-core/src/channels/context_tests.rs@@ -90,11 +90,12 @@ fn timeout_and_history_keys_respect_channel_rules() {#[tokio::test]async fn overflow_detection_covers_edge_cases() {let ctx = runtime_context();- assert!(- is_context_window_overflow_error(&ctx, &anyhow::anyhow!("Maximum context length exceeded"))- .await- .unwrap()- );+ assert!(is_context_window_overflow_error(+ &ctx,+ &anyhow::anyhow!("Maximum context length exceeded")+ )+ .await+ .unwrap());assert!(!is_context_window_overflow_error(&ctx, &anyhow::anyhow!("network timeout")).awaitdiff --git a/crates/openhuman-core/src/channels/contract_schema.rs b/crates/openhuman-core/src/channels/contract_schema.rsindex b9491f04b2..4371baee33 100644--- a/crates/openhuman-core/src/channels/contract_schema.rs+++ b/crates/openhuman-core/src/channels/contract_schema.rs@@ -7,8 +7,8 @@//! schemas the contract defines.use tinychannels_bus::controllers::{- ChannelControllerField, ChannelControllerFieldType, ChannelControllerSchema,- channel_controller_schema,+ channel_controller_schema, ChannelControllerField, ChannelControllerFieldType,+ ChannelControllerSchema,};use crate::core::{ControllerSchema, FieldSchema, TypeSchema};diff --git a/crates/openhuman-core/src/channels/controllers/backend.rs b/crates/openhuman-core/src/channels/controllers/backend.rsindex c99239ca29..004644c6e9 100644--- a/crates/openhuman-core/src/channels/controllers/backend.rs+++ b/crates/openhuman-core/src/channels/controllers/backend.rs@@ -1,19 +1,19 @@//! TinyChannels backend implementation for OpenHuman controller operations.-use serde_json::Value;#[cfg(test)]use serde_json::json;+use serde_json::Value;use crate::config::{ChannelsConfig, Config};use crate::core::Outcome;use super::ops;-#[cfg(test)]-use tinychannels_bus::SendMessage;use tinychannels_bus::controllers::{ChannelAuthMode, ChannelDisconnectResult, ChannelReactionResult, ChannelSendMessageResult,ChannelStatusEntry, ChannelThreadListResult, ChannelThreadResult,};+#[cfg(test)]+use tinychannels_bus::SendMessage;/// OpenHuman-owned implementation of the TinyChannels backend contract.#[derive(Debug, Clone)]diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rsindex b9edd23f90..d1c223a575 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs@@ -1,7 +1,7 @@//! Disconnecting a channel: removing stored credentials and clearing its//! runtime config, optionally along with its memory chunks.-use serde_json::{Value, json};+use serde_json::{json, Value};use crate::config::Config;use crate::core::Outcome;@@ -9,7 +9,7 @@ use crate::security::credentials;use super::memory::clear_channel_memory;use super::shared::credential_provider;-use tinychannels_bus::controllers::{ChannelAuthMode, find_channel_definition};+use tinychannels_bus::controllers::{find_channel_definition, ChannelAuthMode};/// Disconnect a channel by removing stored credentials.pub async fn disconnect_channel(diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/status.rsindex ba70d0fe33..9b32b27be5 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs@@ -1,7 +1,7 @@//! Channel connection status, the default proactive-delivery channel, and//! the merged set of currently-connected channel slugs.-use serde_json::{Value, json};+use serde_json::{json, Value};use crate::config::Config;use crate::core::Outcome;diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rsindex 281f236073..86b970a0aa 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs@@ -1,7 +1,7 @@//! Testing credentials through the module without persisting host configuration.use serde_json::Value;-use tinychannels_bus::{ChannelControllerRequest, ChannelControllerResult, methods};+use tinychannels_bus::{methods, ChannelControllerRequest, ChannelControllerResult};use crate::config::Config;use crate::core::Outcome;diff --git a/crates/openhuman-core/src/channels/controllers/ops/discord.rs b/crates/openhuman-core/src/channels/controllers/ops/discord.rsindex 957012c7ce..7709d54c4f 100644--- a/crates/openhuman-core/src/channels/controllers/ops/discord.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/discord.rs@@ -8,8 +8,8 @@ use crate::core::Outcome;use crate::modules::channel_controller::{self, DiscordReply};use crate::security::credentials;use tinychannels_bus::{- ChannelControllerRequest,controllers::{BotPermissionCheck, DiscordGuild, DiscordTextChannel},+ ChannelControllerRequest,};use super::connect::shared::credential_provider;diff --git a/crates/openhuman-core/src/channels/controllers/ops_connect_status_tests.rs b/crates/openhuman-core/src/channels/controllers/ops_connect_status_tests.rsindex a603f1f955..253f5dec47 100644--- a/crates/openhuman-core/src/channels/controllers/ops_connect_status_tests.rs+++ b/crates/openhuman-core/src/channels/controllers/ops_connect_status_tests.rs@@ -462,12 +462,10 @@ async fn set_default_channel_rejects_unknown_and_empty() {.await.expect("seed discord");- assert!(- set_default_channel(&mut config, "myspace")- .await- .unwrap_err()- .contains("unknown channel"),- );+ assert!(set_default_channel(&mut config, "myspace")+ .await+ .unwrap_err()+ .contains("unknown channel"),);assert!(set_default_channel(&mut config, " ").await.is_err());// A rejected set must not clobber the previously persisted value.diff --git a/crates/openhuman-core/src/channels/controllers/schemas.rs b/crates/openhuman-core/src/channels/controllers/schemas.rsindex 3c680e2213..04c95b5bc9 100644--- a/crates/openhuman-core/src/channels/controllers/schemas.rs+++ b/crates/openhuman-core/src/channels/controllers/schemas.rs@@ -1,28 +1,27 @@//! RPC controller schemas and handlers for the channels domain.use crate::core::runtime::DispatchCtx;-use serde::Deserialize;use serde::de::DeserializeOwned;+use serde::Deserialize;use serde_json::{Map, Value};use crate::config::Config;+use crate::core::all::{ControllerFuture, RegisteredController};use crate::core::ControllerSchema;use crate::core::Outcome;-use crate::core::all::{ControllerFuture, RegisteredController};use super::backend::OpenHumanChannelBackend;use crate::channels::contract_schema::from_channel_controller_schema;use crate::security::credentials::channel_credential_provider;use tinychannels_bus::controllers::{- ChannelAuthMode, ChannelConnectRequest as ConnectParams,- ChannelCreateThreadRequest as CreateThreadParams, ChannelDescribeRequest as DescribeParams,- ChannelDisconnectRequest as DisconnectParams, ChannelListThreadsRequest as ListThreadsParams,- ChannelSendMessageRequest as SendMessageParams,+ all_channel_controller_schemas, channel_controller_schema, ChannelAuthMode,+ ChannelConnectRequest as ConnectParams, ChannelCreateThreadRequest as CreateThreadParams,+ ChannelDescribeRequest as DescribeParams, ChannelDisconnectRequest as DisconnectParams,+ ChannelListThreadsRequest as ListThreadsParams, ChannelSendMessageRequest as SendMessageParams,ChannelSendReactionRequest as SendReactionParams, ChannelStatusRequest as StatusParams,ChannelTestRequest as TestParams, ChannelUpdateThreadRequest as UpdateThreadParams,DiscordCheckPermissionsRequest as DiscordCheckPermissionsParams,- DiscordListChannelsRequest as DiscordListChannelsParams, all_channel_controller_schemas,- channel_controller_schema,+ DiscordListChannelsRequest as DiscordListChannelsParams,};// ---------------------------------------------------------------------------diff --git a/crates/openhuman-core/src/channels/host/channel_events.rs b/crates/openhuman-core/src/channels/host/channel_events.rsindex d8c31ab173..d007da6036 100644--- a/crates/openhuman-core/src/channels/host/channel_events.rs+++ b/crates/openhuman-core/src/channels/host/channel_events.rs@@ -1,17 +1,17 @@//! Host-owned approval routing and turn events over the channel module.-use crate::channels::SendMessage;use crate::channels::capabilities::capabilities_for;use crate::channels::runtime::ChannelHandle;+use crate::channels::SendMessage;#[cfg(test)]-use crate::channels::{Channel, ChannelSendExt};+use crate::channels::ChannelSendExt;use crate::core::events::DomainEvent;use async_trait::async_trait;use std::collections::HashMap;use std::path::PathBuf;use std::sync::{Arc, Mutex};-use tinybus::EventHandler;use tinybus::module::ModuleClient;-use tinychannels_bus::{ChannelMessage, approvals::ReplyContext};+use tinybus::EventHandler;+use tinychannels_bus::{approvals::ReplyContext, ChannelMessage};/// Captures the account configuration and reply addresses used by approvals.pub struct ChannelApprovalSurfaceSubscriber {diff --git a/crates/openhuman-core/src/channels/host/host_tests.rs b/crates/openhuman-core/src/channels/host/host_tests.rsindex 8326a3f798..573c832522 100644--- a/crates/openhuman-core/src/channels/host/host_tests.rs+++ b/crates/openhuman-core/src/channels/host/host_tests.rs@@ -193,12 +193,10 @@ async fn typed_channel_projection_uses_scoped_persisted_row_bindings_after_resta},};- assert!(- super::adapters::project_channel_event(&bob, event.clone())- .await- .unwrap()- .is_none()- );+ assert!(super::adapters::project_channel_event(&bob, event.clone())+ .await+ .unwrap()+ .is_none());let bob_messages = crate::threads::store::blocking::get_messages(bob.clone(),workspace.clone(),@@ -210,12 +208,10 @@ async fn typed_channel_projection_uses_scoped_persisted_row_bindings_after_restabob_messages[0].extra_metadata["voiceNote"]["opaqueId"],"bob-voice");- assert!(- bob_messages[0]- .extra_metadata- .get("channelActivity")- .is_none()- );+ assert!(bob_messages[0]+ .extra_metadata+ .get("channelActivity")+ .is_none());let projected = super::adapters::project_channel_event(&alice, event.clone()).await@@ -247,12 +243,10 @@ async fn typed_channel_projection_uses_scoped_persisted_row_bindings_after_resta},..event};- assert!(- super::adapters::project_channel_event(&restarted, read)- .await- .unwrap()- .is_some()- );+ assert!(super::adapters::project_channel_event(&restarted, read)+ .await+ .unwrap()+ .is_some());let messages = crate::threads::store::blocking::get_messages(restarted, workspace, thread_id).await.unwrap();@@ -320,8 +314,8 @@ async fn event_sink_rejects_non_object_payload() {#[tokio::test]async fn event_sink_routes_channel_reactions_to_domain_bus() {let sink = OpenHumanEventSink;- assert!(- sink.publish(+ assert!(sink+ .publish("channel","reaction_received",serde_json::json!({@@ -330,10 +324,9 @@ async fn event_sink_routes_channel_reactions_to_domain_bus() {}),).await- .is_ok()- );- assert!(- sink.publish(+ .is_ok());+ assert!(sink+ .publish("channel","reaction_sent",serde_json::json!({@@ -342,19 +335,16 @@ async fn event_sink_routes_channel_reactions_to_domain_bus() {}),).await- .is_ok()- );+ .is_ok());// Unknown domain/kind is a benign no-op.- assert!(- sink.publish("mystery", "x", serde_json::json!({}))- .await- .is_ok()- );- assert!(- sink.publish("channel", "unknown", serde_json::json!({}))- .await- .is_ok()- );+ assert!(sink+ .publish("mystery", "x", serde_json::json!({}))+ .await+ .is_ok());+ assert!(sink+ .publish("channel", "unknown", serde_json::json!({}))+ .await+ .is_ok());}// --- ConversationHistoryStore --------------------------------------------diff --git a/crates/openhuman-core/src/channels/host/mod.rs b/crates/openhuman-core/src/channels/host/mod.rsindex 68fa4633ae..db5f6564d8 100644--- a/crates/openhuman-core/src/channels/host/mod.rs+++ b/crates/openhuman-core/src/channels/host/mod.rs@@ -19,10 +19,10 @@ pub use channel_events::{ChannelApprovalSurfaceSubscriber, ChannelTurnStateSubsc#[cfg(test)]use std::sync::Arc;-#[cfg(test)]-use tinychannels::ChannelHost;#[cfg(test)]use tinychannels::host::ChannelHostBuilder;+#[cfg(test)]+use tinychannels::ChannelHost;#[cfg(test)]use crate::config::Config;diff --git a/crates/openhuman-core/src/channels/host/voice.rs b/crates/openhuman-core/src/channels/host/voice.rsindex fc81ff8120..be4b9ba82a 100644--- a/crates/openhuman-core/src/channels/host/voice.rs+++ b/crates/openhuman-core/src/channels/host/voice.rs@@ -5,8 +5,8 @@//! here logs request ids, sizes and durations; transcripts, reply text and//! audio are never logged.-use crate::config::Config;use crate::config::schema::{ChannelVoiceConfig, VoiceReplyMode};+use crate::config::Config;use parking_lot::Mutex;use std::collections::VecDeque;use std::sync::Arc;diff --git a/crates/openhuman-core/src/channels/module_fixture_tests.rs b/crates/openhuman-core/src/channels/module_fixture_tests.rsindex 6701c57247..dc4ead440f 100644--- a/crates/openhuman-core/src/channels/module_fixture_tests.rs+++ b/crates/openhuman-core/src/channels/module_fixture_tests.rs@@ -8,8 +8,8 @@//! on a process-lifetime runtime, so it outlives the short Tokio runtimes of//! individual tests.-use crate::config::Config;use crate::config::schema::ModuleSourceMode;+use crate::config::Config;use crate::modules::linked::register_linked;use crate::modules::{ops, runtime};use std::sync::Arc;@@ -140,10 +140,10 @@ async fn linked_module_prepares_runtime_limits_over_confidential_bus_call() {#[cfg(feature = "e2e-test-support")]async fn linked_module_prepares_legacy_inbound_facts_over_confidential_bus_call() {let _storage = install_memory_storage();- use tinychannels_bus::ChannelMessage;use tinychannels_bus::module_inbound::{ChannelInboundSource, PrepareChannelInboundRequest, PreparedChannelInbound,};+ use tinychannels_bus::ChannelMessage;let message = ChannelMessage {id: "message-1".into(),diff --git a/crates/openhuman-core/src/channels/proactive.rs b/crates/openhuman-core/src/channels/proactive.rsindex 653bf10d31..4683a96cf3 100644--- a/crates/openhuman-core/src/channels/proactive.rs+++ b/crates/openhuman-core/src/channels/proactive.rs@@ -14,10 +14,10 @@//! - The independent `web_chat::proactive` subscriber always delivers the web//! destination, including when the external channels feature is disabled.-use crate::channels::SendMessage;use crate::channels::runtime::ChannelHandle;+use crate::channels::SendMessage;#[cfg(test)]-use crate::channels::{Channel, ChannelSendExt};+use crate::channels::ChannelSendExt;use crate::core::events::DomainEvent;use async_trait::async_trait;use std::collections::HashMap;diff --git a/crates/openhuman-core/src/channels/providers/relay/channel.rs b/crates/openhuman-core/src/channels/providers/relay/channel.rsindex c2b3063cc7..e20e5a439e 100644--- a/crates/openhuman-core/src/channels/providers/relay/channel.rs+++ b/crates/openhuman-core/src/channels/providers/relay/channel.rs@@ -9,12 +9,12 @@ use std::sync::Mutex;use serde_json::json;-use crate::web_chat::{WebChannelEvent, publish_web_channel_event, publish_web_channel_event_in};-#[cfg(test)]-use async_trait::async_trait;+use crate::web_chat::{publish_web_channel_event, publish_web_channel_event_in, WebChannelEvent};+use tinychannels_bus::SendMessage;#[cfg(test)]use tinychannels_bus::ChannelMessage;-use tinychannels_bus::SendMessage;+#[cfg(test)]+use async_trait::async_trait;#[cfg(test)]use tinychannels_runtime::Channel;diff --git a/crates/openhuman-core/src/channels/providers/relay/mod.rs b/crates/openhuman-core/src/channels/providers/relay/mod.rsindex eaa715c9b6..0c408159d4 100644--- a/crates/openhuman-core/src/channels/providers/relay/mod.rs+++ b/crates/openhuman-core/src/channels/providers/relay/mod.rs@@ -27,11 +27,11 @@ pub(crate) mod progressive;mod schemas;mod store;-pub use channel::{CHANNEL_OUTBOUND_EVENT, RelayChannel};-pub(crate) use ops::LegacyHistoryImport;+pub use channel::{RelayChannel, CHANNEL_OUTBOUND_EVENT};pub use ops::channel_relay_inbound;+pub(crate) use ops::LegacyHistoryImport;pub use params::{- DEFAULT_RELAY_CLIENT_ID, MAX_CHANNEL_LEN, MAX_ID_LEN, MAX_SENDER_NAME_CHARS, MAX_TEXT_BYTES,- RESERVED_CHANNELS, RelayInboundParams, validate_channel, validate_id,+ validate_channel, validate_id, RelayInboundParams, DEFAULT_RELAY_CLIENT_ID, MAX_CHANNEL_LEN,+ MAX_ID_LEN, MAX_SENDER_NAME_CHARS, MAX_TEXT_BYTES, RESERVED_CHANNELS,};pub use schemas::{all_relay_controller_schemas, all_relay_registered_controllers};diff --git a/crates/openhuman-core/src/channels/providers/relay/ops.rs b/crates/openhuman-core/src/channels/providers/relay/ops.rsindex fe5b43b527..907b7323d6 100644--- a/crates/openhuman-core/src/channels/providers/relay/ops.rs+++ b/crates/openhuman-core/src/channels/providers/relay/ops.rs@@ -4,15 +4,15 @@ use std::collections::HashMap;use std::path::PathBuf;use std::sync::Arc;-use serde_json::{Value, json};+use serde_json::{json, Value};use super::channel::RelayChannel;use super::params::RelayInboundParams;use super::store::{self, Recorded};use crate::channels::context::MAX_CHANNEL_HISTORY;use crate::channels::runtime::{- PromptToolDescs, build_channel_turn_parts, prepare_runtime_limits,- process_channel_runtime_message, runtime_context,+ build_channel_turn_parts, prepare_runtime_limits, process_channel_runtime_message,+ runtime_context, PromptToolDescs,};use crate::config::Config;use crate::core::Outcome;@@ -239,14 +239,14 @@ pub(crate) async fn run_relay_turn(#[cfg(test)]channels_by_name.insert(params.channel.clone(), channel.clone());#[cfg(not(test))]- let mut channels_by_name: HashMap<String, Arc<crate::channels::runtime::ChannelHandle>> =- HashMap::new();+ let mut channels_by_name: HashMap<+ String,+ Arc<crate::channels::runtime::ChannelHandle>,+ > = HashMap::new();#[cfg(not(test))]channels_by_name.insert(params.channel.clone(),- Arc::new(crate::channels::runtime::ChannelHandle::Relay(- channel.clone(),- )),+ Arc::new(crate::channels::runtime::ChannelHandle::Relay(channel.clone())),);let mut runtime = runtime_context(&dispatch_ctx,diff --git a/crates/openhuman-core/src/channels/providers/relay/ops_tests.rs b/crates/openhuman-core/src/channels/providers/relay/ops_tests.rsindex be727ffd1c..c93bd4a10d 100644--- a/crates/openhuman-core/src/channels/providers/relay/ops_tests.rs+++ b/crates/openhuman-core/src/channels/providers/relay/ops_tests.rs@@ -1,6 +1,6 @@use super::super::channel::CHANNEL_OUTBOUND_EVENT;use super::*;-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};+use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};use crate::agent::turn_origin::AgentTurnOrigin;use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};use std::sync::Mutex;@@ -212,16 +212,12 @@ async fn a_relayed_turn_runs_as_an_external_channel_and_keeps_its_thread() {}}assert_eq!(outbound.len(), 2, "one channel_outbound per reply");- assert!(- outbound- .iter()- .all(|event| event.event_name() == CHANNEL_OUTBOUND_EVENT)- );- assert!(- outbound- .iter()- .all(|event| event.context().thread_id == thread)- );+ assert!(outbound+ .iter()+ .all(|event| event.event_name() == CHANNEL_OUTBOUND_EVENT));+ assert!(outbound+ .iter()+ .all(|event| event.context().thread_id == thread));assert_eq!(outbound[0].context().request_id, "req-m1");assert!(matches!(outbound[0].wire_event(),diff --git a/crates/openhuman-core/src/channels/providers/relay/progressive.rs b/crates/openhuman-core/src/channels/providers/relay/progressive.rsindex 482282130e..57cf5308ec 100644--- a/crates/openhuman-core/src/channels/providers/relay/progressive.rs+++ b/crates/openhuman-core/src/channels/providers/relay/progressive.rs@@ -7,8 +7,8 @@ use std::sync::Arc;use tinybus::Error;use tinychannels_bus::{- ChannelBackendRequest, ChannelBackendResult,module_progressive::{ProgressiveTransportRequest, ProgressiveTransportResult},+ ChannelBackendRequest, ChannelBackendResult,};use super::channel::RelayChannel;diff --git a/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs b/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rsindex 3b2e3facb1..555179bc7b 100644--- a/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs+++ b/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs@@ -25,11 +25,9 @@ fn the_controller_is_channel_relay_inbound() {#[test]fn the_controller_is_registered() {- assert!(- crate::core::all::all_registered_controllers()- .iter()- .any(|c| c.rpc_method_name() == "openhuman.channel_relay_inbound")- );+ assert!(crate::core::all::all_registered_controllers()+ .iter()+ .any(|c| c.rpc_method_name() == "openhuman.channel_relay_inbound"));}#[tokio::test]diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rsindex 9e9767d4d5..20c6880549 100644--- a/crates/openhuman-core/src/channels/routes.rs+++ b/crates/openhuman-core/src/channels/routes.rs@@ -1,10 +1,10 @@//! Per-sender routing and runtime command handling.-use super::SendMessage;use super::context::{ChannelRouteSelection, ChannelRuntimeContext};+use super::SendMessage;use super::runtime::ChannelHandle;#[cfg(test)]-use super::{Channel, ChannelSendExt};+use super::ChannelSendExt;use crate::inference::provider;use std::sync::Arc;use tinychannels_bus as traits;diff --git a/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs b/crates/openhuman-core/src/channels/routes_remote_reset_tests.rsindex aa224a13af..b34e21ee74 100644--- a/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs+++ b/crates/openhuman-core/src/channels/routes_remote_reset_tests.rs@@ -239,20 +239,18 @@ async fn remote_clear_resets_only_the_captured_tenant_session() {let mut forged = scope.clone();forged.conversation.id = "other-room".into();- assert!(- crate::channels::host::remote_control::dispatch_callback(- &alice_dispatch,- &alice_runtime,- &alice_tenant,- &cancellation,- Some(&reset),- RemoteHostRequest::ClearHistory {- session_scope: forged,- },- )- .await- .is_err()- );+ assert!(crate::channels::host::remote_control::dispatch_callback(+ &alice_dispatch,+ &alice_runtime,+ &alice_tenant,+ &cancellation,+ Some(&reset),+ RemoteHostRequest::ClearHistory {+ session_scope: forged,+ },+ )+ .await+ .is_err());assert_eq!(session_messages(&alice_core, workspace, &alice_store_agent, &alice_session).len(),2diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rsindex bc4b9c8a9a..45102700fc 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;@@ -339,11 +339,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"));}@@ -533,11 +531,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]@@ -570,11 +566,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"));}@@ -678,11 +672,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"));@@ -693,10 +685,9 @@ 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")));}#[tokio::test]@@ -733,11 +724,9 @@ async fn handle_runtime_command_telegram_new_reports_unavailable_storage() {"{}",sent[0].content);- assert!(- sent[0]- .content- .contains("failed to persist the chat binding")- );+ assert!(sent[0]+ .content+ .contains("failed to persist the chat binding"));assert!(sent[0].content.contains("host storage is unavailable"));assert_eq!(sent[0].thread_ts.as_deref(), Some("42"));}diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rsindex 4f0bc8fab4..27035b81eb 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rs@@ -1,7 +1,7 @@use super::*;use crate::core::runtime::DispatchCtx;use std::sync::Arc;-use tokio::sync::{Notify, oneshot};+use tokio::sync::{oneshot, Notify};struct DeferredTyping {started: Notify,diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rsindex 14dd67593b..ec06d78ff8 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs@@ -3,13 +3,13 @@//! still goes to the orchestrator over the bus.use super::*;-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};+use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};use crate::agent::host_agents::{self, HostAgent, HostAgentResolver};-use crate::channels::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};+use crate::channels::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};use crate::channels::runtime::process_channel_message;use crate::channels::{Channel, SendMessage};use crate::core::runtime::{CoreContext, DomainSet};-use serde_json::{Value, json};+use serde_json::{json, Value};use std::collections::HashMap;use std::sync::atomic::{AtomicUsize, Ordering};use std::sync::{Arc, Mutex};diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rsindex 77dc48c343..615b215c94 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs@@ -20,10 +20,10 @@use std::sync::Arc;use crate::agent::host_agents::HostAgent;-use crate::channels::SendMessage;use crate::channels::context::ChannelRuntimeContext;+use crate::channels::SendMessage;#[cfg(test)]-use crate::channels::{Channel, ChannelSendExt};+use crate::channels::ChannelSendExt;use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;@@ -32,7 +32,7 @@ use tinychannels_bus as traits;pub(crate) mod posture;mod turn;-pub(crate) use turn::{HostChannelTurn, run_host_agent_turn};+pub(crate) use turn::{run_host_agent_turn, HostChannelTurn};/// Resolve the config-owned target selected for an unbound channel into the/// same trusted host-agent carrier used by channel bindings. The effectivediff --git a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture.rs b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture.rsindex 512bb00296..897b06d53f 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture.rs@@ -11,8 +11,8 @@use tinytools::{PermissionLevel, Tool};-use crate::agent::HostTools;use crate::agent::turn_origin::AgentTurnOrigin;+use crate::agent::HostTools;use crate::config::Config;/// The most a host agent may do on a turn from `origin`; `None` leaves thediff --git a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture_tests.rsindex 75b07b6cf6..ee804b5dfe 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/posture_tests.rs@@ -1,8 +1,8 @@use super::*;use crate::agent::HostTurnTools;-use serde_json::{Value, json};-use std::sync::Arc;+use serde_json::{json, Value};use std::sync::atomic::{AtomicUsize, Ordering};+use std::sync::Arc;use tinytools::{ToolCallOptions, ToolResult};fn external() -> AgentTurnOrigin {diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/mod.rs b/crates/openhuman-core/src/channels/runtime/dispatch/mod.rsindex 67edf59b7c..cbb559129d 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/mod.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/mod.rs@@ -17,12 +17,12 @@ mod processor;mod routing;pub(crate) use processor::progressive::{- NativeProgressiveTarget, delivery_succeeded, hosted_relay_target,+ delivery_succeeded, hosted_relay_target, NativeProgressiveTarget,};pub(crate) use processor::{- RuntimeChannelMessage, process_channel_message, process_channel_runtime_message,- reset_durable_channel_session, run_message_dispatch_loop,+ process_channel_message, process_channel_runtime_message, reset_durable_channel_session,+ run_message_dispatch_loop, RuntimeChannelMessage,};// `channel_has_approval_surface` stays pub(crate) on processor; re-export so@@ -38,7 +38,7 @@ use helpers::build_channel_context_block;use helpers::select_acknowledgment_reaction;#[cfg(test)]-use routing::{AgentScoping, build_visible_tool_set};+use routing::{build_visible_tool_set, AgentScoping};#[cfg(any(test, debug_assertions))]use tinychannels_bus as traits;diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs b/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rsindex d9a76bc824..432cb3a3f4 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs@@ -7,13 +7,13 @@ use std::{use async_trait::async_trait;use tinyagents_harness::{- CancellationToken,run_queue::RunQueue,turn_runner::{EventSink, FailureClassification, FailureClassifier, IngressDecision, IngressPolicy,IngressStage, QueueDisposition, ReplyStore, ScopeKey, Summarizer, TerminalEvent, TurnHost,TurnRequest, TurnResult, TurnRunner, TurnRunnerConfig, TurnSession, TurnSignal,},+ CancellationToken,};use tokio::sync::mpsc;diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/native_runner_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/native_runner_tests.rsindex f0025a9ea8..5f38967bb3 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/native_runner_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/native_runner_tests.rs@@ -135,13 +135,11 @@ async fn queued_terminal_delivery_does_not_leave_a_completion_entry() {shared.with("queued-request", |_| {});shared.record_delivery("queued-request", true);- assert!(- shared- .slots- .lock()- .unwrap_or_else(|poisoned| poisoned.into_inner())- .is_empty()- );+ assert!(shared+ .slots+ .lock()+ .unwrap_or_else(|poisoned| poisoned.into_inner())+ .is_empty());}#[tokio::test]@@ -151,13 +149,11 @@ async fn active_terminal_delivery_is_returned_to_its_waiting_caller() {shared.record_delivery("active-request", true);assert_eq!(shared.take_delivery("active-request"), Some(true));- assert!(- shared- .slots- .lock()- .unwrap_or_else(|poisoned| poisoned.into_inner())- .is_empty()- );+ assert!(shared+ .slots+ .lock()+ .unwrap_or_else(|poisoned| poisoned.into_inner())+ .is_empty());}#[tokio::test]diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/bus_turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/bus_turn.rsindex 114c265c62..67770808b1 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/bus_turn.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/bus_turn.rs@@ -1,7 +1,7 @@//! The orchestrator path: an unbound channel's turn goes over the native bus//! to the `agent.run_turn` handler, with the orchestrator's tool scoping.-use crate::agent::bus::{AGENT_RUN_TURN_METHOD, AgentTurnRequest, AgentTurnResponse};+use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, AGENT_RUN_TURN_METHOD};use crate::agent::turn_origin::AgentTurnOrigin;use crate::channels::context::{ChannelRouteSelection, ChannelRuntimeContext};use crate::core::bus::BUS;diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rsindex 07479bda3b..a6c7035bff 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs@@ -1,13 +1,13 @@//! The per-message pipeline: typing indicator, ACK reaction, durable-session//! dispatch through the shared runner, and final reply delivery.-use crate::channels::SendMessage;-use crate::channels::context::{ChannelRuntimeContext, is_context_window_overflow_error};+use crate::channels::context::{is_context_window_overflow_error, ChannelRuntimeContext};#[cfg(test)]use crate::channels::routes::get_or_create_turn_model_source;use crate::channels::routes::{get_route_selection, handle_runtime_command_with_reset};+use crate::channels::SendMessage;#[cfg(test)]-use crate::channels::{Channel, ChannelSendExt};+use crate::channels::ChannelSendExt;use crate::core::bus::BUS;use crate::core::events::DomainEvent;use crate::util::truncate_with_ellipsis;@@ -17,12 +17,12 @@ use tokio_util::sync::CancellationToken;use tokio_util::task::AbortOnDropHandle;use super::super::helpers::{- REPLY_LOG_TRUNCATE_CHARS, build_channel_context_block, log_worker_join_result,- spawn_typing_task,+ build_channel_context_block, log_worker_join_result, spawn_typing_task,+ REPLY_LOG_TRUNCATE_CHARS,};use super::super::host_agent::{self, HostRoute};-use super::RuntimeChannelMessage;use super::approval::{channel_has_approval_surface, try_route_approval_reply};+use super::RuntimeChannelMessage;pub(crate) async fn process_channel_runtime_message(ctx: Arc<ChannelRuntimeContext>,diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs b/crates/openhuman-core/src/channels/runtime/dispatch/routing.rsindex 195095eb90..803fd74a03 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs@@ -10,8 +10,8 @@ use crate::agent::harness::host_definition::{AgentDefinition, AgentDefinitionReguse crate::agent::prompts::ConnectedIntegration;use crate::config::Config;use crate::integrations::composio::{- FetchConnectedIntegrationsStatus, cached_active_integrations,- fetch_connected_integrations_status,+ cached_active_integrations, fetch_connected_integrations_status,+ FetchConnectedIntegrationsStatus,};use crate::tools::orchestrator_tools;use std::collections::HashSet;diff --git a/crates/openhuman-core/src/channels/runtime/mod.rs b/crates/openhuman-core/src/channels/runtime/mod.rsindex 5813ba4c86..0bd7807fe3 100644--- a/crates/openhuman-core/src/channels/runtime/mod.rs+++ b/crates/openhuman-core/src/channels/runtime/mod.rs@@ -6,17 +6,17 @@ mod startup;#[cfg(test)]mod supervision;-pub(crate) use startup::ChannelHandle;pub(crate) use startup::hydrate_channel_credentials;pub(crate) use startup::prepare_runtime_limits;+pub(crate) use startup::ChannelHandle;pub use startup::start_channels;pub(crate) use startup::start_channels_with_session;// The hosted-channel relay (`channels::providers::relay`) runs one message// through the same pipeline, with a context built from the caller's config.#[cfg(test)]pub(crate) use dispatch::process_channel_message;-pub(crate) use dispatch::{RuntimeChannelMessage, process_channel_runtime_message};-pub(crate) use startup::{PromptToolDescs, build_channel_turn_parts, runtime_context};+pub(crate) use dispatch::{process_channel_runtime_message, RuntimeChannelMessage};+pub(crate) use startup::{build_channel_turn_parts, runtime_context, PromptToolDescs};#[cfg(any(test, debug_assertions))]pub mod test_support;diff --git a/crates/openhuman-core/src/channels/runtime/session_tests.rs b/crates/openhuman-core/src/channels/runtime/session_tests.rsindex 3502a55425..6aa6d4da36 100644--- a/crates/openhuman-core/src/channels/runtime/session_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/session_tests.rs@@ -1,7 +1,7 @@use super::*;use crate::core::runtime::DispatchCtx;-use std::sync::Arc;use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};+use std::sync::Arc;#[tokio::test]async fn independent_local_runtime_does_not_need_an_account_session() {diff --git a/crates/openhuman-core/src/channels/runtime/startup.rs b/crates/openhuman-core/src/channels/runtime/startup.rsindex a55373f47a..6175e91acc 100644--- a/crates/openhuman-core/src/channels/runtime/startup.rs+++ b/crates/openhuman-core/src/channels/runtime/startup.rs@@ -14,8 +14,6 @@ mod turn_parts;use anyhow::Result;use tinybus::module::{ModuleCallError, ModuleClient};-#[cfg(all(not(test), debug_assertions))]-use tinychannels_runtime::Channel as _;#[cfg(test)]pub(crate) type ChannelHandle = dyn tinychannels_runtime::Channel;@@ -69,7 +67,10 @@ impl ChannelHandle {}}- pub(crate) async fn send(&self, message: &tinychannels_bus::SendMessage) -> anyhow::Result<()> {+ pub(crate) async fn send(+ &self,+ message: &tinychannels_bus::SendMessage,+ ) -> anyhow::Result<()> {match self {Self::Module(channel) => channel.send_prepared(message).await,Self::Relay(channel) => channel.send(message).await,@@ -87,13 +88,11 @@ impl ChannelHandle {pub(crate) async fn start_typing(&self, recipient: &str) -> anyhow::Result<()> {match self {- Self::Module(channel) => {- channel- .interact(tinychannels_bus::ChannelInteraction::StartTyping {- recipient: recipient.to_owned(),- })- .await- }+ Self::Module(channel) => channel+ .interact(tinychannels_bus::ChannelInteraction::StartTyping {+ recipient: recipient.to_owned(),+ })+ .await,Self::Relay(_) => Ok(()),#[cfg(debug_assertions)]Self::Test(channel) => channel.start_typing(recipient).await,@@ -102,13 +101,11 @@ impl ChannelHandle {pub(crate) async fn stop_typing(&self, recipient: &str) -> anyhow::Result<()> {match self {- Self::Module(channel) => {- channel- .interact(tinychannels_bus::ChannelInteraction::StopTyping {- recipient: recipient.to_owned(),- })- .await- }+ Self::Module(channel) => channel+ .interact(tinychannels_bus::ChannelInteraction::StopTyping {+ recipient: recipient.to_owned(),+ })+ .await,Self::Relay(_) => Ok(()),#[cfg(debug_assertions)]Self::Test(channel) => channel.stop_typing(recipient).await,diff --git a/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs b/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rsindex c82b4be6b4..2613426d6f 100644--- a/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs@@ -1,9 +1,9 @@use super::*;use super::{ProgressiveChannelTransport, ProgressiveOutputObserver};-use crate::channels::Channel;use crate::channels::context::ChannelRuntimeContext;use crate::channels::runtime::dispatch::RuntimeChannelMessage;+use crate::channels::Channel;use std::collections::HashMap;use std::sync::{Arc, Mutex, OnceLock, Weak};use tinychannels_bus::channel::{@@ -176,16 +176,14 @@ fn callback_for_channels(let context_slot: Arc<OnceLock<Weak<ChannelRuntimeContext>>> = Arc::new(OnceLock::new());assert!(context_slot.set(Arc::downgrade(&context)).is_ok());let progressive_slot = Arc::new(OnceLock::new());- assert!(- progressive_slot- .set(Arc::new(- progressive_channels- .into_iter()- .map(|(name, adapter)| (name, Arc::downgrade(&adapter)))- .collect()- ))- .is_ok()- );+ assert!(progressive_slot+ .set(Arc::new(+ progressive_channels+ .into_iter()+ .map(|(name, adapter)| (name, Arc::downgrade(&adapter)))+ .collect()+ ))+ .is_ok());let (dispatch, _receiver) = tokio::sync::mpsc::channel::<RuntimeChannelMessage>(1);let mut callback = ChannelHostCallbacks::new(&crate::core::runtime::DispatchCtx::host_default(),@@ -531,16 +529,14 @@ async fn native_progressive_callbacks_stop_after_channel_session_cancellation());callback.cancellation.cancel();- assert!(- callback- .dispatch_controller_backend(output_event_request(- Some("telegram:bot-b"),- Some("chat-42"),- Some("turn-15"),- ))- .await- .is_err()- );+ assert!(callback+ .dispatch_controller_backend(output_event_request(+ Some("telegram:bot-b"),+ Some("chat-42"),+ Some("turn-15"),+ ))+ .await+ .is_err());assert!(observer.seen.lock().await.is_empty());}@@ -569,16 +565,14 @@ async fn native_progressive_callbacks_fail_closed_after_transport_owner_drops()drop(context);drop(adapter);- assert!(- callback- .dispatch_controller_backend(output_event_request(- Some("telegram:bot-b"),- Some("chat-42"),- Some("turn-16"),- ))- .await- .is_err()- );+ assert!(callback+ .dispatch_controller_backend(output_event_request(+ Some("telegram:bot-b"),+ Some("chat-42"),+ Some("turn-16"),+ ))+ .await+ .is_err());}#[path = "callback_inbound_tests.rs"]diff --git a/crates/openhuman-core/src/channels/runtime/startup/delivery_import.rs b/crates/openhuman-core/src/channels/runtime/startup/delivery_import.rsindex f88127c926..ed81ed333d 100644--- a/crates/openhuman-core/src/channels/runtime/startup/delivery_import.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/delivery_import.rs@@ -18,11 +18,11 @@use std::collections::BTreeMap;use std::path::Path;-use serde_json::{Value, json};+use serde_json::{json, Value};use sha2::Digest;use tinychannels_bus::module_delivery::{- DELIVERY_PENDING_CAPACITY, DELIVERY_RECORD_BYTES, DELIVERY_RESULT_CAPACITY,- DELIVERY_RESULT_TTL_SECONDS, DeliveryQueueEntry, DeliveryTerminalResult,+ DeliveryQueueEntry, DeliveryTerminalResult, DELIVERY_PENDING_CAPACITY, DELIVERY_RECORD_BYTES,+ DELIVERY_RESULT_CAPACITY, DELIVERY_RESULT_TTL_SECONDS,};use tinystoragedrivers::{CollectionSpec, ErrorKind, Precondition};diff --git a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rsindex 4ccf99fd90..f99d0b63c9 100644--- a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs@@ -10,14 +10,14 @@ use async_trait::async_trait;use std::collections::HashMap;use std::sync::{Arc, OnceLock, Weak};use tinybus::module::{ModuleCallError, ModuleClient, ModuleObjectClient};-#[cfg(test)]-use tinychannels_bus::ChannelMessage;-use tinychannels_bus::SendMessage;use tinychannels_bus::module_runtime::{ChannelIngressKind, ChannelMessagePreparation, ConfiguredChannelInfo,};use tinychannels_bus::module_supervision::ChannelSupervisionPolicy;use tinychannels_bus::{ChannelInteraction, ChannelInteractionResult};+use tinychannels_bus::SendMessage;+#[cfg(test)]+use tinychannels_bus::ChannelMessage;#[cfg(test)]use tinychannels_runtime::Channel;#[cfg(test)]diff --git a/crates/openhuman-core/src/channels/runtime/startup/progressive_transport_tests.rs b/crates/openhuman-core/src/channels/runtime/startup/progressive_transport_tests.rsindex 271b99d4bb..040e6521f0 100644--- a/crates/openhuman-core/src/channels/runtime/startup/progressive_transport_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/progressive_transport_tests.rs@@ -39,7 +39,7 @@ fn module_callback_error_does_not_expose_provider_details() {#[test]fn receipt_scope_requires_exact_channel_and_full_conversation_identity() {- use tinychannels_bus::channel::{MessageReceipt, types::ConversationKind};+ use tinychannels_bus::channel::{types::ConversationKind, MessageReceipt};use tinychannels_bus::{ChannelRef, ConversationRef};let channel = ChannelRef {diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rsindex 5389f2d905..0073b73aed 100644--- a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs@@ -3,7 +3,7 @@use super::super::dispatch::run_message_dispatch_loop;use super::module_providers::ModuleChannelRuntime;-use super::turn_parts::{PromptToolDescs, build_channel_turn_parts, runtime_context};+use super::turn_parts::{build_channel_turn_parts, runtime_context, PromptToolDescs};use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;diff --git a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rsindex ac5a8befb5..29e21c6cf9 100644--- a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs@@ -6,7 +6,7 @@//! the caller's own config and policy, so a relayed turn never runs with the//! operator's tools or workspace.-use super::chat_workload::{ChatWorkloadResolution, resolve_chat_workload};+use super::chat_workload::{resolve_chat_workload, ChatWorkloadResolution};use super::prompt::format_access_context;use crate::agent::host_runtime;use crate::channels::context::ChannelRuntimeContext;diff --git a/crates/openhuman-core/src/channels/runtime/startup_tests.rs b/crates/openhuman-core/src/channels/runtime/startup_tests.rsindex 691e9fd8da..e8af9daf17 100644--- a/crates/openhuman-core/src/channels/runtime/startup_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/startup_tests.rs@@ -7,7 +7,7 @@//! (cloud) path is preserved for users who haven't picked a local ///! BYOK model, and the override path activates for those who have.-use super::{ChatWorkloadResolution, RelayInboundMessageHandler, resolve_chat_workload};+use super::{resolve_chat_workload, ChatWorkloadResolution, RelayInboundMessageHandler};use crate::config::Config;use tinychannels::relay::RelayInboundHandler;diff --git a/crates/openhuman-core/src/channels/runtime/supervision.rs b/crates/openhuman-core/src/channels/runtime/supervision.rsindex 0e9007956d..53b33638b6 100644--- a/crates/openhuman-core/src/channels/runtime/supervision.rs+++ b/crates/openhuman-core/src/channels/runtime/supervision.rs@@ -86,7 +86,7 @@ pub(crate) fn spawn_supervised_listener(}#[cfg(test)]-pub(crate) use tinychannels::runtime::{MAX_JITTER_MS, jitter_millis};+pub(crate) use tinychannels::runtime::{jitter_millis, MAX_JITTER_MS};#[cfg(test)]#[path = "supervision_tests.rs"]diff --git a/crates/openhuman-core/src/channels/runtime/supervision_tests.rs b/crates/openhuman-core/src/channels/runtime/supervision_tests.rsindex 29aa464962..37facf80f2 100644--- a/crates/openhuman-core/src/channels/runtime/supervision_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/supervision_tests.rs@@ -1,5 +1,5 @@use super::super::super::Channel;-use super::{MAX_JITTER_MS, jitter_millis, spawn_supervised_listener};+use super::{jitter_millis, spawn_supervised_listener, MAX_JITTER_MS};use std::sync::{Arc, Mutex};use tinychannels_bus as traits;use tokio::time::Instant;diff --git a/crates/openhuman-core/src/channels/runtime/test_support.rs b/crates/openhuman-core/src/channels/runtime/test_support.rsindex 35ad978831..880a2ba558 100644--- a/crates/openhuman-core/src/channels/runtime/test_support.rs+++ b/crates/openhuman-core/src/channels/runtime/test_support.rs@@ -2,12 +2,13 @@pub use super::dispatch::test_support::build_channel_context_block_for_test;use super::dispatch::{- RuntimeChannelMessage, process_channel_message, process_channel_runtime_message,+ process_channel_message, process_channel_runtime_message, RuntimeChannelMessage,};pub use super::startup::test_support::resolve_yuanbao_app_secret_for_test;-use crate::agent::bus::{AGENT_RUN_TURN_METHOD, AgentTurnRequest, AgentTurnResponse};+use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, AGENT_RUN_TURN_METHOD};+use crate::channels::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};use crate::channels::ChannelSystemPrompt;-use crate::channels::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};+use tinychannels_runtime::Channel;use crate::config::{MultimodalConfig, MultimodalFileConfig, ReliabilityConfig};use crate::core::bus::BUS;use crate::core::events::DomainEvent;@@ -21,7 +22,6 @@ use std::sync::{Arc, Mutex};use std::time::Duration;use tinyagents_harness::progress::AgentProgress;use tinychannels_bus::{ChannelMessage, SendMessage};-use tinychannels_runtime::Channel;use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};use tinytools::{Tool, ToolResult};diff --git a/crates/openhuman-core/src/channels/system_prompt.rs b/crates/openhuman-core/src/channels/system_prompt.rsindex a006d958b9..3933c952ed 100644--- a/crates/openhuman-core/src/channels/system_prompt.rs+++ b/crates/openhuman-core/src/channels/system_prompt.rs@@ -21,8 +21,8 @@//! bytes, which is the whole point.use crate::agent::context::channels_prompt::{- ProjectContextPlacement, PromptIdentityOverride, build_system_prompt_with_identity,- render_project_context,+ build_system_prompt_with_identity, render_project_context, ProjectContextPlacement,+ PromptIdentityOverride,};use std::collections::hash_map::DefaultHasher;use std::hash::{Hash, Hasher};diff --git a/crates/openhuman-core/src/channels/tests/discord_integration.rs b/crates/openhuman-core/src/channels/tests/discord_integration.rsindex 47a41bacce..d3cb5844a7 100644--- a/crates/openhuman-core/src/channels/tests/discord_integration.rs+++ b/crates/openhuman-core/src/channels/tests/discord_integration.rs@@ -24,7 +24,7 @@//! starts failing.use super::super::context::{- CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext, conversation_history_key,+ conversation_history_key, ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS,};use super::super::runtime::process_channel_message;use super::super::{Channel, SendMessage};diff --git a/crates/openhuman-core/src/channels/tests/health.rs b/crates/openhuman-core/src/channels/tests/health.rsindex 63ad7ab500..17e0230fe7 100644--- a/crates/openhuman-core/src/channels/tests/health.rs+++ b/crates/openhuman-core/src/channels/tests/health.rs@@ -1,8 +1,8 @@-use super::super::Channel;use super::super::runtime::spawn_supervised_listener;+use super::super::Channel;use super::common::AlwaysFailChannel;-use std::sync::Arc;use std::sync::atomic::{AtomicUsize, Ordering};+use std::sync::Arc;use std::time::Duration;use tinychannels_bus as traits;@@ -33,12 +33,10 @@ async fn supervised_listener_marks_error_and_restarts_on_failures() {assert_eq!(component["status"], "error");assert!(component["restart_count"].as_u64().unwrap_or(0) >= 1);- assert!(- component["last_error"]- .as_str()- .unwrap_or("")- .contains("listen boom")- );+ assert!(component["last_error"]+ .as_str()+ .unwrap_or("")+ .contains("listen boom"));assert!(calls.load(Ordering::SeqCst) >= 1);}diff --git a/crates/openhuman-core/src/channels/tests/prompt.rs b/crates/openhuman-core/src/channels/tests/prompt.rsindex 0cd6152d56..b9c1d3bd41 100644--- a/crates/openhuman-core/src/channels/tests/prompt.rs+++ b/crates/openhuman-core/src/channels/tests/prompt.rs@@ -1,5 +1,5 @@use super::common::make_workspace;-use crate::agent::context::channels_prompt::{BOOTSTRAP_MAX_CHARS, build_system_prompt};+use crate::agent::context::channels_prompt::{build_system_prompt, BOOTSTRAP_MAX_CHARS};use tempfile::TempDir;#[test]diff --git a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rsindex 9b2754cb71..599930fc37 100644--- a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs+++ b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs@@ -1,11 +1,11 @@-use super::super::Channel;-use super::super::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};-use super::super::runtime::test_support::{DispatchHarnessOptions, run_dispatch_harness};+use super::super::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};+use super::super::runtime::test_support::{run_dispatch_harness, DispatchHarnessOptions};use super::super::runtime::{- RuntimeChannelMessage, process_channel_message, run_message_dispatch_loop,+ process_channel_message, run_message_dispatch_loop, RuntimeChannelMessage,};-use super::common::{RecordingChannel, SlowModel, use_real_agent_handler};-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};+use super::super::Channel;+use super::common::{use_real_agent_handler, RecordingChannel, SlowModel};+use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};use crate::core::events::DomainEvent;use crate::inference::provider;use std::collections::HashMap;@@ -699,10 +699,8 @@ async fn dispatch_replies_with_timeout_notice_when_handler_exceeds_deadline() {..Default::default()}).await;- assert!(- timed_out- .sends- .iter()- .any(|send| send.content.contains("Request timed out"))- );+ assert!(timed_out+ .sends+ .iter()+ .any(|send| send.content.contains("Request timed out")));}diff --git a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rsindex b282d38d09..c18dc08d9a 100644--- a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs+++ b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs@@ -1,9 +1,9 @@-use super::super::Channel;use super::super::context::{- CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRouteSelection, ChannelRuntimeContext,- conversation_history_key,+ conversation_history_key, ChannelRouteSelection, ChannelRuntimeContext,+ CHANNEL_MESSAGE_TIMEOUT_SECS,};use super::super::runtime::process_channel_message;+use super::super::Channel;use super::common::{IterativeToolModel, MockPriceTool, ModelCaptureModel, RecordingChannel,TelegramRecordingChannel, ToolCallingModel,diff --git a/crates/openhuman-core/src/channels/tests/telegram_integration.rs b/crates/openhuman-core/src/channels/tests/telegram_integration.rsindex b56a30a998..db91b7696d 100644--- a/crates/openhuman-core/src/channels/tests/telegram_integration.rs+++ b/crates/openhuman-core/src/channels/tests/telegram_integration.rs@@ -6,7 +6,7 @@//! about exactly what the channel receives, without needing a real Telegram HTTP server.use super::super::context::{- CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext, conversation_history_key,+ conversation_history_key, ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS,};use super::super::runtime::process_channel_message;use super::super::{Channel, SendMessage};diff --git a/crates/openhuman-core/src/cron/bus.rs b/crates/openhuman-core/src/cron/bus.rsindex 33fea9a559..77f22fe31d 100644--- a/crates/openhuman-core/src/cron/bus.rs+++ b/crates/openhuman-core/src/cron/bus.rs@@ -5,13 +5,13 @@//! of directly constructing channel instances. The [`CronDeliverySubscriber`]//! picks up those events and dispatches to the appropriate channel, keeping//! channel construction out of the scheduler.-use crate::channels::runtime::ChannelHandle;use crate::core::events::DomainEvent;use async_trait::async_trait;use std::collections::HashMap;use std::sync::Arc;use tinybus::EventHandler;use tinychannels_bus::SendMessage;+use crate::channels::runtime::ChannelHandle;/// Subscribes to `CronDeliveryRequested` events and dispatches/// the output to the named channel.