Skip to content

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

chore: reorder imports and derive channel provider descriptors from config

Steven Enamakel422520c7a090
diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rs
index 895866a3d5..e85850cd2d 100644
--- a/crates/openhuman-core/src/channels/routes.rs
+++ b/crates/openhuman-core/src/channels/routes.rs
@@ -2,19 +2,27 @@
use super::context::{clear_sender_history, ChannelRouteSelection, ChannelRuntimeContext};
use super::{outbound::text_message, Channel};
-use crate::inference::provider;
use std::sync::Arc;
use tinychannels_bus as traits;
use tinychannels_bus::module_control::{
ChannelControlRequest, ChannelControlResult, ProviderDescriptor,
};
-fn provider_descriptors() -> Vec<ProviderDescriptor> {
- provider::list_providers()
- .into_iter()
+fn provider_descriptors(config: &crate::config::Config) -> Vec<ProviderDescriptor> {
+ config
+ .cloud_providers
+ .iter()
.map(|provider| ProviderDescriptor {
- name: provider.name.to_string(),
- aliases: provider.aliases.iter().map(ToString::to_string).collect(),
+ name: provider.slug.clone(),
+ aliases: if crate::config::schema::cloud_providers::is_hosted_cloud_identity(
+ &provider.slug,
+ ) || crate::config::schema::cloud_providers::is_hosted_auth_style(
+ provider.auth_style,
+ ) {
+ vec!["backend".to_string(), "openhuman-backend".to_string()]
+ } else {
+ Vec::new()
+ },
})
.collect()
}
@@ -203,7 +211,12 @@ pub(crate) async fn handle_runtime_command_if_needed(
model: current.model,
},
history_len,
- providers: provider_descriptors(),
+ providers: self
+ .context
+ .config
+ .as_deref()
+ .map(provider_descriptors)
+ .unwrap_or_default(),
},),
)
.await;
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.rs
index 3f389db98d..913640ad98 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::Channel;
-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;
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/processor/admit.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/admit.rs
index ecfc057963..4843f733d9 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/admit.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/admit.rs
@@ -10,8 +10,8 @@ use crate::util::truncate_with_ellipsis;
use std::sync::Arc;
use tinychannels_bus::ChannelInboundEnvelope;
-use super::RuntimeChannelMessage;
use super::approval::{channel_has_approval_surface, try_route_approval_reply};
+use super::RuntimeChannelMessage;
/// A prepared inbound message that still needs an agent turn: not a runtime
/// command and not an approval reply.
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
index e732589d1f..6e2b9c73f4 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
@@ -4,7 +4,7 @@
use crate::agent::bus::AgentTurnResponse;
use crate::channels::context::{
- ChannelRuntimeContext, compact_sender_history, is_context_window_overflow_error,
+ compact_sender_history, is_context_window_overflow_error, ChannelRuntimeContext,
};
use crate::channels::outbound::text_message;
use crate::channels::routes::{get_or_create_turn_model_source, get_route_selection};
@@ -15,20 +15,20 @@ use crate::util::truncate_with_ellipsis;
use std::sync::Arc;
use std::time::{Duration, Instant};
use tinyagents_session::transcript::TranscriptMessage;
-use tinychannels_bus::ChannelInboundEnvelope;
use tinychannels_bus::context::ChatMessage;
+use tinychannels_bus::ChannelInboundEnvelope;
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, HostChannelTurn, HostRoute, run_host_agent_turn, seed_rows};
-use super::RuntimeChannelMessage;
-use super::admit::{AdmittedInbound, admit_runtime_message};
+use super::super::host_agent::{self, run_host_agent_turn, seed_rows, HostChannelTurn, HostRoute};
+use super::admit::{admit_runtime_message, AdmittedInbound};
use super::approval::channel_has_approval_surface;
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/startup/module_providers.rs b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
index 2639ed3dd9..6a549d9bd0 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
@@ -10,11 +10,11 @@ use async_trait::async_trait;
use std::collections::HashMap;
use std::sync::{Arc, OnceLock, Weak};
use tinybus::module::{ModuleCallError, ModuleClient, ModuleObjectClient};
-use tinychannels_bus::Channel;
use tinychannels_bus::module_runtime::{
ChannelIngressKind, ChannelMessagePreparation, ConfiguredChannelInfo,
};
use tinychannels_bus::module_supervision::ChannelSupervisionPolicy;
+use tinychannels_bus::Channel;
use tinychannels_bus::{ChannelInteraction, ChannelInteractionResult};
use tokio::sync::mpsc;
diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
index 3a21ab2e91..473621dc38 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/test_support.rs b/crates/openhuman-core/src/channels/runtime/test_support.rs
index 2693a031cb..8c0092b9ca 100644
--- a/crates/openhuman-core/src/channels/runtime/test_support.rs
+++ b/crates/openhuman-core/src/channels/runtime/test_support.rs
@@ -1,12 +1,12 @@
//! Debug-build harnesses for raw integration coverage of the channel runtime.
pub use super::dispatch::test_support::build_channel_context_block_for_test;
-use super::dispatch::{RuntimeChannelMessage, process_channel_runtime_message};
+use super::dispatch::{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::Channel;
use crate::channels::ChannelSystemPrompt;
-use crate::channels::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};
use crate::config::{MultimodalConfig, MultimodalFileConfig, ReliabilityConfig};
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
@@ -500,10 +500,8 @@ pub async fn run_dispatch_harness(options: DispatchHarnessOptions) -> DispatchHa
}],
..Default::default()
});
- let timestamp = message.timestamp_unix_ms.unwrap_or_default();
let prepared = tinychannels_bus::module_inbound::PreparedChannelInbound {
- message: tinychannels::legacy_message_from_inbound_envelope(&message, timestamp)
- .unwrap_or_default(),
+ message: crate::channels::routes::route_compat_message(&message),
envelope: message.clone(),
history_key: history_key.clone(),
history_key_ignores_thread: expected_event_channel == "telegram",
diff --git a/crates/openhuman-core/src/channels/tests/discord_integration.rs b/crates/openhuman-core/src/channels/tests/discord_integration.rs
index 849c3c9248..fef9a24605 100644
--- a/crates/openhuman-core/src/channels/tests/discord_integration.rs
+++ b/crates/openhuman-core/src/channels/tests/discord_integration.rs
@@ -23,12 +23,12 @@
//! ever reverts to calling `run_tool_call_loop` directly, this test
//! starts failing.
-use super::super::Channel;
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::common::{HistoryCaptureModel, channel_envelope};
+use super::super::Channel;
+use super::common::{channel_envelope, HistoryCaptureModel};
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
diff --git a/crates/openhuman-core/src/channels/tests/runtime_debounce.rs b/crates/openhuman-core/src/channels/tests/runtime_debounce.rs
index 67d6a2b921..82c2a5a43e 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_debounce.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_debounce.rs
@@ -1,15 +1,15 @@
+use super::super::context::{ChannelRuntimeContext, CHANNEL_MESSAGE_TIMEOUT_SECS};
+use super::super::runtime::{run_message_dispatch_loop, RuntimeChannelMessage};
use super::super::Channel;
-use super::super::context::{CHANNEL_MESSAGE_TIMEOUT_SECS, ChannelRuntimeContext};
-use super::super::runtime::{RuntimeChannelMessage, run_message_dispatch_loop};
-use super::common::{RecordingChannel, SlowModel, TelegramRecordingChannel, channel_envelope};
-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};
+use super::common::{channel_envelope, RecordingChannel, SlowModel, TelegramRecordingChannel};
+use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};
use crate::config::InboundDebounceConfig;
use crate::core::bus_testing::MockBusGuard;
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
use std::time::Duration;
-use tokio::sync::{Notify, mpsc};
+use tokio::sync::{mpsc, Notify};
use tokio::task::JoinHandle;
#[derive(Default)]
@@ -151,11 +151,7 @@ impl Running {
let message = self.message(sender, content);
let history_key = format!("{}_{sender}_{sender}", self.channel);
let prepared = tinychannels_bus::module_inbound::PreparedChannelInbound {
- message: tinychannels::legacy_message_from_inbound_envelope(
- &message,
- message.timestamp_unix_ms.unwrap_or_default(),
- )
- .expect("text fixture projects to the legacy prepared message"),
+ message: crate::channels::routes::route_compat_message(&message),
envelope: message.clone(),
history_key: history_key.clone(),
history_key_ignores_thread: false,
@@ -256,16 +252,12 @@ async fn messages_during_a_running_turn_become_one_follow_up_that_sees_its_histo
assert_eq!(turns.peak.load(Ordering::SeqCst), 1);
assert!(turns.last_user(1).ends_with("second\nthird"));
let history = turns.history(1);
- assert!(
- history
- .iter()
- .any(|(role, content)| role == "assistant" && content == "reply 1")
- );
- assert!(
- history
- .iter()
- .any(|(role, content)| role == "user" && content.ends_with("first"))
- );
+ assert!(history
+ .iter()
+ .any(|(role, content)| role == "assistant" && content == "reply 1"));
+ assert!(history
+ .iter()
+ .any(|(role, content)| role == "user" && content.ends_with("first")));
run.finish().await;
assert_eq!(channel.sent_messages.lock().await.len(), 2);
}
diff --git a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
index e5b2679601..e8e6c5ce21 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, channel_envelope, use_real_agent_handler};
-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, mock_agent_run_turn};
+use super::super::Channel;
+use super::common::{channel_envelope, use_real_agent_handler, RecordingChannel, SlowModel};
+use crate::agent::bus::{mock_agent_run_turn, AgentTurnRequest, AgentTurnResponse};
use crate::core::events::DomainEvent;
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
@@ -685,10 +685,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.rs
index 86a9a6d6ef..db4f8cf6bd 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
@@ -1,12 +1,12 @@
-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, channel_envelope,
+ channel_envelope, IterativeToolModel, MockPriceTool, ModelCaptureModel, RecordingChannel,
+ TelegramRecordingChannel, ToolCallingModel,
};
use std::collections::HashMap;
use std::sync::atomic::Ordering;
diff --git a/crates/openhuman-core/src/channels/tests/telegram_integration.rs b/crates/openhuman-core/src/channels/tests/telegram_integration.rs
index 86ade440f1..3678a472c3 100644
--- a/crates/openhuman-core/src/channels/tests/telegram_integration.rs
+++ b/crates/openhuman-core/src/channels/tests/telegram_integration.rs
@@ -5,12 +5,12 @@
//! captures every `SendMessage` — including `thread_ts` — so assertions can be made
//! about exactly what the channel receives, without needing a real Telegram HTTP server.
-use super::super::Channel;
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::common::{SlowModel, channel_envelope};
+use super::super::Channel;
+use super::common::{channel_envelope, SlowModel};
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
diff --git a/crates/openhuman-core/src/core/all_bound_controller_tests.rs b/crates/openhuman-core/src/core/all_bound_controller_tests.rs
index 3fbfbc4907..158ad76c82 100644
--- a/crates/openhuman-core/src/core/all_bound_controller_tests.rs
+++ b/crates/openhuman-core/src/core/all_bound_controller_tests.rs
@@ -1,8 +1,8 @@
use super::*;
-use crate::core::{FieldSchema, TypeSchema, runtime::DispatchCtx};
+use crate::core::{runtime::DispatchCtx, FieldSchema, TypeSchema};
use std::sync::{
- Mutex,
atomic::{AtomicUsize, Ordering},
+ Mutex,
};
static CALLS: AtomicUsize = AtomicUsize::new(0);
@@ -101,11 +101,9 @@ fn production_registry_binds_every_socket_controller_to_its_declared_parser() {
contracts.len(),
"complete raw socket inventory"
);
- assert!(
- entries
- .iter()
- .all(|entry| entry.schema.namespace == "socket")
- );
+ assert!(entries
+ .iter()
+ .all(|entry| entry.schema.namespace == "socket"));
assert_eq!(
entries
.iter()
@@ -441,11 +439,9 @@ fn production_registry_binds_mcp_registry_get_to_its_declared_parser() {
.filter(|grouped| grouped.controller.schema.method_name() == "mcp_clients.registry_get")
.collect();
assert_eq!(entries.len(), 1, "registry_get has one public raw entry");
- assert!(
- !internal_registry()
- .iter()
- .any(|grouped| grouped.controller.schema.method_name() == "mcp_clients.registry_get")
- );
+ assert!(!internal_registry()
+ .iter()
+ .any(|grouped| grouped.controller.schema.method_name() == "mcp_clients.registry_get"));
let grouped = entries[0];
assert_eq!(grouped.group, DomainGroup::Mcp);
let entry = &grouped.controller;
@@ -479,11 +475,9 @@ fn production_registry_binds_mcp_registry_get_to_its_declared_parser() {
.expect("positive contract includes its required input")
.required = false;
}
- assert!(
- required_input_contract(&broken, contract.required)
- .unwrap_err()
- .contains("required inputs mismatch")
- );
+ assert!(required_input_contract(&broken, contract.required)
+ .unwrap_err()
+ .contains("required inputs mismatch"));
}
}
@@ -501,11 +495,9 @@ fn production_registry_binds_computer_status_to_its_declared_parser() {
1,
"computer_status has one internal raw registry entry"
);
- assert!(
- !registry()
- .iter()
- .any(|grouped| grouped.controller.schema.method_name() == "modules.computer_status")
- );
+ assert!(!registry()
+ .iter()
+ .any(|grouped| grouped.controller.schema.method_name() == "modules.computer_status"));
let grouped = entries[0];
assert_eq!(grouped.group, DomainGroup::Modules);
let entry = &grouped.controller;
@@ -585,11 +577,9 @@ fn production_registry_binds_composio_execute_to_its_declared_parser() {
.expect("independent required-field contract matches production schema");
let mut missing_required = entry.schema.clone();
missing_required.inputs.retain(|field| field.name != "tool");
- assert!(
- required_input_contract(&missing_required, &["tool"])
- .unwrap_err()
- .contains("required inputs mismatch")
- );
+ assert!(required_input_contract(&missing_required, &["tool"])
+ .unwrap_err()
+ .contains("required inputs mismatch"));
let mut optional_required = entry.schema.clone();
optional_required
.inputs
@@ -597,11 +587,9 @@ fn production_registry_binds_composio_execute_to_its_declared_parser() {
.find(|field| field.name == "tool")
.expect("tool schema field")
.required = false;
- assert!(
- required_input_contract(&optional_required, &["tool"])
- .unwrap_err()
- .contains("required inputs mismatch")
- );
+ assert!(required_input_contract(&optional_required, &["tool"])
+ .unwrap_err()
+ .contains("required inputs mismatch"));
for example in [
json!({"tool":"GMAIL_SEND_EMAIL"}),
diff --git a/crates/openhuman-core/src/core/all_bound_registry_contract_tests.rs b/crates/openhuman-core/src/core/all_bound_registry_contract_tests.rs
index fe1424283d..06b6ac7299 100644
--- a/crates/openhuman-core/src/core/all_bound_registry_contract_tests.rs
+++ b/crates/openhuman-core/src/core/all_bound_registry_contract_tests.rs
@@ -1,4 +1,4 @@
-use super::registry_test_support::{BoundFamilyWireContract, verify_family_contract};
+use super::registry_test_support::{verify_family_contract, BoundFamilyWireContract};
use super::*;
#[test]
@@ -55,16 +55,14 @@ fn family_verifier_rejects_group_visibility_and_inventory_mutations() {
.unwrap_err()
.contains("wrong domain group")
);
- assert!(
- verify_family_contract(
- std::slice::from_ref(&good),
- std::slice::from_ref(&good),
- &contract,
- &fixtures
- )
- .unwrap_err()
- .contains("internal registry")
- );
+ assert!(verify_family_contract(
+ std::slice::from_ref(&good),
+ std::slice::from_ref(&good),
+ &contract,
+ &fixtures
+ )
+ .unwrap_err()
+ .contains("internal registry"));
for (methods, message) in [
(
diff --git a/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs b/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs
index 981bc9cb19..16c958cdcb 100644
--- a/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs
+++ b/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs
@@ -1,6 +1,6 @@
//! The dispatch context reaches the handler as an argument, per call.
-use serde_json::{Map, Value, json};
+use serde_json::{json, Map, Value};
use super::*;
use crate::core::runtime::{CoreContext, DispatchCtx, DomainSet};
diff --git a/crates/openhuman-core/src/core/all_entry.rs b/crates/openhuman-core/src/core/all_entry.rs
index 43cffeabc4..6cacec652b 100644
--- a/crates/openhuman-core/src/core/all_entry.rs
+++ b/crates/openhuman-core/src/core/all_entry.rs
@@ -4,8 +4,8 @@ use std::{future::Future, pin::Pin, sync::Arc};
use serde_json::{Map, Value};
-use crate::core::ControllerSchema;
use crate::core::runtime::DispatchCtx;
+use crate::core::ControllerSchema;
/// A pinned, boxed future returned by a controller handler.
pub type ControllerFuture = Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'static>>;
diff --git a/crates/openhuman-core/src/core/all_extensions_tests.rs b/crates/openhuman-core/src/core/all_extensions_tests.rs
index 7626dfc05b..b77961284f 100644
--- a/crates/openhuman-core/src/core/all_extensions_tests.rs
+++ b/crates/openhuman-core/src/core/all_extensions_tests.rs
@@ -31,11 +31,9 @@ async fn registry_extension_is_visible_to_every_lookup_and_dispatches() {
Some("openhuman.ext_probe_ping")
);
assert!(schema_for_rpc_method("openhuman.ext_probe_ping").is_some());
- assert!(
- all_controller_schemas()
- .iter()
- .any(|s| s.namespace == "ext_probe" && s.function == "ping")
- );
+ assert!(all_controller_schemas()
+ .iter()
+ .any(|s| s.namespace == "ext_probe" && s.function == "ping"));
assert_eq!(
namespace_description("ext_probe"),
Some("Registry extension probe.")
diff --git a/crates/openhuman-core/src/core/all_invoke.rs b/crates/openhuman-core/src/core/all_invoke.rs
index 8afacee0fa..6de319ac4a 100644
--- a/crates/openhuman-core/src/core/all_invoke.rs
+++ b/crates/openhuman-core/src/core/all_invoke.rs
@@ -5,7 +5,7 @@ use std::pin::Pin;
use serde_json::{Map, Value};
-use super::{ControllerFuture, internal_registry, registry_view, visible};
+use super::{internal_registry, registry_view, visible, ControllerFuture};
use crate::core::runtime::{CoreContext, DispatchCtx};
type Dispatched = Pin<Box<dyn Future<Output = Option<Result<Value, String>>> + Send + 'static>>;
diff --git a/crates/openhuman-core/src/core/all_keyring_consent_controller_tests.rs b/crates/openhuman-core/src/core/all_keyring_consent_controller_tests.rs
index 18713830e5..0ceda2b258 100644
--- a/crates/openhuman-core/src/core/all_keyring_consent_controller_tests.rs
+++ b/crates/openhuman-core/src/core/all_keyring_consent_controller_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use serde_json::{Map, json};
+use serde_json::{json, Map};
fn keyring_consent_entries() -> Vec<ControllerEntry> {
registry()
diff --git a/crates/openhuman-core/src/core/all_registry_tests.rs b/crates/openhuman-core/src/core/all_registry_tests.rs
index eda36df7a1..8d24e9038f 100644
--- a/crates/openhuman-core/src/core/all_registry_tests.rs
+++ b/crates/openhuman-core/src/core/all_registry_tests.rs
@@ -2,7 +2,7 @@ use super::*;
#[tokio::test]
async fn doctor_report_is_in_both_scoped_saas_dispatch_and_schema_surfaces() {
- use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet, Mode, mode};
+ use crate::core::runtime::{mode, ContextOverlay, CoreContext, DomainSet, Mode};
const CHILD: &str = "OPENHUMAN_SAAS_DOCTOR_SURFACE_CHILD";
let name = "doctor_report_is_in_both_scoped_saas_dispatch_and_schema_surfaces";
@@ -81,17 +81,13 @@ async fn doctor_report_is_in_both_scoped_saas_dispatch_and_schema_surfaces() {
assert!(operator_schemas.iter().any(|method| method == doctor));
assert!(user_methods.iter().any(|method| method == doctor));
assert!(user_schemas.iter().any(|method| method == doctor));
- assert!(
- !operator_methods
- .iter()
- .any(|method| method == doctor_models)
- );
+ assert!(!operator_methods
+ .iter()
+ .any(|method| method == doctor_models));
assert!(!user_methods.iter().any(|method| method == doctor_models));
- assert!(
- !user_methods
- .iter()
- .any(|method| method == "openhuman.config_get_config")
- );
+ assert!(!user_methods
+ .iter()
+ .any(|method| method == "openhuman.config_get_config"));
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/core/all_schema_contract_tests.rs b/crates/openhuman-core/src/core/all_schema_contract_tests.rs
index 5474cff300..4f7df67f7d 100644
--- a/crates/openhuman-core/src/core/all_schema_contract_tests.rs
+++ b/crates/openhuman-core/src/core/all_schema_contract_tests.rs
@@ -40,11 +40,9 @@ fn registered_memory_contract_rejects_missing_or_optional_question() {
.expect("real recall schema declares question")
.required = false;
}
- assert!(
- independent_registered_schema_contract(&broken)
- .unwrap_err()
- .contains("memory.recall required inputs mismatch")
- );
+ assert!(independent_registered_schema_contract(&broken)
+ .unwrap_err()
+ .contains("memory.recall required inputs mismatch"));
}
}
@@ -142,11 +140,9 @@ fn registered_wallet_schema_contract_rejects_missing_encrypted_mnemonic() {
.inputs
.retain(|input| input.name != "encryptedMnemonic");
- assert!(
- independent_registered_schema_contract(&schema)
- .unwrap_err()
- .contains("is missing required input `encryptedMnemonic`")
- );
+ assert!(independent_registered_schema_contract(&schema)
+ .unwrap_err()
+ .contains("is missing required input `encryptedMnemonic`"));
}
/// Built-in/internal snapshots avoid ambient DomainSet filtering and global
@@ -166,14 +162,10 @@ fn optional_domain_controller_methods_are_absent_when_features_are_disabled() {
.into_iter()
.map(|controller| controller.schema.method_name())
.collect::<Vec<_>>();
- assert!(
- !methods
- .iter()
- .any(|method| method == "mcp_clients.registry_get")
- );
- assert!(
- !methods
- .iter()
- .any(|method| method == "modules.computer_status")
- );
+ assert!(!methods
+ .iter()
+ .any(|method| method == "mcp_clients.registry_get"));
+ assert!(!methods
+ .iter()
+ .any(|method| method == "modules.computer_status"));
}
diff --git a/crates/openhuman-core/src/core/all_tests.rs b/crates/openhuman-core/src/core/all_tests.rs
index 74822ffd29..c1cd50f25f 100644
--- a/crates/openhuman-core/src/core/all_tests.rs
+++ b/crates/openhuman-core/src/core/all_tests.rs
@@ -856,8 +856,8 @@ fn every_registered_controller_has_matching_declared_schema() {
// --- DomainSet registration filter (#4796) ------------------------------
-use crate::core::runtime::DomainSet;
use crate::core::runtime::context::CoreContext;
+use crate::core::runtime::DomainSet;
/// The [`DomainGroup`] a registered controller (agent-facing OR internal) is
/// tagged with, looked up by its namespace. Test-only helper over the private
diff --git a/crates/openhuman-core/src/core/all_tool_registry_controller_tests.rs b/crates/openhuman-core/src/core/all_tool_registry_controller_tests.rs
index 9ff8a6b7d6..3749e6e295 100644
--- a/crates/openhuman-core/src/core/all_tool_registry_controller_tests.rs
+++ b/crates/openhuman-core/src/core/all_tool_registry_controller_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use serde_json::{Map, json};
+use serde_json::{json, Map};
fn tool_registry_entries() -> Vec<ControllerEntry> {
registry()
diff --git a/crates/openhuman-core/src/core/schema_test_support_tests.rs b/crates/openhuman-core/src/core/schema_test_support_tests.rs
index 9eabe02008..fbab7c2261 100644
--- a/crates/openhuman-core/src/core/schema_test_support_tests.rs
+++ b/crates/openhuman-core/src/core/schema_test_support_tests.rs
@@ -78,11 +78,9 @@ fn contract_inventory_rejects_missing_extra_duplicate_and_empty_rows() {
.unwrap_err()
.contains("duplicate contract")
);
- assert!(
- verify_parameter_contracts(&[], &[])
- .unwrap_err()
- .contains("empty")
- );
+ assert!(verify_parameter_contracts(&[], &[])
+ .unwrap_err()
+ .contains("empty"));
}
#[test]
@@ -151,38 +149,30 @@ fn missing_examples_and_actual_parser_rejection_are_not_hidden() {
);
let mut broken = contract;
broken.examples = vec![serde_json::json!({"id":7})];
- assert!(
- verify_parameter_contracts(&[controller], &[broken])
- .unwrap_err()
- .contains("schema rejects example")
- );
+ assert!(verify_parameter_contracts(&[controller], &[broken])
+ .unwrap_err()
+ .contains("schema rejects example"));
}
#[test]
fn duplicate_controller_and_schema_identity_failures_are_rejected() {
let (controller, contract) = fixture();
- assert!(
- verify_parameter_contracts(
- &[controller.clone(), controller.clone()],
- std::slice::from_ref(&contract)
- )
- .unwrap_err()
- .contains("duplicate controller")
- );
+ assert!(verify_parameter_contracts(
+ &[controller.clone(), controller.clone()],
+ std::slice::from_ref(&contract)
+ )
+ .unwrap_err()
+ .contains("duplicate controller"));
let mut broken = controller.schema.clone();
broken.function = "other";
- assert!(
- verify_parameter_schema(&broken, &contract)
- .unwrap_err()
- .contains("method identity")
- );
+ assert!(verify_parameter_schema(&broken, &contract)
+ .unwrap_err()
+ .contains("method identity"));
let mut broken = controller.schema;
broken.description = " ";
- assert!(
- verify_parameter_schema(&broken, &contract)
- .unwrap_err()
- .contains("no description")
- );
+ assert!(verify_parameter_schema(&broken, &contract)
+ .unwrap_err()
+ .contains("no description"));
}
#[test]
@@ -192,28 +182,22 @@ fn legacy_entries_are_rejected_without_running_the_legacy_handler() {
schema: bound.schema,
handler: legacy_handler,
});
- assert!(
- verify_parameter_contracts(&[legacy], &[contract])
- .unwrap_err()
- .contains("registry entry is legacy")
- );
+ assert!(verify_parameter_contracts(&[legacy], &[contract])
+ .unwrap_err()
+ .contains("registry entry is legacy"));
}
#[test]
fn examples_must_be_objects_and_satisfy_schema_before_decoding() {
let (controller, mut contract) = fixture();
contract.examples = vec![Value::Null];
- assert!(
- verify_parameter_schema(&controller.schema, &contract)
- .unwrap_err()
- .contains("not an object")
- );
+ assert!(verify_parameter_schema(&controller.schema, &contract)
+ .unwrap_err()
+ .contains("not an object"));
contract.examples = vec![serde_json::json!({})];
- assert!(
- verify_parameter_schema(&controller.schema, &contract)
- .unwrap_err()
- .contains("schema rejects example")
- );
+ assert!(verify_parameter_schema(&controller.schema, &contract)
+ .unwrap_err()
+ .contains("schema rejects example"));
}
#[test]
@@ -272,11 +256,9 @@ fn wire_field_contract_pins_count_order_type_and_requiredness() {
.unwrap_err()
.contains("name mismatch")
);
- assert!(
- verify_wire_fields(std::slice::from_ref(&field), &[])
- .unwrap_err()
- .contains("count mismatch")
- );
+ assert!(verify_wire_fields(std::slice::from_ref(&field), &[])
+ .unwrap_err()
+ .contains("count mismatch"));
let wrong_required = [("items", expected[0].1.clone(), true)];
assert!(
verify_wire_fields(std::slice::from_ref(&field), &wrong_required)
@@ -314,9 +296,7 @@ fn wire_field_contract_pins_count_order_type_and_requiredness() {
("first", crate::core::TypeSchema::String, true),
("second", crate::core::TypeSchema::Bool, true),
];
- assert!(
- verify_wire_fields(&reversed, &ordered)
- .unwrap_err()
- .contains("name mismatch")
- );
+ assert!(verify_wire_fields(&reversed, &ordered)
+ .unwrap_err()
+ .contains("name mismatch"));
}
diff --git a/crates/openhuman-core/src/threads/store/bus.rs b/crates/openhuman-core/src/threads/store/bus.rs
index 8215270bc8..13f5cbb954 100644
--- a/crates/openhuman-core/src/threads/store/bus.rs
+++ b/crates/openhuman-core/src/threads/store/bus.rs
@@ -39,7 +39,7 @@ use tinychannels_bus::{
use tinychannels_runtime::context::conversation_history_key_parts;
use super::{
- ConversationMessage, CreateConversationThread, append_message, ensure_thread, get_messages,
+ append_message, ensure_thread, get_messages, ConversationMessage, CreateConversationThread,
};
static CONVERSATION_PERSISTENCE_HANDLE: OnceLock<SubscriptionHandle> = OnceLock::new();
diff --git a/crates/openhuman-tinyhumans/src/channels/delivery.rs b/crates/openhuman-tinyhumans/src/channels/delivery.rs
index af3d20de29..e7a426e3a5 100644
--- a/crates/openhuman-tinyhumans/src/channels/delivery.rs
+++ b/crates/openhuman-tinyhumans/src/channels/delivery.rs
@@ -6,10 +6,10 @@
use openhuman_embed::__host::channel_callback::ChannelCallbackCtx;
use openhuman_embed::__host::security::credentials::session_support::{
- BackendCredential, get_session_token, is_local_session_token,
+ get_session_token, is_local_session_token, BackendCredential,
};
use reqwest::Method;
-use serde_json::{Map, Value, json};
+use serde_json::{json, Map, Value};
use tinychannels_bus::module_progressive::{
ProgressiveTransportRequest, ProgressiveTransportResult,
};