Skip to content

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

chore: reformat code to comply with rustfmt

Steven Enamakel245abbbe7009
diff --git a/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs b/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs
index 604566c2b2..37b0a0ba85 100644
--- a/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs
@@ -63,10 +63,12 @@ impl FleetToolSet {
/// prefix) removes entries from either.
pub(crate) fn from_scope(scope: &ToolScope, disallowed: &[String]) -> Self {
let denied = |name: &str| {
- disallowed.iter().any(|entry| match entry.strip_suffix('*') {
- Some(prefix) => name.starts_with(prefix),
- None => entry == name,
- })
+ disallowed
+ .iter()
+ .any(|entry| match entry.strip_suffix('*') {
+ Some(prefix) => name.starts_with(prefix),
+ None => entry == name,
+ })
};
let available = FLEET_TOOLS
.iter()
diff --git a/crates/openhuman-core/src/agent/orchestration/fleet_tools_tests.rs b/crates/openhuman-core/src/agent/orchestration/fleet_tools_tests.rs
index 2f0e18b18f..ec0495d301 100644
--- a/crates/openhuman-core/src/agent/orchestration/fleet_tools_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/fleet_tools_tests.rs
@@ -8,7 +8,12 @@ fn named(tools: &[&str]) -> ToolScope {
#[test]
fn named_scope_exposes_only_listed_fleet_tools() {
let set = FleetToolSet::from_scope(
- &named(&["spawn_async_subagent", "list_subagents", "continue_subagent", "shell"]),
+ &named(&[
+ "spawn_async_subagent",
+ "list_subagents",
+ "continue_subagent",
+ "shell",
+ ]),
&[],
);
assert!(set.has("list_subagents"));
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
index 2f363da2de..4c04d5ee09 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -242,8 +242,9 @@ async fn snapshot_and_block_scope_to_parent_and_reflect_live_status() {
assert_eq!(snap[1].agent_id, "researcher");
assert_eq!(snap[1].status, "running");
- let block = active_subagents_context_block("fleet-parent", &test_workspace(), &FleetToolSet::all())
- .expect("block present");
+ let block =
+ active_subagents_context_block("fleet-parent", &test_workspace(), &FleetToolSet::all())
+ .expect("block present");
assert!(block.contains("[active_subagents]"));
assert!(block.contains("use wait_subagent to collect"));
assert!(block.contains("You have 2 sub-agent worker(s)"));
@@ -266,8 +267,16 @@ async fn snapshot_and_block_scope_to_parent_and_reflect_live_status() {
let fleet = FleetToolSet::from_scope(&def.tools, &def.disallowed_tools);
let block = active_subagents_context_block("fleet-parent", &test_workspace(), &fleet)
.expect("block present");
- for name in ["wait_subagent", "steer_subagent", "close_subagent", "wait_loop"] {
- assert!(!block.contains(name), "{name} named for a parent without it:\n{block}");
+ for name in [
+ "wait_subagent",
+ "steer_subagent",
+ "close_subagent",
+ "wait_loop",
+ ] {
+ assert!(
+ !block.contains(name),
+ "{name} named for a parent without it:\n{block}"
+ );
}
assert!(block.contains("delivered to you automatically"));
assert!(block.contains("continue_subagent"));
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
index 9a57aac140..9ef448f5ca 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
@@ -5,8 +5,8 @@
//! events and, when possible, persisted in the child worker thread.
use crate::agent::harness::definition::AgentDefinitionRegistry;
-use crate::agent::orchestration::fleet_tools::FleetToolSet;
use crate::agent::messages::ChatMessage;
+use crate::agent::orchestration::fleet_tools::FleetToolSet;
use crate::agent::orchestration::running_subagents::{self, SubagentStatus};
use crate::agent::orchestration::subagent_sessions::{
self, DurableSubagentStatus, SubagentSessionSelector, SubagentSessionStore,
@@ -201,7 +201,11 @@ include!("spawn_async_subagent_execute.rs");
/// The wording follows what the parent can actually do: a parent without
/// `wait_subagent` (the orchestrator, #5701) is told the result arrives on its
/// own and not to poll, instead of being invited to "wait for completion".
-fn format_async_subagent_accepted(agent_id: &str, payload_json: &str, fleet: &FleetToolSet) -> String {
+fn format_async_subagent_accepted(
+ agent_id: &str,
+ payload_json: &str,
+ fleet: &FleetToolSet,
+) -> String {
let guidance = if fleet.can_wait() {
"Use the structured reference below to send more input, wait for completion, or perform a short timeout tick to check status. If the user does not need the result now, continue without blocking."
} else {
@@ -266,7 +270,8 @@ fn async_subagent_ref_payload(
}),
);
next_actions.push("call wait_subagent with timeout_secs to collect the result".into());
- next_actions.push("call wait_subagent with timeout_secs=1 as a timeout tick/status check".into());
+ next_actions
+ .push("call wait_subagent with timeout_secs=1 as a timeout tick/status check".into());
let reminder = format!(
"Check async sub-agent {agent_id} status with wait_subagent using subagent_session_id {subagent_session_id}."
);
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
index b039718036..e8fbe7449a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
@@ -106,9 +106,20 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
"running",
&fleet,
);
- let instructions = payload["instructions"].as_object().expect("instructions map");
- for absent in ["wait", "timeout_tick", "delayed_tick", "delayed_loop", "send_message"] {
- assert!(!instructions.contains_key(absent), "{absent} offered to a parent without it");
+ let instructions = payload["instructions"]
+ .as_object()
+ .expect("instructions map");
+ for absent in [
+ "wait",
+ "timeout_tick",
+ "delayed_tick",
+ "delayed_loop",
+ "send_message",
+ ] {
+ assert!(
+ !instructions.contains_key(absent),
+ "{absent} offered to a parent without it"
+ );
}
assert_eq!(
payload["instructions"]["answer_or_resume"]["tool"],
@@ -116,8 +127,16 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
);
assert_eq!(payload["result_delivery"], "automatic");
let serialized = serde_json::to_string(&payload).unwrap();
- for name in ["wait_subagent", "steer_subagent", "wait_loop", "close_subagent"] {
- assert!(!serialized.contains(name), "{name} leaked into the envelope");
+ for name in [
+ "wait_subagent",
+ "steer_subagent",
+ "wait_loop",
+ "close_subagent",
+ ] {
+ assert!(
+ !serialized.contains(name),
+ "{name} leaked into the envelope"
+ );
}
let next: Vec<&str> = payload["next_actions"]
.as_array()
@@ -125,7 +144,9 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
.iter()
.filter_map(|v| v.as_str())
.collect();
- assert!(next.iter().any(|a| a.contains("delivered to you automatically")));
+ assert!(next
+ .iter()
+ .any(|a| a.contains("delivered to you automatically")));
let message = format_async_subagent_accepted("integrations_agent", &serialized, &fleet);
let prose = message.split("[async_subagent_ref]").next().unwrap();
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_models_tests.rs b/crates/openhuman-core/src/agent/tinyagents/turn_models_tests.rs
index 7c4523b17c..3b8e05b2a0 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_models_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_models_tests.rs
@@ -40,7 +40,8 @@ async fn name_of(model: &Arc<dyn ChatModel<()>>) -> String {
}
fn resolver() -> TurnModelResolver {
- let primary: Arc<dyn ChatModel<()>> = Arc::new(NamedModel("openrouter/deepseek/deepseek-v4.1-flash"));
+ let primary: Arc<dyn ChatModel<()>> =
+ Arc::new(NamedModel("openrouter/deepseek/deepseek-v4.1-flash"));
let mut routes: HashMap<String, Arc<dyn ChatModel<()>>> = HashMap::new();
routes.insert("coding-v1".to_string(), Arc::new(NamedModel("coding-v1")));
routes.insert("burst-v1".to_string(), Arc::new(NamedModel("burst-v1")));
@@ -56,14 +57,20 @@ async fn lead_keeps_selected_primary_over_definition_pin() {
.as_team_lead()
.with_model_pin("coding-v1");
let model = resolver().resolve(&request).await.expect("resolves");
- assert_eq!(name_of(&model).await, "openrouter/deepseek/deepseek-v4.1-flash");
+ assert_eq!(
+ name_of(&model).await,
+ "openrouter/deepseek/deepseek-v4.1-flash"
+ );
}
#[tokio::test]
async fn lead_without_pin_gets_primary() {
let request = ModelResolveRequest::new("orchestrator").as_team_lead();
let model = resolver().resolve(&request).await.expect("resolves");
- assert_eq!(name_of(&model).await, "openrouter/deepseek/deepseek-v4.1-flash");
+ assert_eq!(
+ name_of(&model).await,
+ "openrouter/deepseek/deepseek-v4.1-flash"
+ );
}
#[tokio::test]
@@ -77,5 +84,8 @@ async fn subagent_pin_resolves_to_its_tier_route() {
async fn subagent_pin_without_route_falls_back_to_primary() {
let request = ModelResolveRequest::new("worker").with_model_pin("vision-v1");
let model = resolver().resolve(&request).await.expect("resolves");
- assert_eq!(name_of(&model).await, "openrouter/deepseek/deepseek-v4.1-flash");
+ assert_eq!(
+ name_of(&model).await,
+ "openrouter/deepseek/deepseek-v4.1-flash"
+ );
}