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): move legacy provider deps to dev-dependencies
Steven Enamakel505276f10848
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.tomlindex 3e6d3bdbf9..bfebccd1e9 100644--- a/crates/openhuman-core/Cargo.toml+++ b/crates/openhuman-core/Cargo.toml@@ -254,14 +254,6 @@ tinymcp-bus = { path = "../../vendor/tinymcp/crates/tinymcp-bus", features = ["s# types, so this vocabulary is always-on kernel surface. It costs serde/schemars and nothing# this build did not already have.tinychannels-bus = { version = "0.1", path = "../../vendor/tinychannels/crates/tinychannels-bus" }-# Remaining channel runtime helpers and provider traits (temporary migration dependency).-tinychannels-runtime = { version = "0.1", path = "../../vendor/tinychannels/crates/tinychannels-runtime" }-# The provider stack that IMPLEMENTS that vocabulary — Telegram, Discord,-# Slack, IMAP, WhatsApp, the relay transport loop. Optional: it owns the-# `reqwest` / `rusqlite` / `rustls` / `tokio-tungstenite` cohort, which a-# workflow-only build has no use for. Enabled by `channels`; the loaded-# TinyChannels module handles provider execution.-tinychannels = { version = "0.1", features = ["relay-websocket"], optional = true }# tinybus — the message bus. Owns what `crates/openhuman-core/src/core/event_bus/` used to: the typed# pub/sub surface (`EventBus`, `EventHandler`, `SubscriptionHandle`), the# in-process zero-serialization request registry (`NativeRegistry`), and peer@@ -556,8 +548,10 @@ windows-sys = { version = "0.61", features = [tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect", "handshake", "rustls-tls-webpki-roots"] }[dev-dependencies]-# The real linked TinyChannels implementation backs host adapter unit tests;-# it is test-only and never enters the OpenHuman product dependency graph.+# Legacy TinyChannels provider/runtime fixtures remain available to tests only;+# production channel execution uses the TinyBus module contract above.+tinychannels = { path = "../../vendor/tinychannels", features = ["relay-websocket", "email", "lark", "whatsapp-web"] }+tinychannels-runtime = { path = "../../vendor/tinychannels/crates/tinychannels-runtime" }tinychannels-module = { path = "../../vendor/tinychannels/crates/tinychannels-module", features = ["static-link"] }# The TinyMemory reference engine (an in-memory `MemoryEngine`) and the# behavioural suite every engine must pass. Memory unit tests bind it as the@@ -891,11 +885,10 @@ crash-reporting = ["dep:sentry"]# Provider runtime remains an audited implementation exception until its bus# cutover. Channels-backed operations require the process-wide module loader;# serialized configuration/messages come from the always-on bus contract.-channels = ["modules", "dep:tinychannels", "tinychannels/email", "tinychannels/lark"]-# The WhatsApp Web provider now lives in tinychannels; forward to its feature.-# It is a refinement INSIDE the `channels` gate — enabling it pulls in the whole-# channels domain (the provider re-exports live under `channels/providers/`).-whatsapp-web = ["channels", "tinychannels/whatsapp-web"]+channels = ["modules"]+# Retained only to gate legacy provider test fixtures; production channel+# execution is delivered by the TinyChannels module artifact.+whatsapp-web = ["channels"]# Exposes the destructive `openhuman.test_reset` RPC. Off by default; the E2E# build (app/scripts/e2e-build.sh) flips it on. Shipped binaries never have# this feature so the wipe RPC isn't even registered, let alone reachable.diff --git a/crates/openhuman-core/src/channels/bus/delivery.rs b/crates/openhuman-core/src/channels/bus/delivery.rsindex b468305014..7dc367ccc3 100644--- a/crates/openhuman-core/src/channels/bus/delivery.rs+++ b/crates/openhuman-core/src/channels/bus/delivery.rs@@ -5,16 +5,16 @@ use crate::modules::{client::{ModuleCallError, ModuleClient},};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 tinychannels_bus::module_progressive::{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.rsindex 263f33f03d..f2be5dc5e1 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.rsindex 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.rsindex 40e84e94a4..d4f5f96b59 100644--- a/crates/openhuman-core/src/channels/bus_test_support_tests.rs+++ b/crates/openhuman-core/src/channels/bus_test_support_tests.rs@@ -2,7 +2,7 @@use super::*;use tinychannels::delivery::progressive::{- extract_message_id, latest_thinking_snippet, StreamingState,+ StreamingState, extract_message_id, latest_thinking_snippet,};pub fn extract_message_id_for_test(resp: &serde_json::Value) -> Option<String> {diff --git a/crates/openhuman-core/src/channels/context.rs b/crates/openhuman-core/src/channels/context.rsindex fee410b054..4a9747d509 100644--- a/crates/openhuman-core/src/channels/context.rs+++ b/crates/openhuman-core/src/channels/context.rs@@ -13,15 +13,14 @@ use tinyagents_session::transcript::TranscriptMessage;use tinytools::Tool;pub(crate) use tinychannels_bus::context::{- ChannelRouteSelection, CHANNEL_HISTORY_COMPACT_CONTENT_CHARS,- CHANNEL_HISTORY_COMPACT_KEEP_MESSAGES, CHANNEL_MESSAGE_TIMEOUT_SECS,- CHANNEL_TYPING_REFRESH_INTERVAL_SECS, DEFAULT_CHANNEL_INITIAL_BACKOFF_SECS,- DEFAULT_CHANNEL_MAX_BACKOFF_SECS, MAX_CHANNEL_HISTORY,+ CHANNEL_HISTORY_COMPACT_CONTENT_CHARS, CHANNEL_HISTORY_COMPACT_KEEP_MESSAGES,+ CHANNEL_MESSAGE_TIMEOUT_SECS, CHANNEL_TYPING_REFRESH_INTERVAL_SECS, ChannelRouteSelection,+ DEFAULT_CHANNEL_INITIAL_BACKOFF_SECS, DEFAULT_CHANNEL_MAX_BACKOFF_SECS, MAX_CHANNEL_HISTORY,};#[cfg(test)]pub(crate) use tinychannels::context::{- effective_channel_message_timeout_secs, MIN_CHANNEL_MESSAGE_TIMEOUT_SECS,+ MIN_CHANNEL_MESSAGE_TIMEOUT_SECS, effective_channel_message_timeout_secs,};/// Per-sender conversation history for channel messages.diff --git a/crates/openhuman-core/src/channels/context_tests.rs b/crates/openhuman-core/src/channels/context_tests.rsindex 9ee00b44b6..15c11ea13c 100644--- a/crates/openhuman-core/src/channels/context_tests.rs+++ b/crates/openhuman-core/src/channels/context_tests.rs@@ -110,22 +110,22 @@ fn clear_and_compact_sender_history_update_cached_messages() {}clear_sender_history(&ctx, sender);- assert!(!ctx- .conversation_histories- .lock()- .unwrap()- .contains_key(sender));+ assert!(+ !ctx.conversation_histories+ .lock()+ .unwrap()+ .contains_key(sender)+ );}#[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 4371baee33..b9491f04b2 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::{- channel_controller_schema, ChannelControllerField, ChannelControllerFieldType,- ChannelControllerSchema,+ ChannelControllerField, ChannelControllerFieldType, ChannelControllerSchema,+ channel_controller_schema,};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 b8a1abea95..100ce72f4a 100644--- a/crates/openhuman-core/src/channels/controllers/backend.rs+++ b/crates/openhuman-core/src/channels/controllers/backend.rs@@ -1,18 +1,17 @@//! TinyChannels backend implementation for OpenHuman controller operations.-use serde::Serialize;-use serde_json::{json, Value};+use serde_json::{Value, json};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)]@@ -101,7 +100,6 @@ impl OpenHumanChannelBackend {.map(Result::Threads),}}-}fn into_anyhow<T>(result: Result<Outcome<T>, String>) -> anyhow::Result<T> {@@ -110,10 +108,6 @@ fn into_anyhow<T>(result: Result<Outcome<T>, String>) -> anyhow::Result<T> {.map_err(anyhow::Error::msg)}-fn to_raw_value(value: impl Serialize) -> Option<Value> {- serde_json::to_value(value).ok()-}-fn parse_or_raw<T>(value: Value) -> TwhereT: Default + serde::de::DeserializeOwned,@@ -302,7 +296,6 @@ impl OpenHumanChannelBackend {let value = into_anyhow(ops::channel_list_threads(&config, channel, active).await)?;Ok(parse_or_raw(value))}-}#[cfg(test)]diff --git a/crates/openhuman-core/src/channels/controllers/definitions.rs b/crates/openhuman-core/src/channels/controllers/definitions.rsindex 0757c1dea3..f5753ba26a 100644--- a/crates/openhuman-core/src/channels/controllers/definitions.rs+++ b/crates/openhuman-core/src/channels/controllers/definitions.rs@@ -1,4 +1,4 @@pub use tinychannels_bus::controllers::{- all_channel_definitions, find_channel_definition, AuthModeSpec, ChannelAuthMode,- ChannelCapability, ChannelDefinition, FieldRequirement,+ AuthModeSpec, ChannelAuthMode, ChannelCapability, ChannelDefinition, FieldRequirement,+ all_channel_definitions, find_channel_definition,};diff --git a/crates/openhuman-core/src/channels/controllers/mod.rs b/crates/openhuman-core/src/channels/controllers/mod.rsindex 63ef974091..b31c42e6b7 100644--- a/crates/openhuman-core/src/channels/controllers/mod.rs+++ b/crates/openhuman-core/src/channels/controllers/mod.rs@@ -8,8 +8,8 @@ mod schemas;pub use backend::OpenHumanChannelBackend;pub use definitions::{- all_channel_definitions, find_channel_definition, AuthModeSpec, ChannelAuthMode,- ChannelCapability, ChannelDefinition, FieldRequirement,+ AuthModeSpec, ChannelAuthMode, ChannelCapability, ChannelDefinition, FieldRequirement,+ all_channel_definitions, find_channel_definition,};pub use schemas::all_controller_schemas as all_channels_controller_schemas;diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rsindex 38ffb62f0f..57ac92db55 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/disconnect.rs@@ -1,13 +1,13 @@//! Disconnecting a channel: removing stored credentials and clearing its//! runtime config, optionally along with its memory chunks.-use serde_json::{json, Value};+use serde_json::{Value, json};use crate::config::Config;use crate::core::Outcome;use crate::security::credentials;-use super::super::super::definitions::{find_channel_definition, ChannelAuthMode};+use super::super::super::definitions::{ChannelAuthMode, find_channel_definition};use super::memory::clear_channel_memory;use super::shared::credential_provider;diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/status.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/status.rsindex b6ef841a4b..b43f5ec7db 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::{json, Value};+use serde_json::{Value, json};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 ad53fc831e..94095d555e 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::{methods, ChannelControllerRequest, ChannelControllerResult};+use tinychannels_bus::{ChannelControllerRequest, ChannelControllerResult, methods};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 9c14c40705..d1eebcd1e7 100644--- a/crates/openhuman-core/src/channels/controllers/ops/discord.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/discord.rs@@ -11,8 +11,8 @@ use crate::modules::{};use crate::security::credentials;use tinychannels_bus::{- controllers::{BotPermissionCheck, DiscordGuild, DiscordTextChannel},ChannelControllerRequest,+ controllers::{BotPermissionCheck, DiscordGuild, DiscordTextChannel},};use super::super::definitions::ChannelAuthMode;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 253f5dec47..a603f1f955 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,10 +462,12 @@ 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 db860d6926..ebc1671493 100644--- a/crates/openhuman-core/src/channels/controllers/schemas.rs+++ b/crates/openhuman-core/src/channels/controllers/schemas.rs@@ -1,14 +1,14 @@//! RPC controller schemas and handlers for the channels domain.-use serde::de::DeserializeOwned;use serde::Deserialize;+use serde::de::DeserializeOwned;use serde_json::{Map, Value};-use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::core::all::{ControllerFuture, RegisteredController};+use crate::config::rpc as config_rpc;use crate::core::ControllerSchema;use crate::core::Outcome;+use crate::core::all::{ControllerFuture, RegisteredController};use super::backend::OpenHumanChannelBackend;use super::definitions::ChannelAuthMode;diff --git a/crates/openhuman-core/src/channels/host/channel_events.rs b/crates/openhuman-core/src/channels/host/channel_events.rsindex 67d0ef5c64..2eb8e47449 100644--- a/crates/openhuman-core/src/channels/host/channel_events.rs+++ b/crates/openhuman-core/src/channels/host/channel_events.rs@@ -7,7 +7,7 @@ use std::collections::HashMap;use std::path::PathBuf;use std::sync::{Arc, Mutex};use tinybus::EventHandler;-use tinychannels_bus::{capabilities_for, ChannelMessage};+use tinychannels_bus::{ChannelMessage, capabilities_for};#[derive(Clone)]struct ReplyContext {diff --git a/crates/openhuman-core/src/channels/host/host_tests.rs b/crates/openhuman-core/src/channels/host/host_tests.rsindex a03eb07e33..87b5943afe 100644--- a/crates/openhuman-core/src/channels/host/host_tests.rs+++ b/crates/openhuman-core/src/channels/host/host_tests.rs@@ -63,8 +63,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!({@@ -73,9 +73,10 @@ 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!({@@ -84,16 +85,19 @@ 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 d5746235fe..eb0ba8ae10 100644--- a/crates/openhuman-core/src/channels/host/mod.rs+++ b/crates/openhuman-core/src/channels/host/mod.rs@@ -17,10 +17,10 @@ pub use channel_events::{ChannelApprovalSurfaceSubscriber, ChannelTurnStateSubsc#[cfg(test)]use std::sync::Arc;-#[cfg(test)]-use tinychannels::host::ChannelHostBuilder;#[cfg(test)]use tinychannels::ChannelHost;+#[cfg(test)]+use tinychannels::host::ChannelHostBuilder;#[cfg(test)]use crate::config::Config;diff --git a/crates/openhuman-core/src/channels/host/remote_control.rs b/crates/openhuman-core/src/channels/host/remote_control.rsindex c19121fbda..21fa2e90eb 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::{clear_sender_history, ChannelRuntimeContext};+use crate::channels::context::{ChannelRuntimeContext, clear_sender_history};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/module_fixture_tests.rs b/crates/openhuman-core/src/channels/module_fixture_tests.rsindex abb551f4bc..2117c78411 100644--- a/crates/openhuman-core/src/channels/module_fixture_tests.rs+++ b/crates/openhuman-core/src/channels/module_fixture_tests.rs@@ -109,10 +109,10 @@ async fn linked_module_prepares_runtime_limits_over_confidential_bus_call() {#[tokio::test]async fn linked_module_prepares_legacy_inbound_facts_over_confidential_bus_call() {+ 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 9e3f60d262..a50671e5af 100644--- a/crates/openhuman-core/src/channels/proactive.rs+++ b/crates/openhuman-core/src/channels/proactive.rs@@ -21,8 +21,8 @@use crate::channels::{Channel, ChannelSendExt, SendMessage};use crate::core::events::DomainEvent;-use crate::web_chat::publish_web_channel_event;use crate::web_chat::WebChannelEvent;+use crate::web_chat::publish_web_channel_event;use async_trait::async_trait;use std::collections::HashMap;use std::sync::{Arc, RwLock};diff --git a/crates/openhuman-core/src/channels/proactive_tests.rs b/crates/openhuman-core/src/channels/proactive_tests.rsindex 84946f932c..0bcf463d84 100644--- a/crates/openhuman-core/src/channels/proactive_tests.rs+++ b/crates/openhuman-core/src/channels/proactive_tests.rs@@ -1,7 +1,7 @@use super::*;use crate::channels::traits::ChannelMessage;-use std::sync::atomic::{AtomicUsize, Ordering};use std::sync::Mutex;+use std::sync::atomic::{AtomicUsize, Ordering};use tokio::sync::mpsc;struct MockChannel {@@ -101,12 +101,14 @@ async fn routes_to_active_external_channel() {sub.handle(&proactive_event()).await;assert_eq!(send_count.load(Ordering::SeqCst), 1);- assert!(last_idempotency_key- .lock()- .unwrap_or_else(|e| e.into_inner())- .as_deref()- .unwrap()- .starts_with("legacy-send:telegram:"));+ assert!(+ last_idempotency_key+ .lock()+ .unwrap_or_else(|e| e.into_inner())+ .as_deref()+ .unwrap()+ .starts_with("legacy-send:telegram:")+ );}#[tokio::test]diff --git a/crates/openhuman-core/src/channels/providers/relay/channel.rs b/crates/openhuman-core/src/channels/providers/relay/channel.rsindex d68e94dd44..d1524107ee 100644--- a/crates/openhuman-core/src/channels/providers/relay/channel.rs+++ b/crates/openhuman-core/src/channels/providers/relay/channel.rs@@ -11,7 +11,7 @@ use async_trait::async_trait;use serde_json::json;use crate::channels::traits::{Channel, ChannelMessage, SendMessage};-use crate::web_chat::{publish_web_channel_event, WebChannelEvent};+use crate::web_chat::{WebChannelEvent, publish_web_channel_event};/// The event name a relayed reply is published under.pub const CHANNEL_OUTBOUND_EVENT: &str = "channel_outbound";diff --git a/crates/openhuman-core/src/channels/providers/relay/mod.rs b/crates/openhuman-core/src/channels/providers/relay/mod.rsindex 82cd3e1765..e95955ff25 100644--- a/crates/openhuman-core/src/channels/providers/relay/mod.rs+++ b/crates/openhuman-core/src/channels/providers/relay/mod.rs@@ -25,11 +25,11 @@ mod params;mod schemas;mod store;-pub use channel::{RelayChannel, CHANNEL_OUTBOUND_EVENT};+pub use channel::{CHANNEL_OUTBOUND_EVENT, RelayChannel};pub use ops::channel_relay_inbound;pub use params::{- validate_channel, validate_id, RelayInboundParams, DEFAULT_RELAY_CLIENT_ID, MAX_CHANNEL_LEN,- MAX_ID_LEN, MAX_SENDER_NAME_CHARS, MAX_TEXT_BYTES, RESERVED_CHANNELS,+ DEFAULT_RELAY_CLIENT_ID, MAX_CHANNEL_LEN, MAX_ID_LEN, MAX_SENDER_NAME_CHARS, MAX_TEXT_BYTES,+ RESERVED_CHANNELS, RelayInboundParams, validate_channel, validate_id,};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 c8f74160b1..31047af8e4 100644--- a/crates/openhuman-core/src/channels/providers/relay/ops.rs+++ b/crates/openhuman-core/src/channels/providers/relay/ops.rs@@ -3,15 +3,15 @@use std::collections::HashMap;use std::sync::Arc;-use serde_json::{json, Value};+use serde_json::{Value, json};use super::channel::RelayChannel;use super::params::RelayInboundParams;use super::store::{self, Recorded};use crate::channels::context::MAX_CHANNEL_HISTORY;use crate::channels::runtime::{- build_channel_turn_parts, prepare_runtime_limits, process_channel_runtime_message,- runtime_context, PromptToolDescs,+ PromptToolDescs, build_channel_turn_parts, prepare_runtime_limits,+ process_channel_runtime_message, runtime_context,};use crate::config::Config;use crate::core::Outcome;diff --git a/crates/openhuman-core/src/channels/providers/relay/ops_tests.rs b/crates/openhuman-core/src/channels/providers/relay/ops_tests.rsindex 1c1be030a1..064596391b 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::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};+use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};use crate::agent::turn_origin::AgentTurnOrigin;use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};use std::sync::Mutex;diff --git a/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs b/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rsindex c696065b47..8f0be869cb 100644--- a/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs+++ b/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs@@ -24,9 +24,11 @@ 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 ec0f19b3d9..7e242f7ce5 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::{clear_sender_history, ChannelRouteSelection, ChannelRuntimeContext};+use super::context::{ChannelRouteSelection, ChannelRuntimeContext, clear_sender_history};use super::traits;use super::{Channel, ChannelSendExt, SendMessage};use crate::inference::provider;use std::sync::Arc;#[cfg(test)]-use tinychannels::remote::{parse_remote_command, RemoteCommand};+use tinychannels::remote::{RemoteCommand, parse_remote_command};#[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.rsindex 88153cb220..4da0df21d9 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::{- conversation_history_key, ChannelRuntimeContext, RouteSelectionMap, TurnModelSourceCacheMap,+ ChannelRuntimeContext, RouteSelectionMap, TurnModelSourceCacheMap, conversation_history_key,};use crate::channels::host::ChannelTurnStateSubscriber;use crate::channels::traits::ChannelMessage;@@ -269,9 +269,11 @@ 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"));}@@ -305,12 +307,13 @@ 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 {@@ -405,9 +408,11 @@ 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]@@ -438,9 +443,11 @@ 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"));}@@ -476,12 +483,13 @@ 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(),@@ -553,9 +561,11 @@ 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"));@@ -566,7 +576,8 @@ 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"))+ );}diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rsindex 2b25366c1f..556480a586 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/helpers_tests.rs@@ -1,6 +1,6 @@use super::*;use std::sync::Arc;-use tokio::sync::{oneshot, Notify};+use tokio::sync::{Notify, oneshot};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 6bb1f945a1..acf359e943 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::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};+use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};use crate::agent::host_agents::{self, HostAgent, HostAgentResolver};-use crate::channels::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};+use crate::channels::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};use crate::channels::runtime::process_channel_message;-use crate::channels::{traits, Channel, SendMessage};+use crate::channels::{Channel, SendMessage, traits};use crate::core::runtime::{CoreContext, DomainSet};-use serde_json::{json, Value};+use serde_json::{Value, json};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 bf70522fad..3756d37dbd 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@@ -29,7 +29,7 @@ use crate::core::events::DomainEvent;pub(crate) mod posture;mod turn;-pub(crate) use turn::{run_host_agent_turn, seed_rows, HostChannelTurn};+pub(crate) use turn::{HostChannelTurn, run_host_agent_turn, seed_rows};/// What a channel's binding resolves to for one message.pub(crate) enum HostRoute {diff --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 897b06d53f..512bb00296 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::turn_origin::AgentTurnOrigin;use crate::agent::HostTools;+use crate::agent::turn_origin::AgentTurnOrigin;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 a7df3a5833..a73e103e55 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::{json, Value};-use std::sync::atomic::{AtomicUsize, Ordering};+use serde_json::{Value, json};use std::sync::Arc;+use std::sync::atomic::{AtomicUsize, Ordering};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 433662df47..3374999e44 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/mod.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/mod.rs@@ -16,8 +16,8 @@ mod processor;mod routing;pub(crate) use processor::{- process_channel_message, process_channel_runtime_message, run_message_dispatch_loop,- RuntimeChannelMessage,+ RuntimeChannelMessage, process_channel_message, process_channel_runtime_message,+ run_message_dispatch_loop,};// `channel_has_approval_surface` stays pub(crate) on processor; re-export so@@ -33,7 +33,7 @@ use helpers::build_channel_context_block;use helpers::select_acknowledgment_reaction;#[cfg(test)]-use routing::{build_visible_tool_set, AgentScoping};+use routing::{AgentScoping, build_visible_tool_set};#[cfg(any(test, debug_assertions))]use crate::channels::traits;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 79e4bfa101..ca20bbb05f 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::{AgentTurnRequest, AgentTurnResponse, AGENT_RUN_TURN_METHOD};+use crate::agent::bus::{AGENT_RUN_TURN_METHOD, AgentTurnRequest, AgentTurnResponse};use crate::agent::progress::AgentProgress;use crate::agent::turn_origin::AgentTurnOrigin;use crate::channels::context::{ChannelRouteSelection, ChannelRuntimeContext};diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rsindex f73d1cf366..a97e7318bc 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs@@ -5,7 +5,7 @@use crate::agent::bus::AgentTurnResponse;use crate::agent::progress::AgentProgress;use crate::channels::context::{- compact_sender_history, is_context_window_overflow_error, ChannelRuntimeContext,+ ChannelRuntimeContext, compact_sender_history, is_context_window_overflow_error,};use crate::channels::routes::{get_or_create_turn_model_source, get_route_selection, handle_runtime_command_if_needed,@@ -22,13 +22,13 @@ use tokio_util::sync::CancellationToken;use tokio_util::task::AbortOnDropHandle;use super::super::helpers::{- build_channel_context_block, log_worker_join_result, spawn_scoped_typing_task,- REPLY_LOG_TRUNCATE_CHARS,+ REPLY_LOG_TRUNCATE_CHARS, build_channel_context_block, log_worker_join_result,+ spawn_scoped_typing_task,};-use super::super::host_agent::{self, run_host_agent_turn, seed_rows, HostChannelTurn, HostRoute};+use super::super::host_agent::{self, HostChannelTurn, HostRoute, run_host_agent_turn, seed_rows};+use super::RuntimeChannelMessage;use super::approval::{channel_has_approval_surface, try_route_approval_reply};use super::bus_turn::dispatch_bus_turn;-use super::RuntimeChannelMessage;pub(crate) async fn process_channel_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 55fc6543bc..849fcc08c0 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::definition::{AgentDefinition, AgentDefinitionRegistryuse crate::agent::prompts::ConnectedIntegration;use crate::config::Config;use crate::integrations::composio::{- cached_active_integrations, fetch_connected_integrations_status,- FetchConnectedIntegrationsStatus,+ FetchConnectedIntegrationsStatus, cached_active_integrations,+ fetch_connected_integrations_status,};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 17130f4994..ce7e92bcc5 100644--- a/crates/openhuman-core/src/channels/runtime/mod.rs+++ b/crates/openhuman-core/src/channels/runtime/mod.rs@@ -13,13 +13,13 @@ 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.pub(crate) use dispatch::process_channel_message;-pub(crate) use startup::{build_channel_turn_parts, runtime_context, PromptToolDescs};+pub(crate) use startup::{PromptToolDescs, build_channel_turn_parts, runtime_context};#[cfg(any(test, debug_assertions))]pub mod test_support;// Re-exported for `channels::tests` only; omit in normal lib builds to avoid unused-import warnings.#[cfg(test)]-pub(crate) use dispatch::{run_message_dispatch_loop, RuntimeChannelMessage};+pub(crate) use dispatch::{RuntimeChannelMessage, run_message_dispatch_loop};#[cfg(test)]pub(crate) use supervision::spawn_supervised_listener;diff --git a/crates/openhuman-core/src/channels/runtime/session_tests.rs b/crates/openhuman-core/src/channels/runtime/session_tests.rsindex 4e80f01002..5438f6ccef 100644--- a/crates/openhuman-core/src/channels/runtime/session_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/session_tests.rs@@ -1,6 +1,6 @@use super::*;-use std::sync::atomic::{AtomicBool, Ordering};use std::sync::Arc;+use std::sync::atomic::{AtomicBool, Ordering};#[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 60a02079ca..8738a2904a 100644--- a/crates/openhuman-core/src/channels/runtime/startup.rs+++ b/crates/openhuman-core/src/channels/runtime/startup.rs@@ -53,7 +53,7 @@ pub(crate) async fn prepare_runtime_limits(pub(crate) use credentials::hydrate_channel_credentials;pub use start_channels::start_channels;pub(crate) use start_channels::start_channels_with_session;-pub(crate) use turn_parts::{build_channel_turn_parts, runtime_context, PromptToolDescs};+pub(crate) use turn_parts::{PromptToolDescs, build_channel_turn_parts, runtime_context};// Re-exported at module scope (rather than left as private `pub(super)`// items reached only through their owning submodule) so the `#[path]` test@@ -62,7 +62,7 @@ pub(crate) use turn_parts::{build_channel_turn_parts, runtime_context, PromptToo#[cfg(test)]use crate::config::Config;#[cfg(test)]-use chat_workload::{resolve_chat_workload, ChatWorkloadResolution};+use chat_workload::{ChatWorkloadResolution, resolve_chat_workload};#[cfg(any(test, debug_assertions))]use credentials::resolve_yuanbao_app_secret;#[cfg(test)]diff --git a/crates/openhuman-core/src/channels/runtime/startup/delivery_store.rs b/crates/openhuman-core/src/channels/runtime/startup/delivery_store.rsindex 711b92ad61..82f3408db0 100644--- a/crates/openhuman-core/src/channels/runtime/startup/delivery_store.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/delivery_store.rs@@ -4,8 +4,8 @@ use std::collections::{BTreeMap, HashMap};use std::path::{Path, PathBuf};use std::sync::{Arc, Mutex as StdMutex, OnceLock};use tinychannels_bus::module_delivery::{- DeliveryQueueEntry, DeliveryTerminalResult, DELIVERY_PENDING_CAPACITY, DELIVERY_RECORD_BYTES,- DELIVERY_RESULT_CAPACITY, DELIVERY_RESULT_TTL_SECONDS,+ DELIVERY_PENDING_CAPACITY, DELIVERY_RECORD_BYTES, DELIVERY_RESULT_CAPACITY,+ DELIVERY_RESULT_TTL_SECONDS, DeliveryQueueEntry, DeliveryTerminalResult,};use tokio::sync::Mutex;diff --git a/crates/openhuman-core/src/channels/runtime/startup/delivery_store_tests.rs b/crates/openhuman-core/src/channels/runtime/startup/delivery_store_tests.rsindex 7882e83d76..931d50f8a2 100644--- a/crates/openhuman-core/src/channels/runtime/startup/delivery_store_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/delivery_store_tests.rs@@ -106,9 +106,11 @@ async fn removal_and_failed_delivery_are_idempotent_and_durable() {reopened.load_failed("failed".into()).await.unwrap(),Some(failed));- assert!(reopened- .load_pending("pending".into())- .await- .unwrap()- .is_none());+ assert!(+ reopened+ .load_pending("pending".into())+ .await+ .unwrap()+ .is_none()+ );}diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rsindex a1761e48fb..9d4ee7527d 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::{build_channel_turn_parts, runtime_context, PromptToolDescs};+use super::turn_parts::{PromptToolDescs, build_channel_turn_parts, runtime_context};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 d10e3dd8ca..792f6be474 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::{resolve_chat_workload, ChatWorkloadResolution};+use super::chat_workload::{ChatWorkloadResolution, resolve_chat_workload};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 e1b2658508..ce835f5d31 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::{resolve_chat_workload, ChatWorkloadResolution, RelayInboundMessageHandler};+use super::{ChatWorkloadResolution, RelayInboundMessageHandler, resolve_chat_workload};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 707d40a51b..bda8b630fb 100644--- a/crates/openhuman-core/src/channels/runtime/supervision.rs+++ b/crates/openhuman-core/src/channels/runtime/supervision.rs@@ -1,7 +1,7 @@//! OpenHuman observer adapter for TinyChannels listener supervision.-use super::super::traits;use super::super::Channel;+use super::super::traits;use crate::core::bus::BUS;use crate::core::events::DomainEvent;use std::sync::Arc;@@ -60,7 +60,7 @@ pub(crate) fn spawn_supervised_listener(}#[cfg(test)]-pub(crate) use tinychannels::runtime::{jitter_millis, MAX_JITTER_MS};+pub(crate) use tinychannels::runtime::{MAX_JITTER_MS, jitter_millis};#[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 bacab56eaa..e679a59d81 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::{traits, Channel};-use super::{jitter_millis, spawn_supervised_listener, MAX_JITTER_MS};+use super::super::super::{Channel, traits};+use super::{MAX_JITTER_MS, jitter_millis, spawn_supervised_listener};use std::sync::{Arc, Mutex};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 ee577adbb4..1726a3042c 100644--- a/crates/openhuman-core/src/channels/runtime/test_support.rs+++ b/crates/openhuman-core/src/channels/runtime/test_support.rs@@ -2,15 +2,15 @@pub use super::dispatch::test_support::build_channel_context_block_for_test;use super::dispatch::{- process_channel_message, process_channel_runtime_message, RuntimeChannelMessage,+ RuntimeChannelMessage, process_channel_message, process_channel_runtime_message,};pub use super::startup::test_support::resolve_yuanbao_app_secret_for_test;-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, AGENT_RUN_TURN_METHOD};+use crate::agent::bus::{AGENT_RUN_TURN_METHOD, AgentTurnRequest, AgentTurnResponse};use crate::agent::progress::AgentProgress;-use crate::channels::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};-use crate::channels::traits::{ChannelMessage, SendMessage};use crate::channels::Channel;use crate::channels::ChannelSystemPrompt;+use crate::channels::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};+use crate::channels::traits::{ChannelMessage, SendMessage};use crate::config::{MultimodalConfig, MultimodalFileConfig, ReliabilityConfig};use crate::core::bus::BUS;use crate::core::events::DomainEvent;diff --git a/crates/openhuman-core/src/channels/system_prompt.rs b/crates/openhuman-core/src/channels/system_prompt.rsindex 6779b0ceb5..bb1e72506a 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::{- build_system_prompt_with_identity, render_project_context, ProjectContextPlacement,- PromptIdentityOverride,+ ProjectContextPlacement, PromptIdentityOverride, build_system_prompt_with_identity,+ render_project_context,};use crate::skills::Workflow;use std::collections::hash_map::DefaultHasher;diff --git a/crates/openhuman-core/src/channels/tests/common.rs b/crates/openhuman-core/src/channels/tests/common.rsindex 583ae0f34b..ce0af1adb4 100644--- a/crates/openhuman-core/src/channels/tests/common.rs+++ b/crates/openhuman-core/src/channels/tests/common.rs@@ -1,4 +1,4 @@-use crate::channels::{traits, Channel, SendMessage};+use crate::channels::{Channel, SendMessage, traits};use std::sync::atomic::{AtomicUsize, Ordering};use std::sync::{Arc, Mutex};use std::time::Duration;diff --git a/crates/openhuman-core/src/channels/tests/discord_integration.rs b/crates/openhuman-core/src/channels/tests/discord_integration.rsindex ef5f47e3c0..9d3a6aba57 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::{- conversation_history_key, ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS,+ CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext, conversation_history_key,};use super::super::runtime::process_channel_message;use super::super::traits;diff --git a/crates/openhuman-core/src/channels/tests/health.rs b/crates/openhuman-core/src/channels/tests/health.rsindex 93d856cdca..b891760032 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::runtime::spawn_supervised_listener;-use super::super::{traits, Channel};+use super::super::{Channel, traits};use super::common::AlwaysFailChannel;-use std::sync::atomic::{AtomicUsize, Ordering};use std::sync::Arc;+use std::sync::atomic::{AtomicUsize, Ordering};use std::time::Duration;#[tokio::test]@@ -32,10 +32,12 @@ 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 16fe198fa0..e49f5f2564 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::{build_system_prompt, BOOTSTRAP_MAX_CHARS};+use crate::agent::context::channels_prompt::{BOOTSTRAP_MAX_CHARS, build_system_prompt};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 b991b62879..825824dce9 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::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};-use super::super::runtime::test_support::{run_dispatch_harness, DispatchHarnessOptions};+use super::super::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};+use super::super::runtime::test_support::{DispatchHarnessOptions, run_dispatch_harness};use super::super::runtime::{- process_channel_message, run_message_dispatch_loop, RuntimeChannelMessage,+ RuntimeChannelMessage, process_channel_message, run_message_dispatch_loop,};-use super::super::{traits, Channel};-use super::common::{use_real_agent_handler, RecordingChannel, SlowModel};-use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};+use super::super::{Channel, traits};+use super::common::{RecordingChannel, SlowModel, use_real_agent_handler};+use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};use crate::core::events::DomainEvent;use crate::inference::provider;use std::collections::HashMap;@@ -616,8 +616,10 @@ 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 19f9164e8a..4cb2229bce 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::context::{- conversation_history_key, ChannelRouteSelection, ChannelRuntimeContext,- CHANNEL_MESSAGE_TIMEOUT_SECS,+ CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRouteSelection, ChannelRuntimeContext,+ conversation_history_key,};use super::super::runtime::process_channel_message;-use super::super::{traits, Channel};+use super::super::{Channel, traits};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 9c7c764e32..5379c48357 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::{- conversation_history_key, ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS,+ CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext, conversation_history_key,};use super::super::runtime::process_channel_message;use super::super::traits;