Skip to content

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

style: apply rustfmt import ordering and line wrapping

Steven Enamakeld5bfaa6ae1e9
diff --git a/crates/openhuman-core/src/config/mod.rs b/crates/openhuman-core/src/config/mod.rs
index 008413f578..9a8ce4b330 100644
--- a/crates/openhuman-core/src/config/mod.rs
+++ b/crates/openhuman-core/src/config/mod.rs
@@ -51,19 +51,19 @@ pub use schema::{
LarkConfig, LegacySearchInputs, LinqConfig, LocalAiConfig, LocalJailConfig, MatrixConfig,
McpAuthConfig, McpClientConfig, McpClientIdentityConfig, McpServerConfig, McpToolExposure,
MemoryConfig, MemoryLayoutMode, ModelRouteConfig, MultimodalConfig, MultimodalFileConfig,
- ObservabilityConfig, OrchestratorModelConfig, PrivacyConfig, PrivacyMode, ProxyConfig,
- ProxyScope, ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig, SandboxBackend,
- SandboxConfig, SchedulerConfig, SchedulerGateConfig, SchedulerGateMode, SearchConfig,
- SearchEngineCredentials, SearchHostCredential, PresentationMode, SearchProviderSettings,
- ProviderRoute, SearxngConfig, SecretsConfig, SecurityConfig, ShellConfig, SlackConfig,
- StreamMode, SttEngine, TeamModelConfig, TelegramConfig, TokenjuiceConfig,
- UnknownKeyedSearchProvider, UpdateConfig, UpdateRestartStrategy, VoiceActivationMode,
- VoiceServerConfig, WebSearchConfig, WebhookConfig, YuanbaoConfig, DEFAULT_MODEL,
- LEGACY_TIER_MODELS, MANAGED_MULTIMODAL_MODELS, MANAGED_SEARCH_PROVIDERS,
- MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT, MODEL_MEDIA_UNDERSTANDING,
- MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE, SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA,
- SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY,
- SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER, SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
+ ObservabilityConfig, OrchestratorModelConfig, PresentationMode, PrivacyConfig, PrivacyMode,
+ ProviderRoute, ProxyConfig, ProxyScope, ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig,
+ SandboxBackend, SandboxConfig, SchedulerConfig, SchedulerGateConfig, SchedulerGateMode,
+ SearchConfig, SearchEngineCredentials, SearchHostCredential, SearchProviderSettings,
+ SearxngConfig, SecretsConfig, SecurityConfig, ShellConfig, SlackConfig, StreamMode, SttEngine,
+ TeamModelConfig, TelegramConfig, TokenjuiceConfig, UnknownKeyedSearchProvider, UpdateConfig,
+ UpdateRestartStrategy, VoiceActivationMode, VoiceServerConfig, WebSearchConfig, WebhookConfig,
+ YuanbaoConfig, DEFAULT_MODEL, LEGACY_TIER_MODELS, MANAGED_MULTIMODAL_MODELS,
+ MANAGED_SEARCH_PROVIDERS, MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT,
+ MODEL_MEDIA_UNDERSTANDING, MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE,
+ SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL,
+ SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER,
+ SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
};
// Kept as a separate re-export (issue #4117) so the large alphabetized group
// above stays byte-identical and rustfmt-stable.
diff --git a/crates/openhuman-core/src/config/ops/search_tests.rs b/crates/openhuman-core/src/config/ops/search_tests.rs
index f50efa8ec4..d7561a5079 100644
--- a/crates/openhuman-core/src/config/ops/search_tests.rs
+++ b/crates/openhuman-core/src/config/ops/search_tests.rs
@@ -219,5 +219,8 @@ fn settings_report_the_search_component_as_disabled() {
.as_str()
.unwrap()
.starts_with("COMPONENT_DISABLED:search"));
- assert!(off["effective_roles"]["search"].as_array().unwrap().is_empty());
+ assert!(off["effective_roles"]["search"]
+ .as_array()
+ .unwrap()
+ .is_empty());
}
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs
index f77485a4c3..ec7e4e5480 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs
@@ -4,7 +4,7 @@
use crate::config::schema::load::env::parse_env_bool;
use crate::config::schema::load::env::EnvLookup;
use crate::config::schema::{
- Config, PresentationMode, SearchProviderSettings, ProviderRoute, MANAGED_SEARCH_PROVIDERS,
+ Config, PresentationMode, ProviderRoute, SearchProviderSettings, MANAGED_SEARCH_PROVIDERS,
SEARCH_PROVIDERS, SEARCH_ROLES,
};
@@ -97,9 +97,10 @@ impl Config {
let mut providers = std::collections::BTreeMap::new();
for entry in names.split(',').map(str::trim).filter(|e| !e.is_empty()) {
let (name, route) = match entry.split_once(':') {
- Some((name, route)) => {
- (name.trim().to_ascii_lowercase(), ProviderRoute::parse(route))
- }
+ Some((name, route)) => (
+ name.trim().to_ascii_lowercase(),
+ ProviderRoute::parse(route),
+ ),
None => (entry.to_ascii_lowercase(), None),
};
if name == "managed" {
diff --git a/crates/openhuman-core/src/config/schema/mod.rs b/crates/openhuman-core/src/config/schema/mod.rs
index c16b32d981..270938843a 100644
--- a/crates/openhuman-core/src/config/schema/mod.rs
+++ b/crates/openhuman-core/src/config/schema/mod.rs
@@ -122,13 +122,13 @@ pub use tools::{
ComposioHostCredential, CurlConfig, GitbooksConfig, HttpHeader, HttpRequestConfig,
IntegrationToggle, IntegrationsConfig, LegacySearchInputs, McpAuthConfig, McpClientConfig,
McpClientIdentityConfig, McpServerConfig, McpToolExposure, MultimodalConfig,
- MultimodalFileConfig, SearchConfig, SearchEngineCredentials, SearchHostCredential,
- PresentationMode, SearchProviderSettings, ProviderRoute, SearxngConfig, SecretsConfig,
- SeltzConfig, UnknownKeyedSearchProvider, WebSearchConfig, COMPOSIO_MODE_BACKEND,
- COMPOSIO_MODE_DIRECT, COMPOSIO_MODE_DISABLED, MANAGED_SEARCH_PROVIDERS, SEARCH_ENGINE_BRAVE,
- SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL,
- SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER,
- SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
+ MultimodalFileConfig, PresentationMode, ProviderRoute, SearchConfig, SearchEngineCredentials,
+ SearchHostCredential, SearchProviderSettings, SearxngConfig, SecretsConfig, SeltzConfig,
+ UnknownKeyedSearchProvider, WebSearchConfig, COMPOSIO_MODE_BACKEND, COMPOSIO_MODE_DIRECT,
+ COMPOSIO_MODE_DISABLED, MANAGED_SEARCH_PROVIDERS, SEARCH_ENGINE_BRAVE, SEARCH_ENGINE_DISABLED,
+ SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT,
+ SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER, SEARCH_ROLE_CONTENTS,
+ SEARCH_ROLE_SEARCH,
};
pub use update::{UpdateConfig, UpdateRestartStrategy};
pub use web_chat_config::WebChatConfig;
diff --git a/crates/openhuman-core/src/config/schema/tools/mod.rs b/crates/openhuman-core/src/config/schema/tools/mod.rs
index c978e0d2d3..fcda1d5afe 100644
--- a/crates/openhuman-core/src/config/schema/tools/mod.rs
+++ b/crates/openhuman-core/src/config/schema/tools/mod.rs
@@ -20,8 +20,8 @@ pub use mcp::{
};
pub use multimodal::{MultimodalConfig, MultimodalFileConfig};
pub use search::{
- LegacySearchInputs, SearchConfig, SearchEngineCredentials, SearchHostCredential,
- PresentationMode, SearchProviderSettings, ProviderRoute, SearxngConfig, SeltzConfig,
+ LegacySearchInputs, PresentationMode, ProviderRoute, SearchConfig, SearchEngineCredentials,
+ SearchHostCredential, SearchProviderSettings, SearxngConfig, SeltzConfig,
UnknownKeyedSearchProvider, WebSearchConfig, MANAGED_SEARCH_PROVIDERS, SEARCH_ENGINE_BRAVE,
SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL,
SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER,
diff --git a/crates/openhuman-core/src/config/schema/tools/search_host_tests.rs b/crates/openhuman-core/src/config/schema/tools/search_host_tests.rs
index d204655748..d335e7d4e0 100644
--- a/crates/openhuman-core/src/config/schema/tools/search_host_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search_host_tests.rs
@@ -112,7 +112,10 @@ enabled = true
route = "direct"
"#;
let search: SearchConfig = toml::from_str(existing).unwrap();
- assert_eq!(search.presentation, crate::config::PresentationMode::OneProvider);
+ assert_eq!(
+ search.presentation,
+ crate::config::PresentationMode::OneProvider
+ );
assert_eq!(search.route("exa"), ProviderRoute::Backend);
assert_eq!(search.route("brave"), ProviderRoute::Direct);
@@ -120,5 +123,8 @@ route = "direct"
let written = toml::to_string(&search).unwrap();
assert!(written.contains("route = \"managed\""), "{written}");
assert!(!written.contains("backend"), "{written}");
- assert!(written.contains("presentation = \"one_provider\""), "{written}");
+ assert!(
+ written.contains("presentation = \"one_provider\""),
+ "{written}"
+ );
}
diff --git a/crates/openhuman-core/src/config/schema/tools/search_migrate.rs b/crates/openhuman-core/src/config/schema/tools/search_migrate.rs
index f11586c415..112f536dab 100644
--- a/crates/openhuman-core/src/config/schema/tools/search_migrate.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search_migrate.rs
@@ -5,7 +5,7 @@
use std::collections::BTreeMap;
use super::{
- LegacySearchInputs, SearchConfig, SearchProviderSettings, ProviderRoute, SEARCH_ENGINE_BRAVE,
+ LegacySearchInputs, ProviderRoute, SearchConfig, SearchProviderSettings, SEARCH_ENGINE_BRAVE,
SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL,
SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLE_SEARCH,
SEARCH_SCHEMA_PROVIDERS, SEARCH_SCHEMA_VERSION,
@@ -96,7 +96,10 @@ impl SearchConfig {
.unwrap_or(ProviderRoute::Backend);
let mut providers = BTreeMap::new();
let parallel_key = self.parallel.has_key();
- let managed_parallel = self.parallel_route.as_deref().and_then(ProviderRoute::parse)
+ let managed_parallel = self
+ .parallel_route
+ .as_deref()
+ .and_then(ProviderRoute::parse)
== Some(ProviderRoute::Backend);
let mut dropped_parallel = false;
diff --git a/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs b/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
index 933ee35018..5753184a90 100644
--- a/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
@@ -317,8 +317,14 @@ fn enabled_provider_names_skip_disabled_entries() {
#[test]
fn route_and_presentation_parse_accept_legacy_spellings() {
- assert_eq!(ProviderRoute::parse("backend"), Some(ProviderRoute::Backend));
- assert_eq!(ProviderRoute::parse(" Direct "), Some(ProviderRoute::Direct));
+ assert_eq!(
+ ProviderRoute::parse("backend"),
+ Some(ProviderRoute::Backend)
+ );
+ assert_eq!(
+ ProviderRoute::parse(" Direct "),
+ Some(ProviderRoute::Direct)
+ );
assert_eq!(ProviderRoute::parse("other"), None);
assert_eq!(
PresentationMode::parse("all_tools"),
diff --git a/crates/openhuman-core/src/modules/search/config_tests.rs b/crates/openhuman-core/src/modules/search/config_tests.rs
index b73813d220..e9e46f4c2c 100644
--- a/crates/openhuman-core/src/modules/search/config_tests.rs
+++ b/crates/openhuman-core/src/modules/search/config_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use tinysearch_bus::PresentationMode;
use crate::config::SearchProviderSettings;
+use tinysearch_bus::PresentationMode;
fn config_in(dir: &std::path::Path) -> Config {
let mut config = Config::default();
diff --git a/crates/openhuman-core/src/modules/search/mod.rs b/crates/openhuman-core/src/modules/search/mod.rs
index 12d3b2ade1..945747af83 100644
--- a/crates/openhuman-core/src/modules/search/mod.rs
+++ b/crates/openhuman-core/src/modules/search/mod.rs
@@ -11,8 +11,8 @@
use std::collections::BTreeMap;
use tinysearch_bus::{
- BackendAuthMode, BackendConfig, PresentationConfig, ProviderConfig,
- ProviderRoute, SearchConfig as ModuleSearchConfig,
+ BackendAuthMode, BackendConfig, PresentationConfig, ProviderConfig, ProviderRoute,
+ SearchConfig as ModuleSearchConfig,
};
use crate::config::Config;
diff --git a/crates/openhuman-core/src/profiles/provider_settings.rs b/crates/openhuman-core/src/profiles/provider_settings.rs
index a45a561a1d..14e20e0449 100644
--- a/crates/openhuman-core/src/profiles/provider_settings.rs
+++ b/crates/openhuman-core/src/profiles/provider_settings.rs
@@ -6,7 +6,7 @@
//! router that can point at arbitrary native capabilities.
use crate::config::{
- Config, SearchConfig, PresentationMode, SearchProviderSettings, ProviderRoute,
+ Config, PresentationMode, ProviderRoute, SearchConfig, SearchProviderSettings,
};
use crate::core::runtime::direct_profile_provider::{validate_endpoint, DirectProfileProvider};
use crate::core::runtime::SaasConfig;
@@ -185,12 +185,10 @@ impl ProfileProviderSettings {
/// An advertised role maps exactly once to its canonical module operation.
/// Renamed canonical operations and provider-native names never resolve.
pub fn canonical_role_name(&self, advertised: &str) -> Option<&'static str> {
- tinysearch_bus::ROLES
- .into_iter()
- .find_map(|role| {
- (self.advertised_role_name(role) == advertised)
- .then(|| tinysearch_bus::names::role_tool_name(role))
- })
+ tinysearch_bus::ROLES.into_iter().find_map(|role| {
+ (self.advertised_role_name(role) == advertised)
+ .then(|| tinysearch_bus::names::role_tool_name(role))
+ })
}
/// The operator-selected name for a role, or the ordinary canonical name.
diff --git a/crates/openhuman-core/src/profiles/provider_settings_tests.rs b/crates/openhuman-core/src/profiles/provider_settings_tests.rs
index 6b77bbb847..4f1221cd42 100644
--- a/crates/openhuman-core/src/profiles/provider_settings_tests.rs
+++ b/crates/openhuman-core/src/profiles/provider_settings_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::config::{SearchEngineCredentials, PresentationMode, SearchProviderSettings};
+use crate::config::{PresentationMode, SearchEngineCredentials, SearchProviderSettings};
use tinysearch_bus::Role;
fn deployment(exa: Option<&str>, gemini: Option<&str>) -> crate::core::runtime::SaasConfig {
diff --git a/crates/openhuman-core/src/search/providers.rs b/crates/openhuman-core/src/search/providers.rs
index 8b9d7b3fc7..0529827553 100644
--- a/crates/openhuman-core/src/search/providers.rs
+++ b/crates/openhuman-core/src/search/providers.rs
@@ -8,9 +8,7 @@
//! into the TinySearch module configuration. Provider execution is not here.
use serde::Serialize;
-use tinysearch_bus::{
- default_role_providers, provider_roles, role_key, ProviderRoute, Role,
-};
+use tinysearch_bus::{default_role_providers, provider_roles, role_key, ProviderRoute, Role};
use crate::config::{Config, MANAGED_SEARCH_PROVIDERS, SEARCH_PROVIDERS};
diff --git a/crates/openhuman-core/src/search/providers_tests.rs b/crates/openhuman-core/src/search/providers_tests.rs
index bedb89026a..49158030b9 100644
--- a/crates/openhuman-core/src/search/providers_tests.rs
+++ b/crates/openhuman-core/src/search/providers_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use tinysearch_bus::{parse_role, role_key, ROLES};
use crate::config::{SearchProviderSettings, SEARCH_ROLES};
+use tinysearch_bus::{parse_role, role_key, ROLES};
fn config_with(providers: &[(&str, SearchProviderSettings)]) -> Config {
let mut config = Config::default();
diff --git a/crates/openhuman-core/src/search/tools_tests.rs b/crates/openhuman-core/src/search/tools_tests.rs
index aaa4b5c81e..1c418714a8 100644
--- a/crates/openhuman-core/src/search/tools_tests.rs
+++ b/crates/openhuman-core/src/search/tools_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::config::{SearchProviderSettings, ProviderRoute};
+use crate::config::{ProviderRoute, SearchProviderSettings};
fn signed_out_byok_config() -> Config {
let mut config = Config::default();
diff --git a/crates/openhuman-embed/src/config.rs b/crates/openhuman-embed/src/config.rs
index 216e15ee26..0482ae4a27 100644
--- a/crates/openhuman-embed/src/config.rs
+++ b/crates/openhuman-embed/src/config.rs
@@ -111,7 +111,7 @@ mod tests;
/// Operator search policy and direct-route credential vocabulary.
pub use openhuman_core::config::{
- SearchConfig, SearchEngineCredentials, PresentationMode, SearchProviderSettings, ProviderRoute,
+ PresentationMode, ProviderRoute, SearchConfig, SearchEngineCredentials, SearchProviderSettings,
};
/// The three native search capabilities whose names an operator can present.
pub use openhuman_core::profiles::provider_settings::SearchRole;
diff --git a/crates/openhuman-embed/tests/profile_direct_providers.rs b/crates/openhuman-embed/tests/profile_direct_providers.rs
index d14f0d38c0..53dd20d6f5 100644
--- a/crates/openhuman-embed/tests/profile_direct_providers.rs
+++ b/crates/openhuman-embed/tests/profile_direct_providers.rs
@@ -10,7 +10,7 @@ use common::{
chat_completion, chat_requests, runtime_without_master_key, tool_names, PointedTransport,
};
use openhuman_embed::config::{
- SearchConfig, SearchEngineCredentials, PresentationMode, SearchProviderSettings, SearchRole,
+ PresentationMode, SearchConfig, SearchEngineCredentials, SearchProviderSettings, SearchRole,
};
use openhuman_embed::seams::ToolHookDecision;
use openhuman_embed::{