Skip to content

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

style: apply rustfmt formatting across agent and tool modules

Steven Enamakela1047d00775f
diff --git a/crates/openhuman-core/src/agent/host_overrides.rs b/crates/openhuman-core/src/agent/host_overrides.rs
index 78275cc2d0..2c09b43bf3 100644
--- a/crates/openhuman-core/src/agent/host_overrides.rs
+++ b/crates/openhuman-core/src/agent/host_overrides.rs
@@ -10,7 +10,6 @@ use std::sync::{Arc, RwLock};
use crate::agent::hooks::{PostTurnHook, ToolHook};
use tinyinference_llm::model::ChatModel;
-
/// Runtime or agent host adapters, shared by every context derived from it.
#[derive(Default)]
pub struct HostOverrides {
diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rs
index 74957d4777..a6d0d5694d 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs
@@ -413,24 +413,22 @@ impl AgentOrchestrationSession {
// carried across the same boundary the parent execution context
// already is. Without the origin the spawned agent's external-effect
// tools reach the approval gate unlabelled and are refused.
- let handle = tokio::spawn(crate::agent::turn_origin::propagate(
- async move {
- mark_running(&task_status_tx);
- let result = with_parent_context(parent, async move {
- run_subagent(&definition, &prompt, options).await
- })
+ let handle = tokio::spawn(crate::agent::turn_origin::propagate(async move {
+ mark_running(&task_status_tx);
+ let result = with_parent_context(parent, async move {
+ run_subagent(&definition, &prompt, options).await
+ })
+ .await;
+ session
+ .finish_agent(
+ &task_id,
+ &task_agent_id,
+ &task_status_tx,
+ progress_sink,
+ result,
+ )
.await;
- session
- .finish_agent(
- &task_id,
- &task_agent_id,
- &task_status_tx,
- progress_sink,
- result,
- )
- .await;
- }
- ));
+ }));
self.registry
.register(
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
index 378b8858a3..420a8ce37a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
@@ -710,7 +710,7 @@ impl SpawnAsyncSubagentTool {
}
}
abort_report.disarm();
- }
+ },
));
// Register *after* spawn so the AbortHandle is available. The task owns
diff --git a/crates/openhuman-core/src/agent/session_host/mod.rs b/crates/openhuman-core/src/agent/session_host/mod.rs
index 7b68116664..505b90ac8c 100644
--- a/crates/openhuman-core/src/agent/session_host/mod.rs
+++ b/crates/openhuman-core/src/agent/session_host/mod.rs
@@ -81,7 +81,7 @@ mod runtime_adapter_tests;
#[cfg(test)]
mod transcript_compat_tests;
#[cfg(test)]
-mod typed_transcript_compat_tests;
-#[cfg(test)]
#[path = "transcript_resume_stable_tests.rs"]
mod transcript_resume_stable_tests;
+#[cfg(test)]
+mod typed_transcript_compat_tests;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index 9f07019758..db0d070594 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -1048,9 +1048,7 @@ impl OpenHumanSessionHost {
let mut builder = SessionBuilder::new(driver)
.codec(Arc::new(OpenHumanTranscriptCodec))
.hooks(hooks)
- .retain_recorded_tools(
- !self.host_only && !self.host_env.fresh_tool_snapshot,
- );
+ .retain_recorded_tools(!self.host_only && !self.host_env.fresh_tool_snapshot);
let meta = self.runtime_transcript_meta();
builder = match self.session.clone() {
Some(session) => builder.session(session_locator, session, meta),
diff --git a/crates/openhuman-core/src/agent/session_store/mod_tests.rs b/crates/openhuman-core/src/agent/session_store/mod_tests.rs
index 91cccbc8c0..52a486de65 100644
--- a/crates/openhuman-core/src/agent/session_store/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/session_store/mod_tests.rs
@@ -8,8 +8,7 @@ async fn scope<F: std::future::Future>(
provider: Arc<dyn SessionStoreProvider>,
future: F,
) -> F::Output {
- crate::core::runtime::CoreContext::scope(derived_with_store(None, None, provider), future)
- .await
+ crate::core::runtime::CoreContext::scope(derived_with_store(None, None, provider), future).await
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
index 2cf28d5622..e4cea148a2 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
@@ -569,8 +569,10 @@ impl OpenHumanRunContext {
}
self.turn_deadline = env.turn_deadline.or(self.turn_deadline);
self.tool_call_limit = env.tool_call_limit.or(self.tool_call_limit);
- self.stop_hooks.extend(env.hooks.stop_hooks().iter().cloned());
- self.tool_hooks.extend(env.hooks.tool_hooks().iter().cloned());
+ self.stop_hooks
+ .extend(env.hooks.stop_hooks().iter().cloned());
+ self.tool_hooks
+ .extend(env.hooks.tool_hooks().iter().cloned());
self
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs
index 3385f382a3..ed7c6b7c5a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context_tests.rs
@@ -470,5 +470,9 @@ fn autonomous_iter_cap_is_inherited_by_children_and_lifts_subagent_caps() {
let grandchild = parent.child().child();
assert_eq!(grandchild.autonomous_iter_cap, Some(200));
assert_eq!(lift(grandchild.autonomous_iter_cap, 10), 200);
- assert_eq!(lift(Some(5), 10), 10, "a cap below the base never lowers it");
+ assert_eq!(
+ lift(Some(5), 10),
+ 10,
+ "a cap below the base never lowers it"
+ );
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rs
index 023e61fd0d..8fe1a5e76b 100644
--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs
@@ -106,8 +106,8 @@ mod nested_calls_tests;
#[path = "prompt_cache_golden_tests.rs"]
mod prompt_cache_golden_tests;
#[cfg(test)]
-#[path = "topology_collision_tests.rs"]
-mod topology_collision_tests;
-#[cfg(test)]
#[path = "tinyagents_tests.rs"]
mod tests;
+#[cfg(test)]
+#[path = "topology_collision_tests.rs"]
+mod topology_collision_tests;
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs
index d41741e230..93b417f043 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs
@@ -8,7 +8,9 @@ async fn per_turn_tool_limit_reaches_the_execution_policy() {
assert_eq!(run_policy_for(10, false).limits.max_tool_calls, 80);
// A host cap can only narrow the product default, never widen it.
assert_eq!(
- run_policy_for_provider(10, false, false, Some(1_000)).limits.max_tool_calls,
+ run_policy_for_provider(10, false, false, Some(1_000))
+ .limits
+ .max_tool_calls,
80
);
}
diff --git a/crates/openhuman-core/src/agent/turn_env_tests.rs b/crates/openhuman-core/src/agent/turn_env_tests.rs
index 7b31dcc389..90aaea5971 100644
--- a/crates/openhuman-core/src/agent/turn_env_tests.rs
+++ b/crates/openhuman-core/src/agent/turn_env_tests.rs
@@ -84,7 +84,9 @@ async fn the_env_survives_await_points_and_spawned_tasks() {
#[test]
fn detached_children_keep_policy_but_not_the_turns_cancellation() {
let (env, token) = full_env();
- let detached = OpenHumanRunContext::new().with_host_env(&env).detached_child();
+ let detached = OpenHumanRunContext::new()
+ .with_host_env(&env)
+ .detached_child();
assert_eq!(detached.tool_call_limit, Some(5));
token.cancel();
assert!(!detached.cancellation.is_cancelled());
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs b/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs
index c24775d2d9..054633c972 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs
@@ -114,7 +114,9 @@ async fn surfaces_length_finish_reason() {
.await;
let request = ModelRequest::new(vec![Message::user("hi")]).with_model("m".to_string());
- let response = complete_once(&endpoint(&server), request, None).await.unwrap();
+ let response = complete_once(&endpoint(&server), request, None)
+ .await
+ .unwrap();
assert_eq!(response.finish_reason.as_deref(), Some("length"));
}
diff --git a/crates/openhuman-core/src/modules/unloaded.rs b/crates/openhuman-core/src/modules/unloaded.rs
index f008712d48..bcd9c5b869 100644
--- a/crates/openhuman-core/src/modules/unloaded.rs
+++ b/crates/openhuman-core/src/modules/unloaded.rs
@@ -9,8 +9,7 @@
//! `loader_disabled` reason.
use tinybus::module::{
- AccessFuture, FailureReporter, ModuleAccess, ModuleClient, ProxyFailure, Reason,
- ReleaseRecord,
+ AccessFuture, FailureReporter, ModuleAccess, ModuleClient, ProxyFailure, Reason, ReleaseRecord,
};
use tinybus::Proxy;
diff --git a/crates/openhuman-core/src/tools/impl/presentation/mod.rs b/crates/openhuman-core/src/tools/impl/presentation/mod.rs
index ccf348c0b3..2c87d642c9 100644
--- a/crates/openhuman-core/src/tools/impl/presentation/mod.rs
+++ b/crates/openhuman-core/src/tools/impl/presentation/mod.rs
@@ -35,7 +35,8 @@ use async_trait::async_trait;
use serde_json::{json, Value};
use crate::agent::artifacts::{
- create_artifact_regenerating, fail_artifact, finalize_artifact, read_artifact_bytes, ArtifactKind,
+ create_artifact_regenerating, fail_artifact, finalize_artifact, read_artifact_bytes,
+ ArtifactKind,
};
use crate::security::SecurityPolicy;
use tinytools::{PermissionLevel, Tool, ToolResult};