Skip to content

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

chore: reformat test assertions and imports for consistent style

Steven Enamakel93bd471bed72
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
index 002055ea73..c143b81d67 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
@@ -281,7 +281,6 @@ fn vision_agent_loads_on_its_pinned_multimodal_model() {
}
}
-
#[test]
fn master_agent_has_coding_hint_and_named_tools() {
let def = find("orchestrator");
@@ -427,7 +426,6 @@ fn time_sensitive_agents_expose_resolve_time() {
}
}
-
#[test]
fn broad_agent_surfaces_expose_storage_transfer_not_lifecycle_tools() {
for id in ["orchestrator"] {
@@ -457,8 +455,6 @@ fn broad_agent_surfaces_expose_storage_transfer_not_lifecycle_tools() {
}
}
-
-
#[test]
fn critic_is_read_only() {
let def = find("critic");
@@ -540,8 +536,6 @@ fn planner_has_readonly_mcp_discovery_not_execute() {
}
}
-
-
/// The archivist is registered but deliberately not a chat delegate: the
/// post-commit session-memory extraction runs it by id
/// (`runtime_session.rs`), and a delegate would add its schema to every turn.
@@ -555,7 +549,11 @@ fn the_orchestrator_does_not_delegate_to_the_archivist() {
.any(|entry| matches!(entry, SubagentEntry::AgentId(id) if id == "archivist")),
"`archivist` is back on the orchestrator's subagent list"
);
- assert_eq!(find("archivist").id, "archivist", "archivist must stay registered");
+ assert_eq!(
+ find("archivist").id,
+ "archivist",
+ "archivist must stay registered"
+ );
}
/// The specialists the inline skills replaced must not come back as
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_orchestrator_tier_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_orchestrator_tier_tests.rs
index 46fa4a50d3..9ee409a8c7 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_orchestrator_tier_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_orchestrator_tier_tests.rs
@@ -1,7 +1,5 @@
use super::*;
-
-
/// Wallet and market actions are the `web3` skill now, not a specialist. The
/// money-safety contract the `crypto_agent` enforced has to survive the move:
/// the guide carries the read → quote → confirm → execute order, and the
@@ -28,7 +26,10 @@ fn the_web3_skill_keeps_the_crypto_safety_contract() {
"`quote_id`",
"Never auto-retry a write",
] {
- assert!(web3.guide.contains(rule), "web3 guide lost the rule `{rule}`");
+ assert!(
+ web3.guide.contains(rule),
+ "web3 guide lost the rule `{rule}`"
+ );
}
let prompt = include_str!("orchestrator/prompt.md");
assert!(
@@ -76,7 +77,6 @@ fn orchestrator_tolerates_unresolvable_subagent_id() {
.expect("validate_tier_hierarchy must tolerate an unresolvable subagent id");
}
-
/// MCP discovery and invocation are direct; skill setup keeps its specialist
/// route, and running a skill is the orchestrator's own `run_workflow`.
#[test]
@@ -113,8 +113,6 @@ fn orchestrator_reaches_mcp_directly_and_skills_through_hand_offs() {
}
}
-
-
#[test]
fn orchestrator_subagents_include_control_specialists() {
use crate::agent::harness::definition::SubagentEntry;
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
index 5d9efb5d0d..219133e6e9 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
@@ -213,7 +213,11 @@ fn specialist_agents_are_registered_with_narrow_tools() {
// Scheduling is the `scheduling` skill over the collapsed `cron` tool,
// with the time tools the orchestrator holds directly.
let scheduling = crate::tools::toolpacks::pack("scheduling").expect("scheduling skill");
- assert_eq!(scheduling.tools, &["cron"], "the skill uses collapsed `cron`");
+ assert_eq!(
+ scheduling.tools,
+ &["cron"],
+ "the skill uses collapsed `cron`"
+ );
match &find("orchestrator").tools {
ToolScope::Named(names) => {
for required in ["current_time", "resolve_time"] {
@@ -262,7 +266,12 @@ fn morning_briefing_is_read_only() {
// for every registered tool.
match &def.tools {
ToolScope::Named(tools) => {
- for required in ["memory_tree", "composio_execute", "tool_search", "current_time"] {
+ for required in [
+ "memory_tree",
+ "composio_execute",
+ "tool_search",
+ "current_time",
+ ] {
assert!(
tools.iter().any(|t| t == required),
"morning_briefing needs `{required}`"
@@ -280,7 +289,6 @@ fn morning_briefing_is_read_only() {
assert_eq!(def.max_iterations, 8);
}
-
#[cfg(feature = "flows")]
#[test]
fn flow_memory_agent_is_read_only_worker_with_bounded_memory_belt() {
@@ -366,7 +374,6 @@ fn chatty_sub_agents_have_bounded_output() {
);
}
-
/// R4 regression: `hint:vision` is deprecated (`vision-v1` silently falls
/// back to the chat default on managed routes, with no error), so no
/// built-in agent may still declare `ModelSpec::Hint("vision")`.
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index 5af18a67ef..29dd11a3f1 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -317,7 +317,10 @@ fn build_routes_live_facts_to_the_web_tools_directly() {
assert!(body.contains("anything broader via deep `web_answer_tool`"));
assert!(body.contains("`depth: \"deep\"`"));
assert!(body.contains("`web_contents_tool`"));
- assert!(!body.contains("`research`"), "the removed research delegate must not be named");
+ assert!(
+ !body.contains("`research`"),
+ "the removed research delegate must not be named"
+ );
assert!(body.contains("weather, forecasts, prices, recent news"));
assert!(body.contains("\"use live data\""));
// A lead-in line is welcome, but only in the same message as the call.
@@ -348,7 +351,10 @@ fn prompt_names_only_guided_skills_that_exist() {
for skill in ["coding", "system", "web3", "docs"] {
let pack = crate::tools::toolpacks::pack(skill)
.unwrap_or_else(|| panic!("prompt names skill `{skill}`, which is not a pack"));
- assert!(!pack.guide.trim().is_empty(), "skill `{skill}` has no guide");
+ assert!(
+ !pack.guide.trim().is_empty(),
+ "skill `{skill}` has no guide"
+ );
}
}
diff --git a/crates/openhuman-core/src/agent/registry/defaults_tests.rs b/crates/openhuman-core/src/agent/registry/defaults_tests.rs
index 40fcbbd443..60e2b057d5 100644
--- a/crates/openhuman-core/src/agent/registry/defaults_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/defaults_tests.rs
@@ -6,9 +6,20 @@ fn default_agents_include_core_personas() {
let ids: Vec<&str> = agents.iter().map(|agent| agent.id.as_str()).collect();
assert!(ids.contains(&"orchestrator"));
assert!(ids.contains(&"archivist"));
- assert!(!ids.contains(&"researcher"), "the researcher agent was removed");
- for removed in ["code_executor", "tools_agent", "settings_agent", "crypto_agent"] {
- assert!(!ids.contains(&removed), "`{removed}` was replaced by an inline skill");
+ assert!(
+ !ids.contains(&"researcher"),
+ "the researcher agent was removed"
+ );
+ for removed in [
+ "code_executor",
+ "tools_agent",
+ "settings_agent",
+ "crypto_agent",
+ ] {
+ assert!(
+ !ids.contains(&removed),
+ "`{removed}` was replaced by an inline skill"
+ );
}
assert!(ids.contains(&"planner"), "planner stays for workflow runs");
assert!(agents
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs
index 40d97f4cc4..b72a1ce3c5 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_exposure_tests.rs
@@ -250,8 +250,14 @@ fn orchestrator_reaches_the_replaced_specialists_tools_through_discovery() {
"run_tests",
"mcp_registry_installed_list",
] {
- assert!(deferred.contains(tool), "`{tool}` must be deferred; got {deferred:?}");
+ assert!(
+ deferred.contains(tool),
+ "`{tool}` must be deferred; got {deferred:?}"
+ );
assert!(!visible.contains(tool), "`{tool}` must stay off the wire");
- assert!(policy.is_allowed(tool), "`{tool}` must be callable once found");
+ assert!(
+ policy.is_allowed(tool),
+ "`{tool}` must be callable once found"
+ );
}
}
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_spec_views_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_spec_views_tests.rs
index abe7d28ace..7765b1956b 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_spec_views_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_tool_spec_views_tests.rs
@@ -91,7 +91,8 @@ fn the_three_spec_views_share_their_leaf_schemas() {
"the orchestrator cannot spawn itself: {ids:?}"
);
assert!(
- ids.iter().any(|id| id.as_str() == Some("task_manager_agent")),
+ ids.iter()
+ .any(|id| id.as_str() == Some("task_manager_agent")),
"an allowlisted id survives: {ids:?}"
);
saw_scoped_spawn = true;
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
index b95968c885..3fe222b86e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
@@ -13,10 +13,9 @@ use tinyagents_registry::{
};
use crate::agent::orchestration::tools::{
- CloseSubagentDispatch, ContinueSubagentDispatch,
- DelegateGraphDispatch, DelegationDispatch, ListSubagentsDispatch, SpawnAsyncSubagentDispatch,
- SpawnParallelAgentsDispatch, SpawnSubagentDispatch, SpawnWorkerThreadDispatch,
- SteerSubagentDispatch, WaitSubagentDispatch,
+ CloseSubagentDispatch, ContinueSubagentDispatch, DelegateGraphDispatch, DelegationDispatch,
+ ListSubagentsDispatch, SpawnAsyncSubagentDispatch, SpawnParallelAgentsDispatch,
+ SpawnSubagentDispatch, SpawnWorkerThreadDispatch, SteerSubagentDispatch, WaitSubagentDispatch,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent::tinyagents::tools::{CanonicalSharedToolAdapter, EarlyExitHook};
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index 176145f44e..1179f5ec52 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@ -299,7 +299,5 @@ pub(crate) fn effective_max_iterations(max_iterations: usize) -> usize {
/// (`subagent_host::ops::runner`). Widen this predicate in lockstep if that
/// ever stops being true.
pub(crate) fn is_subagent_spawn_or_delegate_tool(name: &str) -> bool {
- name == "spawn_subagent"
- || name.starts_with("delegate_")
- || name == "spawn_worker_thread"
+ name == "spawn_subagent" || name.starts_with("delegate_") || name == "spawn_worker_thread"
}
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 02e6695d62..9780e5e26e 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
@@ -340,9 +340,8 @@ fn credentials_resolve_per_provider() {
#[test]
fn v2_managed_tinyfish_without_a_key_is_turned_off() {
- let mut cfg = legacy(
- "schema_version = 2\n[providers.tinyfish]\nenabled = true\nroute = \"managed\"\n",
- );
+ let mut cfg =
+ legacy("schema_version = 2\n[providers.tinyfish]\nenabled = true\nroute = \"managed\"\n");
assert!(cfg.migrate_legacy(LegacySearchInputs::default()));
assert_eq!(
provider(&cfg, "tinyfish"),
diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs
index 330613bbbe..c5fbd09755 100644
--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs
+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs
@@ -607,10 +607,7 @@ fn every_pack_declares_the_tools_it_is_named_for() {
"storage_get_link",
],
),
- (
- "scheduling",
- &["cron"],
- ),
+ ("scheduling", &["cron"]),
(
"profile",
&[
@@ -632,10 +629,7 @@ fn every_pack_declares_the_tools_it_is_named_for() {
),
("tasks", &["manage_tasks"]),
("goals", &["goals", "goal_get", "goal_set"]),
- (
- "docs",
- &["gitbooks_search", "gitbooks_get_page"],
- ),
+ ("docs", &["gitbooks_search", "gitbooks_get_page"]),
];
for (id, tools) in expect {
@@ -696,9 +690,10 @@ fn thread_renamed_orchestrator_keeps_its_mcp_tools_advertised() {
fn a_packs_owner_still_loses_every_other_pack() {
// Ownership is per pack, not a blanket exemption: `workflow_builder` owns
// `workflows` and `composio`, and must still lose `web3`.
- let mut visible: HashSet<String> = ["propose_workflow".to_string(), "wallet_status".to_string()]
- .into_iter()
- .collect();
+ let mut visible: HashSet<String> =
+ ["propose_workflow".to_string(), "wallet_status".to_string()]
+ .into_iter()
+ .collect();
strip_packed_from_visible(&mut visible, "workflow_builder");
assert!(visible.contains("propose_workflow"));
assert!(
@@ -843,5 +838,8 @@ async fn loading_a_skill_prints_its_guide_before_the_tool_schemas() {
let opening: String = web3.guide.trim().chars().take(40).collect();
let guide_at = text.find(&opening).expect("guide rendered");
let schema_at = text.find("## `wallet_status`").expect("tool rendered");
- assert!(guide_at < schema_at, "guide must precede the schemas:\n{text}");
+ assert!(
+ guide_at < schema_at,
+ "guide must precede the schemas:\n{text}"
+ );
}
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index a5f45953f2..232a955468 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -1679,9 +1679,7 @@ async fn json_rpc_agent_registry_manages_defaults_and_custom_agents() {
.expect("agent_list_definitions should return definitions array");
let memory_agent = definitions
.iter()
- .find(|definition| {
- definition.get("id").and_then(Value::as_str) == Some("agent_memory")
- })
+ .find(|definition| definition.get("id").and_then(Value::as_str) == Some("agent_memory"))
.expect("safe agent library should include agent_memory");
assert_eq!(
memory_agent.get("display_name").and_then(Value::as_str),
@@ -1825,9 +1823,7 @@ async fn json_rpc_agent_registry_manages_defaults_and_custom_agents() {
})
.expect("include_disabled should retain disabled image_agent");
assert_eq!(
- disabled_image_agent
- .get("enabled")
- .and_then(Value::as_bool),
+ disabled_image_agent.get("enabled").and_then(Value::as_bool),
Some(false)
);
diff --git a/tests/orchestrator_presentation_wiring.rs b/tests/orchestrator_presentation_wiring.rs
index a8f83795f9..0853dbac1c 100644
--- a/tests/orchestrator_presentation_wiring.rs
+++ b/tests/orchestrator_presentation_wiring.rs
@@ -91,7 +91,9 @@ fn only_the_documents_skill_carries_generate_presentation() {
let documents_at = TOOLPACK_REGISTRY
.find("id: \"documents\"")
.expect("documents pack");
- let coding_at = TOOLPACK_REGISTRY.find("id: \"coding\"").expect("coding pack");
+ let coding_at = TOOLPACK_REGISTRY
+ .find("id: \"coding\"")
+ .expect("coding pack");
let member_at = TOOLPACK_REGISTRY.find(&quoted).unwrap();
assert!(
member_at > documents_at && (coding_at < documents_at || member_at < coding_at),