Skip to content

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

chore: remove unused imports across multiple files

Steven Enamakel34b0025bd496
diff --git a/crates/openhuman-core/src/api/config_tests.rs b/crates/openhuman-core/src/api/config_tests.rs
index 9196e59777..5345c01f82 100644
--- a/crates/openhuman-core/src/api/config_tests.rs
+++ b/crates/openhuman-core/src/api/config_tests.rs
@@ -47,9 +47,8 @@ impl Drop for EnvSnapshot {
/// The URL that should be used as the backend base when no config override
/// is present and the runtime env has been cleared for the test.
fn fallback_backend_base_for_current_build() -> String {
- api_base_from_env().unwrap_or_else(|| {
- default_api_base_url_for_env(app_env_from_env().as_deref()).to_string()
- })
+ api_base_from_env()
+ .unwrap_or_else(|| default_api_base_url_for_env(app_env_from_env().as_deref()).to_string())
}
// ── api_url ───────────────────────────────────────────────────────────────
diff --git a/crates/openhuman-core/src/api/jwt.rs b/crates/openhuman-core/src/api/jwt.rs
index 92841d1935..60ac4bcaeb 100644
--- a/crates/openhuman-core/src/api/jwt.rs
+++ b/crates/openhuman-core/src/api/jwt.rs
@@ -36,7 +36,6 @@ pub fn decode_jwt_exp(token: &str) -> Option<DateTime<Utc>> {
DateTime::<Utc>::from_timestamp(tinyhumans_sdk::jwt::decode_jwt_exp_unix(token)?, 0)
}
-
#[cfg(test)]
#[path = "jwt_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/api/product.rs b/crates/openhuman-core/src/api/product.rs
index ac10cf0f7b..a04372249f 100644
--- a/crates/openhuman-core/src/api/product.rs
+++ b/crates/openhuman-core/src/api/product.rs
@@ -175,7 +175,6 @@ pub(crate) fn reset_product_identity_for_test() {
set_product_identity(ProductIdentity::default());
}
-
#[cfg(test)]
#[path = "product_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/bin/fleet.rs b/crates/openhuman-core/src/bin/fleet.rs
index 40a5427de4..1916d813fc 100644
--- a/crates/openhuman-core/src/bin/fleet.rs
+++ b/crates/openhuman-core/src/bin/fleet.rs
@@ -23,10 +23,6 @@
//! core's bound port from a ready file / `EmbeddedReadySignal` and reconcile
//! membership against `tinyhumansai/backend`). Limitations are logged, never
//! silently swallowed.
-use std::collections::HashMap;
-use std::net::SocketAddr;
-use std::path::{Path, PathBuf};
-use std::sync::Arc;
use anyhow::Context as _;
use axum::{
body::Bytes,
@@ -39,6 +35,10 @@ use axum::{
Router,
};
use clap::Parser;
+use std::collections::HashMap;
+use std::net::SocketAddr;
+use std::path::{Path, PathBuf};
+use std::sync::Arc;
use tokio::sync::RwLock;
// ---------------------------------------------------------------------------
// Edge auth — maps opaque client-facing tokens to a user id.
diff --git a/crates/openhuman-core/src/bin/library_profile/scenarios/subagent_storm_tests.rs b/crates/openhuman-core/src/bin/library_profile/scenarios/subagent_storm_tests.rs
index bed4ae7554..78ceef8a25 100644
--- a/crates/openhuman-core/src/bin/library_profile/scenarios/subagent_storm_tests.rs
+++ b/crates/openhuman-core/src/bin/library_profile/scenarios/subagent_storm_tests.rs
@@ -1,6 +1,5 @@
use super::*;
-
#[test]
fn percentiles_nearest_rank() {
let v: Vec<u128> = (1..=100).collect();
diff --git a/crates/openhuman-core/src/bin/rss_bench.rs b/crates/openhuman-core/src/bin/rss_bench.rs
index 08becccf21..04d68cf3cd 100644
--- a/crates/openhuman-core/src/bin/rss_bench.rs
+++ b/crates/openhuman-core/src/bin/rss_bench.rs
@@ -376,7 +376,6 @@ async fn main() -> Result<()> {
}
}
-
#[cfg(test)]
#[path = "rss_bench_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/core/auth.rs b/crates/openhuman-core/src/core/auth.rs
index 2c698e97fa..348cee776d 100644
--- a/crates/openhuman-core/src/core/auth.rs
+++ b/crates/openhuman-core/src/core/auth.rs
@@ -483,7 +483,6 @@ fn write_token_file(path: &Path, token: &str) -> anyhow::Result<()> {
Ok(())
}
-
#[cfg(test)]
#[path = "auth_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/core/bus.rs b/crates/openhuman-core/src/core/bus.rs
index 2c5cc0fda4..49bbba72b3 100644
--- a/crates/openhuman-core/src/core/bus.rs
+++ b/crates/openhuman-core/src/core/bus.rs
@@ -166,7 +166,6 @@ impl tinybus::EventHandler<DomainEvent> for TracingSubscriber {
}
}
-
#[cfg(test)]
#[path = "bus_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/core/dispatch.rs b/crates/openhuman-core/src/core/dispatch.rs
index c67361a739..b8a44071f8 100644
--- a/crates/openhuman-core/src/core/dispatch.rs
+++ b/crates/openhuman-core/src/core/dispatch.rs
@@ -266,7 +266,6 @@ fn type_name(value: &Value) -> &'static str {
}
}
-
#[cfg(test)]
#[path = "dispatch_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/core/dispatch_tests.rs b/crates/openhuman-core/src/core/dispatch_tests.rs
index 1a8e14ae90..e2b0c8794c 100644
--- a/crates/openhuman-core/src/core/dispatch_tests.rs
+++ b/crates/openhuman-core/src/core/dispatch_tests.rs
@@ -234,8 +234,7 @@ async fn dispatch_legacy_alias_routes_to_registry() {
// This alias targets a controller registered in the domain registry.
// Do not invoke it here: its implementation can persist default config,
// which makes this routing test depend on a filesystem workspace.
- let method =
- crate::core::legacy_aliases::resolve_legacy("openhuman.get_analytics_settings");
+ let method = crate::core::legacy_aliases::resolve_legacy("openhuman.get_analytics_settings");
assert!(
crate::core::all::schema_for_rpc_method(method).is_some(),
"legacy alias must resolve to a registered controller: {method}"
diff --git a/crates/openhuman-core/src/core/event_bind_tokens.rs b/crates/openhuman-core/src/core/event_bind_tokens.rs
index 27fb5853e3..13a207bd4b 100644
--- a/crates/openhuman-core/src/core/event_bind_tokens.rs
+++ b/crates/openhuman-core/src/core/event_bind_tokens.rs
@@ -141,7 +141,6 @@ fn generate_token() -> String {
hex::encode(bytes)
}
-
#[cfg(test)]
#[path = "event_bind_tokens_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/core/event_bind_tokens_tests.rs b/crates/openhuman-core/src/core/event_bind_tokens_tests.rs
index 2d5fe9df9e..ffeb68cdb2 100644
--- a/crates/openhuman-core/src/core/event_bind_tokens_tests.rs
+++ b/crates/openhuman-core/src/core/event_bind_tokens_tests.rs
@@ -52,8 +52,7 @@ fn ttl_override_is_clamped_to_max() {
// Any caller asking for more than `MAX_TTL` collapses to the cap;
// confirm the issue path does not panic and the resulting token
// still validates.
- let issued =
- issue("cli-test-clamp", Some(Duration::from_secs(60 * 60 * 24))).expect("issue");
+ let issued = issue("cli-test-clamp", Some(Duration::from_secs(60 * 60 * 24))).expect("issue");
assert!(issued.valid_until <= Instant::now() + MAX_TTL + Duration::from_secs(1));
assert!(consume("cli-test-clamp", &issued.token));
}
diff --git a/crates/openhuman-core/src/integrations/composio/tools/visibility.rs b/crates/openhuman-core/src/integrations/composio/tools/visibility.rs
index 509a2cb5a2..9ab00c7718 100644
--- a/crates/openhuman-core/src/integrations/composio/tools/visibility.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools/visibility.rs
@@ -69,7 +69,7 @@ pub(super) fn action_mutates_external_state(slug: &str) -> bool {
/// Decide whether a Composio action slug should be visible / executable
/// for the current user, given the registered provider's curated list
/// (if any) and the user's stored scope preference.
-async fn evaluate_tool_visibility(config: &Config, slug: &str) -> ToolDecision {
+pub(super) async fn evaluate_tool_visibility(config: &Config, slug: &str) -> ToolDecision {
let Some(toolkit) = toolkit_from_slug(slug) else {
// Unparseable slug — let the backend return its own error.
return ToolDecision::Allow;
@@ -103,7 +103,7 @@ async fn evaluate_tool_visibility(config: &Config, slug: &str) -> ToolDecision {
/// Returns the number of dropped tools so callers can log it.
/// `toolkit_from_slug` already lowercases its result, so the comparison
/// is direct against entries the caller has already lowercased.
-fn retain_connected_tools(
+pub(super) fn retain_connected_tools(
resp: &mut super::super::types::ComposioToolsResponse,
connected: &HashSet<String>,
) -> usize {
@@ -116,7 +116,7 @@ fn retain_connected_tools(
before - resp.tools.len()
}
-fn normalized_scope_toolkits(
+pub(super) fn normalized_scope_toolkits(
requested: Option<&[String]>,
connected: Option<&HashSet<String>>,
) -> Vec<String> {
@@ -142,7 +142,7 @@ fn uncatalogued_toolkits(toolkits: &[String]) -> Vec<String> {
.collect()
}
-fn empty_uncurated_toolkits_message(toolkits: &[String]) -> Option<String> {
+pub(super) fn empty_uncurated_toolkits_message(toolkits: &[String]) -> Option<String> {
let unsupported = uncatalogued_toolkits(toolkits);
if unsupported.is_empty() {
return None;
@@ -163,7 +163,7 @@ fn empty_uncurated_toolkits_message(toolkits: &[String]) -> Option<String> {
/// Filter a freshly-fetched [`super::super::types::ComposioToolsResponse`] in
/// place: drop tools that aren't curated for their toolkit and tools
/// whose scope is disabled in the user's pref.
-async fn filter_list_tools_response(
+pub(super) async fn filter_list_tools_response(
config: &Config,
resp: &mut super::super::types::ComposioToolsResponse,
) {
@@ -239,7 +239,7 @@ fn split_arg_names(parameters: Option<&Value>) -> (Vec<String>, Vec<String>) {
/// only what the agent needs to pick a slug and call `composio_execute`:
/// the slug, a one-line description, and the names of required +
/// optional top-level arguments. Tools are grouped by toolkit prefix.
-fn render_tools_markdown(resp: &super::super::types::ComposioToolsResponse) -> String {
+pub(super) fn render_tools_markdown(resp: &super::super::types::ComposioToolsResponse) -> String {
use std::collections::BTreeMap;
use std::fmt::Write as _;
@@ -304,7 +304,7 @@ fn render_tools_markdown(resp: &super::super::types::ComposioToolsResponse) -> S
/// toggles the scope in the Connections UI. The agent has no tool to
/// flip scopes (see the note above the removed `ComposioEnableScopeTool`
/// for why) — it can only describe the gate and point at the UI.
-fn scope_error_message(slug: &str, scope: ToolScope, pref: UserScopePref) -> String {
+pub(super) fn scope_error_message(slug: &str, scope: ToolScope, pref: UserScopePref) -> String {
let toolkit = toolkit_from_slug(slug).unwrap_or_default();
let scope_str = scope.as_str();
format!(