Skip to content

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

chore: clean up unused imports and simplify test assertions

Steven Enamakel0faf781f8ec5
diff --git a/examples/run_memory_reconcile.rs b/examples/run_memory_reconcile.rs
index b8c13e75d1..857eb4d6d8 100644
--- a/examples/run_memory_reconcile.rs
+++ b/examples/run_memory_reconcile.rs
@@ -46,13 +46,12 @@ async fn main() -> anyhow::Result<()> {
})
.unwrap_or(0);
eprintln!("t+{}s pending={pending}", (i + 1) * 15);
- if pending == 0 || pending == last {
- if pending == 0 {
+ if (pending == 0 || pending == last)
+ && pending == 0 {
break;
}
// Two identical non-zero readings in a row: still draining or
// stalled — keep waiting either way, the cap bounds us.
- }
last = pending;
}
Ok(())
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 fc5fdcee22..3dda3b26f1 100644
--- a/tests/in_process/config_auth_app_state_connectivity_e2e.rs
+++ b/tests/in_process/config_auth_app_state_connectivity_e2e.rs
@@ -586,12 +586,8 @@ fn config_proxy_public_paths_normalize_validate_and_apply_scope() {
let _all_lower = EnvVarGuard::unset("all_proxy");
let _no_lower = EnvVarGuard::unset("no_proxy");
- assert!(ProxyConfig::supported_service_keys()
- .iter()
- .any(|key| *key == "memory.embeddings"));
- assert!(ProxyConfig::supported_service_selectors()
- .iter()
- .any(|selector| *selector == "tool.*"));
+ assert!(ProxyConfig::supported_service_keys().contains(&"memory.embeddings"));
+ assert!(ProxyConfig::supported_service_selectors().contains(&"tool.*"));
let services = ProxyConfig {
enabled: true,
@@ -1114,13 +1110,11 @@ async fn config_default_path_loader_ignores_workspace_override_and_projects_dir_
let root = home.join(".openhuman");
let user_dir = root.join("users").join("default-loader-user");
let workspace_override = tmp.path().join("workspace-override");
- let _guards = vec![
- EnvVarGuard::set_to_path("HOME", &home),
+ let _guards = [EnvVarGuard::set_to_path("HOME", &home),
EnvVarGuard::unset(APP_ENV_VAR),
EnvVarGuard::unset(VITE_APP_ENV_VAR),
EnvVarGuard::set_to_path("OPENHUMAN_WORKSPACE", &workspace_override),
- EnvVarGuard::set("OPENHUMAN_MODEL", " default-loader-model "),
- ];
+ EnvVarGuard::set("OPENHUMAN_MODEL", " default-loader-model ")];
let missing = Config::load_from_default_paths()
.await
@@ -1301,7 +1295,7 @@ async fn config_env_overlay_public_loader_applies_runtime_and_tool_overrides() {
assert!(!config.runtime_python.enabled);
assert_eq!(config.runtime_python.minimum_version, "3.13.0");
assert!(config.runtime_python.prefer_system);
- assert_eq!(config.observability.analytics_enabled, false);
+ assert!(!config.observability.analytics_enabled);
assert_eq!(
config.observability.sentry_dsn.as_deref(),
Some("https://dsn.example/1")
@@ -2729,12 +2723,10 @@ async fn config_auto_approve_public_helper_persists_once_and_is_idempotent() {
let _lock = env_lock();
let tmp = tempdir().expect("tempdir");
let home = tmp.path().join("home");
- let _guards = vec![
- EnvVarGuard::set_to_path("HOME", &home),
+ let _guards = [EnvVarGuard::set_to_path("HOME", &home),
EnvVarGuard::unset("OPENHUMAN_WORKSPACE"),
EnvVarGuard::unset(APP_ENV_VAR),
- EnvVarGuard::unset(VITE_APP_ENV_VAR),
- ];
+ EnvVarGuard::unset(VITE_APP_ENV_VAR)];
openhuman_core::config::add_auto_approve_tool("tool.config.round10")
.await
diff --git a/tests/in_process/memory_graph_roundtrip_e2e.rs b/tests/in_process/memory_graph_roundtrip_e2e.rs
index d8c6f0929b..2c089c2332 100644
--- a/tests/in_process/memory_graph_roundtrip_e2e.rs
+++ b/tests/in_process/memory_graph_roundtrip_e2e.rs
@@ -116,7 +116,7 @@ fn ensure_memory_seams(workspace: &Path) {
.name("memory-graph-roundtrip-seams".to_string())
.stack_size(8 * 1024 * 1024)
.spawn(move || {
- let config = Arc::new(openhuman_core::config::Config {
+ let _config = Arc::new(openhuman_core::config::Config {
workspace_dir: workspace.clone(),
action_dir: workspace.clone(),
config_path: workspace.join("config.toml"),
diff --git a/tests/in_process/orchestrator_presentation_wiring.rs b/tests/in_process/orchestrator_presentation_wiring.rs
index cdf0cde743..171b76d337 100644
--- a/tests/in_process/orchestrator_presentation_wiring.rs
+++ b/tests/in_process/orchestrator_presentation_wiring.rs
@@ -51,7 +51,8 @@ fn presentation_agent_lists_generate_presentation_and_grounding_tools() {
lists_named_tool(PRESENTATION_AGENT_TOML, TOOL_NAME),
"presentation_agent must list '{TOOL_NAME}'"
);
- for grounding_tool in ["web_search_tool"] {
+ {
+ let grounding_tool = "web_search_tool";
assert!(
lists_named_tool(PRESENTATION_AGENT_TOML, grounding_tool),
"presentation_agent must list grounding tool '{grounding_tool}'"
diff --git a/tests/in_process/skill_registry_e2e.rs b/tests/in_process/skill_registry_e2e.rs
index c116cf051a..9d99ce57ad 100644
--- a/tests/in_process/skill_registry_e2e.rs
+++ b/tests/in_process/skill_registry_e2e.rs
@@ -204,11 +204,11 @@ encrypt = false
let fixture_base = format!("http://{fixture_addr}");
let _catalog_guard = EnvVarGuard::set(
"OPENHUMAN_SKILL_REGISTRY_CATALOG_URL",
- &format!("{fixture_base}/skills.json"),
+ format!("{fixture_base}/skills.json"),
);
let _download_guard = EnvVarGuard::set(
"OPENHUMAN_SKILL_REGISTRY_DOWNLOAD_BASE_URL",
- &format!("{fixture_base}/skills"),
+ format!("{fixture_base}/skills"),
);
let _local_http_guard = EnvVarGuard::set("OPENHUMAN_SKILL_INSTALL_ALLOW_LOCAL_HTTP", "1");
diff --git a/tests/inference_provider_e2e.rs b/tests/inference_provider_e2e.rs
index 65e0509e47..fb7918068d 100644
--- a/tests/inference_provider_e2e.rs
+++ b/tests/inference_provider_e2e.rs
@@ -12,7 +12,7 @@
#[path = "support/env_guard.rs"]
mod env_guard;
use env_guard::EnvVarGuard;
-use std::sync::{Mutex, OnceLock};
+use std::sync::OnceLock;
use axum::body::Body;
use axum::http::{header, Method, Request, StatusCode};
diff --git a/tests/keyring_secretstore_fresh_e2e.rs b/tests/keyring_secretstore_fresh_e2e.rs
index 754555d514..01eb50ec19 100644
--- a/tests/keyring_secretstore_fresh_e2e.rs
+++ b/tests/keyring_secretstore_fresh_e2e.rs
@@ -3,7 +3,7 @@ mod env_guard;
use env_guard::EnvVarGuard;
use openhuman_core::config::schema::{Config, StreamMode, TelegramConfig};
use openhuman_core::security::keyring;
-use std::sync::{Mutex, OnceLock};
+use std::sync::OnceLock;
fn env_lock() -> tokio::sync::MutexGuard<'static, ()> {
static LOCK: OnceLock<tokio::sync::Mutex<()>> = OnceLock::new();
diff --git a/tests/live_flows_demo_e2e.rs b/tests/live_flows_demo_e2e.rs
index 6cb7533ed5..20b8800a76 100644
--- a/tests/live_flows_demo_e2e.rs
+++ b/tests/live_flows_demo_e2e.rs
@@ -26,7 +26,7 @@ mod scripted_stack;
use env_guard::EnvVarGuard;
use scripted_stack::assert_no_jsonrpc_error;
use std::path::Path;
-use std::sync::{Mutex, OnceLock};
+use std::sync::OnceLock;
use std::time::Duration;
use serde_json::{json, Value};
diff --git a/tests/live_routing_e2e.rs b/tests/live_routing_e2e.rs
index aa9a12cb62..b2daac43fa 100644
--- a/tests/live_routing_e2e.rs
+++ b/tests/live_routing_e2e.rs
@@ -18,7 +18,7 @@ mod scripted_stack;
use env_guard::EnvVarGuard;
use scripted_stack::assert_no_jsonrpc_error;
use std::path::Path;
-use std::sync::{Mutex, OnceLock};
+use std::sync::OnceLock;
use std::time::Duration;
use futures_util::StreamExt;
@@ -132,7 +132,7 @@ async fn read_sse_event_by_types(events_url: &str, target_events: &[&str]) -> Va
let value: Value = serde_json::from_str(&payload)
.unwrap_or_else(|e| panic!("invalid sse data json: {e}"));
if let Some(event_type) = value.get("event").and_then(Value::as_str) {
- if target_events.iter().any(|t| *t == event_type) {
+ if target_events.contains(&event_type) {
return value;
}
}
diff --git a/tests/memory_roundtrip_e2e.rs b/tests/memory_roundtrip_e2e.rs
index a65f64da11..f0994ac144 100644
--- a/tests/memory_roundtrip_e2e.rs
+++ b/tests/memory_roundtrip_e2e.rs
@@ -40,7 +40,7 @@
mod env_guard;
use env_guard::EnvVarGuard;
use std::path::Path;
-use std::sync::{Arc, Mutex, OnceLock};
+use std::sync::{Arc, OnceLock};
use tempfile::tempdir;
@@ -78,7 +78,7 @@ fn ensure_memory_seams(workspace: &Path) {
.name("memory-roundtrip-seams".to_string())
.stack_size(8 * 1024 * 1024)
.spawn(move || {
- let config = Arc::new(openhuman_core::config::Config {
+ let _config = Arc::new(openhuman_core::config::Config {
workspace_dir: workspace.clone(),
action_dir: workspace.clone(),
config_path: workspace.join("config.toml"),
diff --git a/tests/skills_mcp_registry_live.rs b/tests/skills_mcp_registry_live.rs
index eb3c09c1dd..007c985309 100644
--- a/tests/skills_mcp_registry_live.rs
+++ b/tests/skills_mcp_registry_live.rs
@@ -22,7 +22,7 @@ use env_guard::EnvVarGuard;
use std::collections::BTreeMap;
use std::net::SocketAddr;
use std::path::Path;
-use std::sync::{Mutex, OnceLock};
+use std::sync::OnceLock;
use std::time::Duration;
use axum::http::header::AUTHORIZATION;
diff --git a/tests/support/memory_rpc.rs b/tests/support/memory_rpc.rs
index 64bed26f0d..533706c289 100644
--- a/tests/support/memory_rpc.rs
+++ b/tests/support/memory_rpc.rs
@@ -28,7 +28,7 @@ pub fn ensure_memory_seams() {
.name("memory-e2e-seams".to_string())
.stack_size(8 * 1024 * 1024)
.spawn(|| {
- let config = Arc::new(openhuman_core::config::Config::default());
+ let _config = Arc::new(openhuman_core::config::Config::default());
#[cfg(feature = "modules")]
openhuman_core::modules::memory::set_modules_policy(config);
})