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 assertion formatting

Steven Enamakel52c9bee47262
diff --git a/crates/openhuman-core/src/config/schema/cloud_providers_tests.rs b/crates/openhuman-core/src/config/schema/cloud_providers_tests.rs
index 6c1c5ef335..431281679c 100644
--- a/crates/openhuman-core/src/config/schema/cloud_providers_tests.rs
+++ b/crates/openhuman-core/src/config/schema/cloud_providers_tests.rs
@@ -1,9 +1,9 @@
//! Tests for the surrounding module.
use super::{
- AuthStyle, BUILTIN_CLOUD_PROVIDERS, builtin_cloud_supports_responses_api, endpoint_host,
- endpoint_host_is_chat_completions_only, host_is_builtin_cloud_provider, is_builtin_cloud_slug,
- is_slug_reserved,
+ builtin_cloud_supports_responses_api, endpoint_host, endpoint_host_is_chat_completions_only,
+ host_is_builtin_cloud_provider, is_builtin_cloud_slug, is_slug_reserved, AuthStyle,
+ BUILTIN_CLOUD_PROVIDERS,
};
#[test]
@@ -275,11 +275,9 @@ fn generated_provider_ids_sanitize_and_bound_the_slug_prefix() {
assert!(id.starts_with("p_provider_with_spaces_"));
let suffix = id.rsplit('_').next().expect("suffix");
assert_eq!(suffix.len(), 5);
- assert!(
- suffix
- .chars()
- .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit())
- );
+ assert!(suffix
+ .chars()
+ .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit()));
}
#[test]
diff --git a/crates/openhuman-core/src/config/schema/ephemeral_route_tests.rs b/crates/openhuman-core/src/config/schema/ephemeral_route_tests.rs
index 542829590c..46de5ee193 100644
--- a/crates/openhuman-core/src/config/schema/ephemeral_route_tests.rs
+++ b/crates/openhuman-core/src/config/schema/ephemeral_route_tests.rs
@@ -143,12 +143,10 @@ fn apply_without_a_model_changes_nothing() {
apply(&mut config, route());
assert!(config.ephemeral_route.is_none());
assert!(config.chat_provider.is_none());
- assert!(
- config
- .cloud_providers
- .iter()
- .all(|entry| entry.slug != EPHEMERAL_ROUTE_SLUG)
- );
+ assert!(config
+ .cloud_providers
+ .iter()
+ .all(|entry| entry.slug != EPHEMERAL_ROUTE_SLUG));
}
#[test]
diff --git a/crates/openhuman-core/src/config/schema/load/branches.rs b/crates/openhuman-core/src/config/schema/load/branches.rs
index bea430671b..f4c0e2965f 100644
--- a/crates/openhuman-core/src/config/schema/load/branches.rs
+++ b/crates/openhuman-core/src/config/schema/load/branches.rs
@@ -5,7 +5,7 @@
//! made its poll frame ~440 KB on top of the agent tower (#6379).
use super::super::Config;
-use super::dirs::{ConfigResolutionSource, default_action_dir, resolve_action_dir};
+use super::dirs::{default_action_dir, resolve_action_dir, ConfigResolutionSource};
use super::env::EnvLookup;
use super::impl_load::migration_source;
use super::migrate::{
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs
index 289d406010..e02a73d369 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs
@@ -1,8 +1,8 @@
//! Environment overrides for token compression and related settings.
-use crate::config::schema::Config;
-use crate::config::schema::load::env::EnvLookup;
use crate::config::schema::load::env::parse_env_bool;
+use crate::config::schema::load::env::EnvLookup;
+use crate::config::schema::Config;
impl Config {
pub(super) fn apply_runtime_env<E: EnvLookup + ?Sized>(&mut self, env: &E) {
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 7eb38f63ee..ba46442263 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
@@ -1,11 +1,11 @@
//! Env overrides for web search: provider set, routes, roles, keys, and the
//! Seltz/SearXNG options.
-use crate::config::schema::load::env::EnvLookup;
use crate::config::schema::load::env::parse_env_bool;
+use crate::config::schema::load::env::EnvLookup;
use crate::config::schema::{
- Config, MANAGED_SEARCH_PROVIDERS, PresentationMode, ProviderRoute, SEARCH_PROVIDERS,
- SEARCH_ROLES, SearchProviderSettings,
+ Config, PresentationMode, ProviderRoute, SearchProviderSettings, MANAGED_SEARCH_PROVIDERS,
+ SEARCH_PROVIDERS, SEARCH_ROLES,
};
impl Config {
diff --git a/crates/openhuman-core/src/config/schema/load/source/document.rs b/crates/openhuman-core/src/config/schema/load/source/document.rs
index 43831c48b0..bb6518d32b 100644
--- a/crates/openhuman-core/src/config/schema/load/source/document.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/document.rs
@@ -2,20 +2,20 @@
use std::sync::{Arc, Mutex};
-use anyhow::{Context, Result, anyhow};
+use anyhow::{anyhow, Context, Result};
use async_trait::async_trait;
use serde_json::json;
-use tinystoragedrivers::secrets::{KeyProvider, crypto};
+use tinystoragedrivers::secrets::{crypto, KeyProvider};
use tinystoragedrivers::{CollectionSpec, DocumentStore, Precondition};
use super::{
- ConfigRead, ConfigSource, ConfigSourceAnchor, DocumentBackendIdentity, FileConfigSource,
- apply_bootstrap, strip_bootstrap,
+ apply_bootstrap, strip_bootstrap, ConfigRead, ConfigSource, ConfigSourceAnchor,
+ DocumentBackendIdentity, FileConfigSource,
};
use crate::storage::Scope;
-pub(crate) use super::storage_schema::CONFIG_COLLECTION;
use super::storage_schema::document_id;
+pub(crate) use super::storage_schema::CONFIG_COLLECTION;
/// The document field holding the encrypted TOML body (`enc2:` hex).
const BODY_FIELD: &str = "toml_enc";
diff --git a/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs b/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
index 8f2f6e1a14..6c9c6ffe0a 100644
--- a/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/mod_tests.rs
@@ -3,7 +3,7 @@ use super::*;
use crate::config::Config;
use crate::storage::{MemoryStorage, Scope, ScopedStorage, StorageBackend};
use std::sync::Arc;
-use tinystoragedrivers::secrets::{DerivedKeys, KeyProvider, crypto};
+use tinystoragedrivers::secrets::{crypto, DerivedKeys, KeyProvider};
use zeroize::Zeroizing;
fn keys(byte: u8) -> Arc<dyn KeyProvider> {
diff --git a/crates/openhuman-core/src/config/schema/tools/browser_tests.rs b/crates/openhuman-core/src/config/schema/tools/browser_tests.rs
index cd562adaaf..fbc171e7e9 100644
--- a/crates/openhuman-core/src/config/schema/tools/browser_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tools/browser_tests.rs
@@ -45,11 +45,9 @@ fn unknown_unattended_names_are_reported_and_never_allow_anything() {
assert!(!config.allows_unattended("navigate"));
assert!(!config.allows_unattended("hover"));
assert!(!config.allows_unattended("*"));
- assert!(
- with_unattended(&["double_click", "select", "check"])
- .unknown_unattended_actions()
- .is_empty()
- );
+ assert!(with_unattended(&["double_click", "select", "check"])
+ .unknown_unattended_actions()
+ .is_empty());
}
#[test]
diff --git a/crates/openhuman-core/src/config/schema/tools/mod.rs b/crates/openhuman-core/src/config/schema/tools/mod.rs
index c747cfb3ac..fcda1d5afe 100644
--- a/crates/openhuman-core/src/config/schema/tools/mod.rs
+++ b/crates/openhuman-core/src/config/schema/tools/mod.rs
@@ -10,9 +10,9 @@ pub mod search;
pub use browser::{BrowserComputerUseConfig, BrowserConfig};
pub use http::{CurlConfig, HttpRequestConfig};
pub use integrations::{
- COMPOSIO_MODE_BACKEND, COMPOSIO_MODE_DIRECT, COMPOSIO_MODE_DISABLED, ComposioConfig,
- ComposioDirectBaseUrls, ComposioHostCredential, IntegrationToggle, IntegrationsConfig,
- SecretsConfig,
+ ComposioConfig, ComposioDirectBaseUrls, ComposioHostCredential, IntegrationToggle,
+ IntegrationsConfig, SecretsConfig, COMPOSIO_MODE_BACKEND, COMPOSIO_MODE_DIRECT,
+ COMPOSIO_MODE_DISABLED,
};
pub use mcp::{
GitbooksConfig, HttpHeader, McpAuthConfig, McpClientConfig, McpClientIdentityConfig,
@@ -20,10 +20,10 @@ pub use mcp::{
};
pub use multimodal::{MultimodalConfig, MultimodalFileConfig};
pub use search::{
- LegacySearchInputs, MANAGED_SEARCH_PROVIDERS, PresentationMode, ProviderRoute,
- 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_ANSWER, SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH, SEARCH_ROLES, SearchConfig,
- SearchEngineCredentials, SearchHostCredential, SearchProviderSettings, SearxngConfig,
- SeltzConfig, UnknownKeyedSearchProvider, WebSearchConfig,
+ 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,
+ SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
};
diff --git a/crates/openhuman-core/src/config/schema/tools/search.rs b/crates/openhuman-core/src/config/schema/tools/search.rs
index 609bc5078b..d60dda8655 100644
--- a/crates/openhuman-core/src/config/schema/tools/search.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search.rs
@@ -202,7 +202,11 @@ impl SearchEngineCredentials {
pub fn key(&self) -> Option<&str> {
self.api_key.as_deref().and_then(|s| {
let t = s.trim();
- if t.is_empty() { None } else { Some(t) }
+ if t.is_empty() {
+ None
+ } else {
+ Some(t)
+ }
})
}
}
diff --git a/crates/openhuman-core/src/core/runtime/context_turn_origin_tests.rs b/crates/openhuman-core/src/core/runtime/context_turn_origin_tests.rs
index 43ea2a0570..83baedb714 100644
--- a/crates/openhuman-core/src/core/runtime/context_turn_origin_tests.rs
+++ b/crates/openhuman-core/src/core/runtime/context_turn_origin_tests.rs
@@ -240,13 +240,11 @@ async fn a_turn_origin_survives_a_change_of_context() {
Some(crate::security::turn_origin::AgentTurnOrigin::TrustedAutomation { .. })
));
// It is the inner context that is scoped (its own state), not the outer.
- assert!(
- CoreContext::current()
- .unwrap()
- .workspace_dir()
- .unwrap()
- .ends_with("origin-survives-inner")
- );
+ assert!(CoreContext::current()
+ .unwrap()
+ .workspace_dir()
+ .unwrap()
+ .ends_with("origin-survives-inner"));
})
.await;
CoreContext::sync_scope(inner, || {