Skip to content

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

chore(tests): reorder imports and reformat test files

Steven Enamakel1a39fee0942b
diff --git a/tests/in_process/agent_approval_memory_coverage_e2e.rs b/tests/in_process/agent_approval_memory_coverage_e2e.rs
index 571aa6fe9f..bd2f7401d2 100644
--- a/tests/in_process/agent_approval_memory_coverage_e2e.rs
+++ b/tests/in_process/agent_approval_memory_coverage_e2e.rs
@@ -20,10 +20,10 @@
//! JSON-RPC router (`build_core_http_router`) and asserted on, so the number the
//! gate reports and the coverage that exists are the same thing.
-use crate::rpc_harness::{error_message, payload};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::{ensure_rpc_auth, rpc_token};
+use crate::rpc_harness::{error_message, payload};
use std::path::Path;
use std::time::Duration;
diff --git a/tests/in_process/agent_prompt_comprehension_e2e.rs b/tests/in_process/agent_prompt_comprehension_e2e.rs
index 210e4afb33..3a7e73a412 100644
--- a/tests/in_process/agent_prompt_comprehension_e2e.rs
+++ b/tests/in_process/agent_prompt_comprehension_e2e.rs
@@ -16,10 +16,12 @@
//! `env_lock()` across `.await` on purpose, as there.
#![allow(clippy::await_holding_lock)]
-use crate::scripted_stack::{assert_no_jsonrpc_error, current_user, lock_or_recover, text_completion, tool_calls_completion};
+use crate::env_guard::env_lock_with_file_keyring as env_lock;
use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::{ensure_rpc_auth, rpc_token};
-use crate::env_guard::env_lock_with_file_keyring as env_lock;
+use crate::scripted_stack::{
+ assert_no_jsonrpc_error, current_user, lock_or_recover, text_completion, tool_calls_completion,
+};
use std::net::SocketAddr;
use std::path::Path;
use std::sync::{Mutex, OnceLock};
@@ -35,7 +37,6 @@ use tempfile::tempdir;
use openhuman_core::agent::harness::AgentDefinitionRegistry;
use openhuman_rpc::server::build_core_http_router;
-
// ─── Env serialization ──────────────────────────────────────────────────────
static AGENT_DEF_REGISTRY_INIT: OnceLock<()> = OnceLock::new();
diff --git a/tests/in_process/agent_turn_overrides_e2e.rs b/tests/in_process/agent_turn_overrides_e2e.rs
index 956cfca24e..3450f05646 100644
--- a/tests/in_process/agent_turn_overrides_e2e.rs
+++ b/tests/in_process/agent_turn_overrides_e2e.rs
@@ -25,8 +25,8 @@
//! positive here.
#![allow(clippy::await_holding_lock)]
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::noop_memory;
use async_trait::async_trait;
use std::collections::VecDeque;
diff --git a/tests/in_process/channels_default_channel_e2e.rs b/tests/in_process/channels_default_channel_e2e.rs
index 3841884d16..1483b6e666 100644
--- a/tests/in_process/channels_default_channel_e2e.rs
+++ b/tests/in_process/channels_default_channel_e2e.rs
@@ -49,10 +49,10 @@
//!
//! Run with: `cargo test -p openhuman-cli --test in_process_all`
-use crate::rpc_harness::{rpc};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::ensure_rpc_auth;
+use crate::rpc_harness::rpc;
use std::path::Path;
use std::sync::{Arc, RwLock};
diff --git a/tests/in_process/config_auth_app_state_connectivity_e2e.rs b/tests/in_process/config_auth_app_state_connectivity_e2e.rs
index 0602e1a657..fc5fdcee22 100644
--- a/tests/in_process/config_auth_app_state_connectivity_e2e.rs
+++ b/tests/in_process/config_auth_app_state_connectivity_e2e.rs
@@ -1,9 +1,9 @@
//! Focused JSON-RPC E2E coverage for config, auth/credentials, app_state,
//! and connectivity controller surfaces.
-use crate::rpc_harness::{ok, payload, rpc, schema};
use crate::env_guard::{env_lock, EnvVarGuard};
use crate::rpc_auth::ensure_rpc_auth;
+use crate::rpc_harness::{ok, payload, rpc, schema};
use std::net::SocketAddr;
use std::path::{Path, PathBuf};
use std::sync::{
@@ -22,8 +22,8 @@ use tempfile::{tempdir, TempDir};
use openhuman_core::config::schema::{
AuditConfig, CapabilityProviderConfig, CapabilityProviderTrustState, DashboardConfig,
DingTalkConfig, DiscordConfig, EventStreamConfig, IrcConfig, LarkConfig, MatrixConfig,
- MemoryConfig, ModelHealthConfig, ProxyConfig, ProxyScope, QQConfig, ResourceLimitsConfig, SandboxConfig,
- SecurityConfig, SlackConfig, TelegramConfig, WebhookConfig, WhatsAppConfig,
+ MemoryConfig, ModelHealthConfig, ProxyConfig, ProxyScope, QQConfig, ResourceLimitsConfig,
+ SandboxConfig, SecurityConfig, SlackConfig, TelegramConfig, WebhookConfig, WhatsAppConfig,
};
use openhuman_core::config::{
clear_active_user, default_projects_dir, pre_login_user_dir, read_active_user_id,
diff --git a/tests/in_process/domain_modules_e2e.rs b/tests/in_process/domain_modules_e2e.rs
index 87e2fc7481..881dcaed36 100644
--- a/tests/in_process/domain_modules_e2e.rs
+++ b/tests/in_process/domain_modules_e2e.rs
@@ -5,16 +5,15 @@
//! exercises cheap read/status handlers through HTTP. Mutating or networked
//! domain behavior remains covered by the focused `*_e2e.rs` suites.
-use crate::rpc_harness::{serve_rpc};
-use crate::rpc_harness::{ok, payload, rpc, schema, write_min_config};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::memory_module;
+use crate::rpc_harness::serve_rpc;
+use crate::rpc_harness::{ok, payload, rpc, schema, write_min_config};
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
-
struct TestHarness {
_tmp: TempDir,
_guards: Vec<EnvVarGuard>,
diff --git a/tests/in_process/embeddings_rpc_e2e.rs b/tests/in_process/embeddings_rpc_e2e.rs
index df7471fb6f..106ec490e6 100644
--- a/tests/in_process/embeddings_rpc_e2e.rs
+++ b/tests/in_process/embeddings_rpc_e2e.rs
@@ -7,8 +7,8 @@
//!
//! Run with: `cargo test -p openhuman-cli --test in_process_all`
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::{ensure_rpc_auth, rpc_token};
use std::net::SocketAddr;
use std::path::Path;
diff --git a/tests/in_process/memory_graph_roundtrip_e2e.rs b/tests/in_process/memory_graph_roundtrip_e2e.rs
index 536c952ec7..d8c6f0929b 100644
--- a/tests/in_process/memory_graph_roundtrip_e2e.rs
+++ b/tests/in_process/memory_graph_roundtrip_e2e.rs
@@ -73,10 +73,10 @@
//! A large stack is also needed — `RUST_MIN_STACK=67108864` — because
//! publishing the policy touches deeply nested config types.
-use crate::rpc_harness::{ok, rpc};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::ensure_rpc_auth;
+use crate::rpc_harness::{ok, rpc};
use std::path::Path;
use std::sync::{Arc, OnceLock};
diff --git a/tests/in_process/memory_sources_e2e.rs b/tests/in_process/memory_sources_e2e.rs
index 348f7c87c1..514e4bf163 100644
--- a/tests/in_process/memory_sources_e2e.rs
+++ b/tests/in_process/memory_sources_e2e.rs
@@ -6,9 +6,9 @@
//!
//! Run with: `cargo test -p openhuman-cli --test in_process_all`
-use crate::memory_rpc::{ok, serve, write_config};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
+use crate::memory_rpc::{ok, serve, write_config};
use crate::rpc_auth::rpc_token;
use std::path::Path;
use std::sync::OnceLock;
@@ -18,7 +18,6 @@ use axum::http::header::AUTHORIZATION;
use serde_json::{json, Value};
use tempfile::tempdir;
-
static TEST_HOME: OnceLock<tempfile::TempDir> = OnceLock::new();
fn test_home() -> &'static Path {
diff --git a/tests/in_process/memory_tree_health_e2e.rs b/tests/in_process/memory_tree_health_e2e.rs
index 8037332cb7..78c381bc7d 100644
--- a/tests/in_process/memory_tree_health_e2e.rs
+++ b/tests/in_process/memory_tree_health_e2e.rs
@@ -24,9 +24,9 @@
//! cross-method invariant that IS reachable and says so in a comment, rather
//! than asserting `0 == 0` and calling it coverage.
-use crate::memory_rpc::{ok, serve, write_config};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
+use crate::memory_rpc::{ok, serve, write_config};
use crate::rpc_auth::rpc_token;
use std::path::Path;
use std::sync::OnceLock;
@@ -36,7 +36,6 @@ use axum::http::header::AUTHORIZATION;
use serde_json::{json, Value};
use tempfile::tempdir;
-
static TEST_HOME: OnceLock<tempfile::TempDir> = OnceLock::new();
fn test_home() -> &'static Path {
diff --git a/tests/in_process/skill_registry_e2e.rs b/tests/in_process/skill_registry_e2e.rs
index b1556bef43..c116cf051a 100644
--- a/tests/in_process/skill_registry_e2e.rs
+++ b/tests/in_process/skill_registry_e2e.rs
@@ -6,10 +6,10 @@
//! The test uses a local fixture catalog and local SKILL.md download URL so CI
//! does not depend on the live Hermes API.
-use openhuman_core::core::auth::CORE_TOKEN_ENV_VAR;
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock_with_file_keyring as env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::{ensure_rpc_auth, rpc_token};
+use openhuman_core::core::auth::CORE_TOKEN_ENV_VAR;
use std::net::SocketAddr;
use std::time::Duration;
@@ -27,7 +27,6 @@ use openhuman_rpc::server::build_core_http_router;
// ── Env lock (process-global env vars must not race) ──────────────────────
-
// ── EnvVarGuard ───────────────────────────────────────────────────────────
// ── Server helpers ─────────────────────────────────────────────────────────
diff --git a/tests/in_process/transcript_search_e2e.rs b/tests/in_process/transcript_search_e2e.rs
index 46782c3b1f..e1aab60927 100644
--- a/tests/in_process/transcript_search_e2e.rs
+++ b/tests/in_process/transcript_search_e2e.rs
@@ -20,7 +20,6 @@ use openhuman_core::memory::conversations::{
};
use openhuman_core::threads::ops::transcript_search;
-
// ── Fixture helpers ──────────────────────────────────────────────────────────
fn thread(id: &str, title: &str) -> CreateConversationThread {
diff --git a/tests/in_process/tree_summarizer_e2e.rs b/tests/in_process/tree_summarizer_e2e.rs
index c69047170e..ed8f045513 100644
--- a/tests/in_process/tree_summarizer_e2e.rs
+++ b/tests/in_process/tree_summarizer_e2e.rs
@@ -20,9 +20,9 @@
//!
//! Run with: `cargo test -p openhuman-cli --test in_process_all`
-use crate::memory_rpc::{serve, write_config};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
+use crate::memory_rpc::{serve, write_config};
use crate::rpc_auth::rpc_token;
use std::path::{Path, PathBuf};
use std::sync::OnceLock;
@@ -33,7 +33,6 @@ use chrono::{DateTime, SecondsFormat, TimeZone, Utc};
use serde_json::{json, Value};
use tempfile::TempDir;
-
const NAMESPACE: &str = "tree-summarizer-e2e";
static TEST_HOME: OnceLock<TempDir> = OnceLock::new();
diff --git a/tests/in_process/worker_b_domain_e2e.rs b/tests/in_process/worker_b_domain_e2e.rs
index 851087e6ea..a998f12a98 100644
--- a/tests/in_process/worker_b_domain_e2e.rs
+++ b/tests/in_process/worker_b_domain_e2e.rs
@@ -5,15 +5,14 @@
//! deterministic controller paths. External-service paths are asserted at
//! validation/config boundaries so the suite stays hermetic.
-use crate::rpc_harness::{serve_rpc};
-use crate::rpc_harness::{ok, payload, rpc, schema, write_min_config};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
+use crate::rpc_harness::serve_rpc;
+use crate::rpc_harness::{ok, payload, rpc, schema, write_min_config};
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
-
struct TestHarness {
_tmp: TempDir,
_guards: Vec<EnvVarGuard>,
diff --git a/tests/in_process/worker_c_modules_e2e.rs b/tests/in_process/worker_c_modules_e2e.rs
index c5e4a1759d..f152c6cb85 100644
--- a/tests/in_process/worker_c_modules_e2e.rs
+++ b/tests/in_process/worker_c_modules_e2e.rs
@@ -4,10 +4,10 @@
//! composio / threads slice and drives the real HTTP JSON-RPC router against
//! an isolated workspace. It avoids live network calls.
-use crate::rpc_harness::{ok, rpc};
-use crate::env_guard::EnvVarGuard;
use crate::env_guard::env_lock;
+use crate::env_guard::EnvVarGuard;
use crate::rpc_auth::ensure_rpc_auth;
+use crate::rpc_harness::{ok, rpc};
use std::path::Path;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
diff --git a/tests/live_flows_demo_e2e.rs b/tests/live_flows_demo_e2e.rs
index f12ff4b89c..9b065d1024 100644
--- a/tests/live_flows_demo_e2e.rs
+++ b/tests/live_flows_demo_e2e.rs
@@ -23,8 +23,8 @@
mod env_guard;
#[path = "support/scripted_stack.rs"]
mod scripted_stack;
-use scripted_stack::{assert_no_jsonrpc_error};
use env_guard::EnvVarGuard;
+use scripted_stack::assert_no_jsonrpc_error;
use std::path::Path;
use std::sync::{Mutex, OnceLock};
use std::time::Duration;
diff --git a/tests/live_routing_e2e.rs b/tests/live_routing_e2e.rs
index b2cb351681..c22feb93f9 100644
--- a/tests/live_routing_e2e.rs
+++ b/tests/live_routing_e2e.rs
@@ -15,8 +15,8 @@
mod env_guard;
#[path = "support/scripted_stack.rs"]
mod scripted_stack;
-use scripted_stack::{assert_no_jsonrpc_error};
use env_guard::EnvVarGuard;
+use scripted_stack::assert_no_jsonrpc_error;
use std::path::Path;
use std::sync::{Mutex, OnceLock};
use std::time::Duration;
diff --git a/tests/raw_coverage/billing_cost_e2e.rs b/tests/raw_coverage/billing_cost_e2e.rs
index 41a1411c39..b61f8408f0 100644
--- a/tests/raw_coverage/billing_cost_e2e.rs
+++ b/tests/raw_coverage/billing_cost_e2e.rs
@@ -1,4 +1,3 @@
-
//! RPC-level e2e coverage for `openhuman.billing_*`, `openhuman.cost_*` and
//! `openhuman.dashboard_model_health`.
//!
@@ -257,7 +256,11 @@ async fn billing_uncovered_controllers_round_trip_against_the_backend() {
let coupons_arr = coupons
.as_array()
.unwrap_or_else(|| panic!("expected an array of coupons: {coupons}"));
- assert_eq!(coupons_arr.len(), 1, "seeded one redeemed coupon: {coupons}");
+ assert_eq!(
+ coupons_arr.len(),
+ 1,
+ "seeded one redeemed coupon: {coupons}"
+ );
assert_eq!(
coupons_arr[0].get("code").and_then(Value::as_str),
Some("WELCOME10")
@@ -294,7 +297,11 @@ async fn billing_rejects_bad_input_before_it_reaches_the_backend() {
log.clear();
let blank_code = harness
- .call(31, "openhuman.billing_redeem_coupon", json!({ "code": " " }))
+ .call(
+ 31,
+ "openhuman.billing_redeem_coupon",
+ json!({ "code": " " }),
+ )
.await;
assert!(
error_message(&blank_code, "blank coupon").contains("code is required"),
@@ -335,8 +342,7 @@ async fn billing_without_a_session_refuses_locally() {
.await;
let message = error_message(&balance, "billing_get_balance with no session");
assert!(
- message.contains("no backend session token")
- && message.contains("auth_store_session"),
+ message.contains("no backend session token") && message.contains("auth_store_session"),
"the error must name the missing session *and* the call that fixes it, \
so the UI can route to sign-in rather than show a bare failure; got: {message}"
);
@@ -493,7 +499,11 @@ alert_threshold = 0.9
.get("by_model")
.and_then(Value::as_array)
.unwrap_or_else(|| panic!("dashboard must carry `by_model`: {dashboard}"));
- assert_eq!(by_model.len(), 3, "three distinct models seeded: {by_model:?}");
+ assert_eq!(
+ by_model.len(),
+ 3,
+ "three distinct models seeded: {by_model:?}"
+ );
let managed = by_model
.iter()
.find(|m| m.get("model").and_then(Value::as_str) == Some("chat-v1"))
@@ -517,11 +527,7 @@ alert_threshold = 0.9
// --- cost_get_daily_history --------------------------------------------
let history = harness
- .call(
- 52,
- "openhuman.cost_get_daily_history",
- json!({ "days": 3 }),
- )
+ .call(52, "openhuman.cost_get_daily_history", json!({ "days": 3 }))
.await;
let history = peel(assert_no_error(&history, "cost_get_daily_history"));
let entries = history
@@ -591,7 +597,9 @@ alert_threshold = 0.9
.map(|c| {
(
c.get("category").and_then(Value::as_str).unwrap_or(""),
- c.get("cost_usd").and_then(Value::as_f64).unwrap_or(f64::NAN),
+ c.get("cost_usd")
+ .and_then(Value::as_f64)
+ .unwrap_or(f64::NAN),
)
})
.collect();
@@ -606,8 +614,9 @@ alert_threshold = 0.9
.unwrap_or_else(|| panic!("usage log must carry `records`: {usage}"));
assert_eq!(records.len(), 3);
assert!(
- records.iter().all(|r| r.get("cost_source").and_then(Value::as_str)
- == Some("estimated")),
+ records
+ .iter()
+ .all(|r| r.get("cost_source").and_then(Value::as_str) == Some("estimated")),
"persisted cost provenance must survive into the DTO: {records:?}"
);
@@ -660,7 +669,10 @@ async fn cost_controllers_answer_on_a_workspace_with_no_history() {
"no records, but the envelope must still be well formed: {usage}"
);
assert_eq!(
- usage.get("by_category").and_then(Value::as_array).map(Vec::len),
+ usage
+ .get("by_category")
+ .and_then(Value::as_array)
+ .map(Vec::len),
Some(0)
);
}
@@ -722,7 +734,10 @@ vision = false
2,
"one row per registry entry, in registry order: {health}"
);
- assert_eq!(models[0].get("id").and_then(Value::as_str), Some("w4/alpha"));
+ assert_eq!(
+ models[0].get("id").and_then(Value::as_str),
+ Some("w4/alpha")
+ );
assert_eq!(
models[0].get("cost_per_1m_output").and_then(Value::as_f64),
Some(6.0),
@@ -733,7 +748,10 @@ vision = false
Some(200_000)
);
assert_eq!(models[0].get("vision").and_then(Value::as_bool), Some(true));
- assert_eq!(models[1].get("vision").and_then(Value::as_bool), Some(false));
+ assert_eq!(
+ models[1].get("vision").and_then(Value::as_bool),
+ Some(false)
+ );
// The placeholder contract, which the frontend reads as "no signal".
for row in models {
diff --git a/tests/raw_coverage/composio_raw_coverage_e2e.rs b/tests/raw_coverage/composio_raw_coverage_e2e.rs
index 107b92a742..82f93074eb 100644
--- a/tests/raw_coverage/composio_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/composio_raw_coverage_e2e.rs
@@ -477,4 +477,3 @@ async fn composio_call(controller: &RegisteredController, params: Value) -> Resu
let params = params.as_object().cloned().unwrap_or_default();
(controller.handler)(params).await
}
-
diff --git a/tests/raw_coverage/connectivity_raw_coverage_e2e.rs b/tests/raw_coverage/connectivity_raw_coverage_e2e.rs
index 49ff9f5eae..a30924553f 100644
--- a/tests/raw_coverage/connectivity_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/connectivity_raw_coverage_e2e.rs
@@ -16,9 +16,7 @@ use tempfile::{tempdir, TempDir};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use openhuman_core::core::auth::{init_rpc_token, CORE_TOKEN_ENV_VAR};
-use openhuman_core::platform::connectivity::rpc::{
- pick_listen_port_for_host, PickListenPortError,
-};
+use openhuman_core::platform::connectivity::rpc::{pick_listen_port_for_host, PickListenPortError};
use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "connectivity-raw-coverage-e2e-token";
@@ -273,4 +271,3 @@ async fn pick_listen_port_identifies_ipv6_openhuman_listener_when_supported() {
other => panic!("expected IPv6 takeover error, got {other:?}"),
}
}
-
diff --git a/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs b/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs
index 4aca2f7915..6bf66ab444 100644
--- a/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs
@@ -22,10 +22,10 @@ use openhuman_core::config::schema::cloud_providers::{
AuthStyle as CloudAuthStyle, CloudProviderCreds,
};
use openhuman_core::config::Config;
-use openhuman_core::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};
use openhuman_core::inference::host_runtime::LocalAiService;
use openhuman_core::inference::provider::factory::auth_key_for_slug;
use openhuman_core::inference::provider::list_configured_models;
+use openhuman_core::security::credentials::{AuthService, DEFAULT_AUTH_PROFILE_NAME};
#[derive(Clone, Default)]
struct MockState {
diff --git a/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs b/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
index cdd3fc81a1..f7dfb1eaa7 100644
--- a/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
@@ -49,8 +49,8 @@ use crate::env_guard::EnvVarGuard;
use std::path::{Path, PathBuf};
use std::sync::{Mutex, OnceLock};
-use openhuman_core::core::all::RegisteredController;
use openhuman_core::config::Config;
+use openhuman_core::core::all::RegisteredController;
use openhuman_core::inference::host_runtime::all_local_inference_registered_controllers;
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
diff --git a/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs b/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs
index 2d35f61c6b..7c18edfb27 100644
--- a/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs
@@ -23,14 +23,14 @@ use openhuman_core::config::schema::cloud_providers::{
AuthStyle as CloudAuthStyle, CloudProviderCreds,
};
use openhuman_core::config::Config;
-use openhuman_core::security::credentials::{
- AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
-};
use openhuman_core::inference::host_runtime::LocalAiService;
use openhuman_core::inference::provider::factory::{
auth_key_for_slug, create_chat_model_from_string_with_model_id,
};
use openhuman_core::inference::provider::list_configured_models;
+use openhuman_core::security::credentials::{
+ AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
+};
#[derive(Clone, Default)]
struct MockState {
@@ -188,13 +188,9 @@ async fn factory_covers_legacy_api_key_scoping_and_abstract_model_errors() {
.expect("store app session");
let _workspace = EnvVarGuard::set("OPENHUMAN_WORKSPACE", config.config_path.parent().unwrap());
- let (legacy, legacy_model) = create_chat_model_from_string_with_model_id(
- "chat",
- "legacy:requested-model",
- &config,
- 0.4,
- )
- .expect("legacy direct model");
+ let (legacy, legacy_model) =
+ create_chat_model_from_string_with_model_id("chat", "legacy:requested-model", &config, 0.4)
+ .expect("legacy direct model");
assert_eq!(legacy_model, "requested-model");
let legacy_response = legacy
.invoke(
@@ -203,18 +199,11 @@ async fn factory_covers_legacy_api_key_scoping_and_abstract_model_errors() {
)
.await
.expect("legacy chat");
- assert_eq!(
- legacy_response.text(),
- "legacy direct ok"
- );
+ assert_eq!(legacy_response.text(), "legacy direct ok");
- let (other, other_model) = create_chat_model_from_string_with_model_id(
- "chat",
- "other:other-model",
- &config,
- 0.4,
- )
- .expect("other model");
+ let (other, other_model) =
+ create_chat_model_from_string_with_model_id("chat", "other:other-model", &config, 0.4)
+ .expect("other model");
let other_text = other
.invoke(
&(),
@@ -230,9 +219,9 @@ async fn factory_covers_legacy_api_key_scoping_and_abstract_model_errors() {
&config,
0.4,
) {
- Ok(_) => panic!("expected abstract tier error"),
- Err(err) => err,
- };
+ Ok(_) => panic!("expected abstract tier error"),
+ Err(err) => err,
+ };
assert!(abstract_err
.to_string()
.contains("has no concrete default_model configured"));
diff --git a/tests/raw_coverage/inference_provider_auth_e2e.rs b/tests/raw_coverage/inference_provider_auth_e2e.rs
index c19a447113..c7f243443a 100644
--- a/tests/raw_coverage/inference_provider_auth_e2e.rs
+++ b/tests/raw_coverage/inference_provider_auth_e2e.rs
@@ -27,8 +27,8 @@
//! Env is process-global and every aggregated suite shares one process, so
//! each case takes the **crate-wide** [`env_lock`] for its whole body.
-use crate::rpc_harness::payload;
use crate::env_guard::EnvVarGuard;
+use crate::rpc_harness::payload;
use std::net::SocketAddr;
use std::path::Path;
use std::sync::{Mutex, OnceLock};
diff --git a/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs b/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs
index dc140133ff..6e0bce2931 100644
--- a/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs
@@ -20,14 +20,14 @@ use openhuman_core::config::schema::cloud_providers::{
AuthStyle as CloudAuthStyle, CloudProviderCreds,
};
use openhuman_core::config::Config;
-use openhuman_core::security::credentials::{
- AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
-};
use openhuman_core::inference::host_runtime::LocalAiService;
use openhuman_core::inference::provider::factory::{
auth_key_for_slug, create_chat_model_from_string_with_model_id, provider_for_role,
};
use openhuman_core::inference::provider::list_configured_models;
+use openhuman_core::security::credentials::{
+ AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
+};
#[derive(Clone, Default)]
struct MockState {
@@ -45,7 +45,7 @@ fn __shared_env_lock() -> std::sync::MutexGuard<'static, ()> {
.unwrap_or_else(|poisoned| poisoned.into_inner())
}
- #[tokio::test]
+#[tokio::test]
async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes() {
let _env_lock = __shared_env_lock();
let (base, _state) = serve_mock().await;
@@ -139,32 +139,27 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
assert_eq!(provider_for_role("chat", &config), "custom:[email protected]");
// #6109: an unset route no longer borrows a sibling's BYOK provider; with no
// `primary_cloud` configured it falls through to the managed backend.
- assert_eq!(
- provider_for_role("reasoning", &config),
- "openhuman"
- );
+ assert_eq!(provider_for_role("reasoning", &config), "openhuman");
let (_provider, model) =
create_chat_model_from_string_with_model_id("chat", "custom:[email protected]", &config, 0.7)
.expect("cloud model");
assert_eq!(model, "demo-chat");
- let (_local_provider, local_model) =
- create_chat_model_from_string_with_model_id(
- "chat",
- "ollama:gemma3:[email protected]",
- &config,
- 0.7,
- )
- .expect("ollama model");
+ let (_local_provider, local_model) = create_chat_model_from_string_with_model_id(
+ "chat",
+ "ollama:gemma3:[email protected]",
+ &config,
+ 0.7,
+ )
+ .expect("ollama model");
assert_eq!(local_model, "gemma3:1b-it-qat");
- let empty_model = match create_chat_model_from_string_with_model_id(
- "chat", "ollama:", &config, 0.7,
- ) {
- Ok(_) => panic!("expected empty model error"),
- Err(err) => err,
- };
+ let empty_model =
+ match create_chat_model_from_string_with_model_id("chat", "ollama:", &config, 0.7) {
+ Ok(_) => panic!("expected empty model error"),
+ Err(err) => err,
+ };
assert!(empty_model.to_string().contains("empty model"));
let listed = list_configured_models("custom")
diff --git a/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs b/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs
index 55efaf54d3..54ea841e4e 100644
--- a/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs
@@ -17,18 +17,16 @@ use axum::response::IntoResponse;
use axum::routing::{get, post};
use axum::{Json, Router};
use futures_util::{SinkExt, StreamExt};
-use openhuman_core::core::types::AppState;
use openhuman_core::config::schema::cloud_providers::{
AuthStyle as CloudAuthStyle, CloudProviderCreds,
};
use openhuman_core::config::Config;
+use openhuman_core::core::types::AppState;
+use openhuman_core::inference::host_runtime::{local_ai_status, LocalAiService};
+use openhuman_core::inference::http;
use openhuman_core::security::credentials::{
AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
};
-use openhuman_core::inference::http;
-use openhuman_core::inference::host_runtime::{
- local_ai_status, LocalAiService,
-};
use openhuman_core::voice::streaming::handle_dictation_ws;
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
diff --git a/tests/raw_coverage/memory_sync_round23_raw_coverage_e2e.rs b/tests/raw_coverage/memory_sync_round23_raw_coverage_e2e.rs
index e2356192dc..221ea5afa1 100644
--- a/tests/raw_coverage/memory_sync_round23_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/memory_sync_round23_raw_coverage_e2e.rs
@@ -66,14 +66,12 @@ static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;
static MEMORY_SEAMS_INIT: OnceLock<()> = OnceLock::new();
fn ensure_memory_seams() {
-
crate::tinyhumans_boot::boot();
MEMORY_SEAMS_INIT.get_or_init(|| {
std::thread::Builder::new()
.name("memory-sync-round23-raw-coverage-seams".to_string())
.stack_size(8 * 1024 * 1024)
- .spawn(|| {
- })
+ .spawn(|| {})
.expect("spawn round23 memory sync seam installer")
.join()
.expect("round23 memory sync seam installer panicked");
@@ -145,4 +143,3 @@ async fn composio_get_user_profile_refuses_cleanly_without_a_loaded_module() {
"unexpected error: {error}"
);
}
-
diff --git a/tests/raw_coverage/notification_platform_e2e.rs b/tests/raw_coverage/notification_platform_e2e.rs
index dcb913701a..5efadcc536 100644
--- a/tests/raw_coverage/notification_platform_e2e.rs
+++ b/tests/raw_coverage/notification_platform_e2e.rs
@@ -1,4 +1,3 @@
-
//! End-to-end coverage for the notification centre and the small platform namespaces that had no
//! e2e target at all: `notification` (7 uncovered), `health` (2), `doctor` (2), `service`'s
//! daemon-host pair, `provider_surfaces` (2), `slack_memory` (2) and `announcements` (1).
diff --git a/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs b/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
index 13fed63bcf..ef3a0d1185 100644
--- a/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
@@ -5,8 +5,8 @@
//! direct public API calls cover persistence/redaction/provider branches that
//! are otherwise only indirectly reachable from the controllers.
-use crate::rpc_harness::{error_message, payload};
use crate::env_guard::EnvVarGuard;
+use crate::rpc_harness::{error_message, payload};
use std::path::Path;
use std::sync::{Arc, Mutex, OnceLock};
use std::time::{Duration, Instant};
@@ -25,12 +25,11 @@ use openhuman_core::security::approval::gate::{
ApprovalChatContext, ApprovalGate, APPROVAL_CHAT_CONTEXT,
};
use openhuman_core::security::approval::{
- all_approval_controller_schemas, all_approval_registered_controllers, ExecutionOutcome, GateOutcome,
+ all_approval_controller_schemas, all_approval_registered_controllers, ExecutionOutcome,
+ GateOutcome,
};
use openhuman_core::security::{live_policy, SecurityPolicy};
-use openhuman_core::tools::registry::{
- denials, registry_entries, registry_entries_for_config,
-};
+use openhuman_core::tools::registry::{denials, registry_entries, registry_entries_for_config};
use openhuman_rpc::server::build_core_http_router;
const TEST_RPC_TOKEN: &str = "tool-registry-approval-raw-e2e-token";
diff --git a/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs
index 59894ad8f6..9d5a732c6b 100644
--- a/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs
@@ -16,6 +16,7 @@ use axum::{Json, Router};
use serde_json::{json, Value};
use tempfile::{Builder, TempDir};
+use openhuman_core::config::Config;
use openhuman_core::integrations::composio::ops::{
cached_active_integrations, composio_authorize, composio_execute, composio_list_connections,
composio_list_toolkits, composio_list_tools, fetch_connected_integrations_status,
@@ -23,9 +24,8 @@ use openhuman_core::integrations::composio::ops::{
use openhuman_core::integrations::composio::{
invalidate_connected_integrations_cache, FetchConnectedIntegrationsStatus,
};
-use openhuman_core::config::Config;
+use openhuman_core::tools::ComposioListToolsTool;
use tinytools::{Tool, ToolCallOptions};
-use openhuman_core::tools::{ComposioListToolsTool};
static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;
@@ -57,7 +57,6 @@ fn env_lock() -> std::sync::MutexGuard<'static, ()> {
}
async fn setup_direct_config(base: &str) -> Harness {
-
crate::tinyhumans_boot::boot();
std::fs::create_dir_all("target").expect("target dir");
let tmp = Builder::new()
diff --git a/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs
index 68390c5123..1e72141afd 100644
--- a/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs
@@ -14,15 +14,15 @@ use axum::{Json, Router};
use serde_json::{json, Value};
use tempfile::{Builder, TempDir};
-use openhuman_core::integrations::composio::ops::{composio_authorize, composio_list_tools};
use openhuman_core::config::Config;
+use openhuman_core::integrations::composio::ops::{composio_authorize, composio_list_tools};
use openhuman_core::security::credentials::{
AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
};
-use tinytools::{Tool, ToolCallOptions};
use openhuman_core::tools::{
- ComposioListConnectionsTool, ComposioListToolkitsTool,
- ComposioListToolsTool};
+ ComposioListConnectionsTool, ComposioListToolkitsTool, ComposioListToolsTool,
+};
+use tinytools::{Tool, ToolCallOptions};
static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;
@@ -63,7 +63,6 @@ fn tempdir() -> TempDir {
}
async fn setup_config() -> Harness {
-
crate::tinyhumans_boot::boot();
let tmp = tempdir();
let root = tmp.path().join("openhuman");
@@ -395,4 +394,3 @@ fn fail(status: StatusCode, error: &str) -> Response {
)
.into_response()
}
-
diff --git a/tests/raw_coverage/worker_b_raw_coverage_e2e.rs b/tests/raw_coverage/worker_b_raw_coverage_e2e.rs
index 2817ed37f1..0c0aacf372 100644
--- a/tests/raw_coverage/worker_b_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/worker_b_raw_coverage_e2e.rs
@@ -5,8 +5,8 @@
//! to drive implementation branches that the controller reachability tests only
//! touch at validation boundaries.
-use crate::rpc_harness::{error_message, ok, payload};
use crate::env_guard::EnvVarGuard;
+use crate::rpc_harness::{error_message, ok, payload};
use std::collections::HashMap;
use std::net::SocketAddr;
use std::path::Path;
@@ -458,7 +458,9 @@ async fn tools_web_answer_uses_managed_gemini_grounding_and_returns_citations()
.await;
let settings = payload(&settings, "config_update_search_settings");
assert_eq!(
- settings.pointer("/effective_roles/answer/0").and_then(Value::as_str),
+ settings
+ .pointer("/effective_roles/answer/0")
+ .and_then(Value::as_str),
Some("gemini"),
"managed Gemini should serve the answer role: {settings}"
);
@@ -471,7 +473,10 @@ async fn tools_web_answer_uses_managed_gemini_grounding_and_returns_citations()
)
.await;
let answer = payload(&answer, "tools_web_answer");
- assert_eq!(answer.get("provider").and_then(Value::as_str), Some("Gemini"));
+ assert_eq!(
+ answer.get("provider").and_then(Value::as_str),
+ Some("Gemini")
+ );
assert_eq!(answer.get("role").and_then(Value::as_str), Some("answer"));
assert!(answer
.get("answer")
@@ -532,7 +537,9 @@ async fn tools_web_search_success_path_uses_backend_session_and_shapes_results()
.await;
let settings = payload(&settings, "config_update_search_settings");
assert_eq!(
- settings.pointer("/effective_roles/search/0").and_then(Value::as_str),
+ settings
+ .pointer("/effective_roles/search/0")
+ .and_then(Value::as_str),
Some("exa"),
"managed Exa should serve the search role once signed in: {settings}"
);
@@ -570,7 +577,10 @@ async fn tools_web_search_success_path_uses_backend_session_and_shapes_results()
body.pointer("/searchQueries/0").and_then(Value::as_str),
Some("worker b raw coverage")
);
- assert!(body.get("mode").is_none(), "backend Exa rejects `mode`: {body}");
+ assert!(
+ body.get("mode").is_none(),
+ "backend Exa rejects `mode`: {body}"
+ );
harness.rpc_join.abort();
mock.join.abort();
diff --git a/tests/support/rpc_auth.rs b/tests/support/rpc_auth.rs
index 65a062ea47..1d15dd2446 100644
--- a/tests/support/rpc_auth.rs
+++ b/tests/support/rpc_auth.rs
@@ -19,7 +19,8 @@ static TOKEN: OnceLock<String> = OnceLock::new();
/// Initialise the core's RPC token subsystem once and return the live token.
pub fn rpc_token() -> &'static str {
TOKEN.get_or_init(|| {
- let dir = std::env::temp_dir().join(format!("openhuman-e2e-rpc-auth-{}", std::process::id()));
+ let dir =
+ std::env::temp_dir().join(format!("openhuman-e2e-rpc-auth-{}", std::process::id()));
std::fs::create_dir_all(&dir).expect("create the rpc token dir");
openhuman_core::core::auth::init_rpc_token(&dir).expect("init the core rpc auth token");
openhuman_core::core::auth::get_rpc_token()