Skip to content

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

style: apply rustfmt import ordering and line wrapping

Steven Enamakelb46087f76399
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
index b67fcc57e6..d69e290ec2 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
@@ -3,9 +3,9 @@
use super::{dedup_visible_tool_specs, visible_tool_specs_for_policy};
use crate::agent::context::ContextManager;
use crate::agent::session_host::types::{OpenHumanSessionHost, SessionHostBuilder};
-use tinytools::ToolPolicyEngine;
use anyhow::Result;
use std::sync::Arc;
+use tinytools::ToolPolicyEngine;
use tinytools::{Tool, ToolSpec};
impl SessionHostBuilder {
@@ -142,8 +142,7 @@ impl SessionHostBuilder {
// durable Hidden tool: `refresh_delegation_tools` (turn/tools.rs) only
// swaps synthesised names, and `OpenHumanSessionHost::hide_tools` only seeds a set
// that is still empty — see the matching strip there.
- let discovery_opted_in =
- visible_names.remove(tinytools::TOOL_SEARCH_NAME);
+ let discovery_opted_in = visible_names.remove(tinytools::TOOL_SEARCH_NAME);
let discovery_enabled = (belt_is_wildcard || discovery_opted_in)
&& !self
.withheld_tool_names
@@ -152,10 +151,7 @@ impl SessionHostBuilder {
// `Hidden` members (collapsed `todo_*`) leave here too.
// A named belt never listed them.
let mut deferred_names = if belt_is_wildcard {
- tinytools::strip_deferred_from_visible(
- &mut visible_names,
- tools.as_slice(),
- )
+ tinytools::strip_deferred_from_visible(&mut visible_names, tools.as_slice())
} else {
std::collections::HashSet::new()
};
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
index 83361c2162..caf43a9cf8 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
@@ -72,10 +72,10 @@ mod tool_spec_views_tests;
// ── use_skill's advertised spec is scoped to the session ────────────────────
+use tinytools::PermissionLevel;
use tinytools::{
TaskProfile, TaskRiskLevel, ToolPolicyAction, ToolPolicyDecision, ToolPolicySession,
};
-use tinytools::PermissionLevel;
fn session_allowing(names: &[&str]) -> ToolPolicySession {
ToolPolicySession {
@@ -190,8 +190,8 @@ fn visible_specs_drop_the_pack_tool_when_no_pack_is_reachable() {
/// the only route to every withheld tool.
#[test]
fn a_realistic_withheld_session_keeps_its_packs_advertised() {
- use tinytools::ToolPolicyEngine;
use crate::tools::toolpacks::{append_pack_tools, strip_packed_from_visible};
+ use tinytools::ToolPolicyEngine;
struct Fake(&'static str);
#[async_trait::async_trait]
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
index c67dd597cc..93208a30a4 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
@@ -168,9 +168,7 @@ fn withholding_tool_search_disables_wildcard_discovery() {
let tmp = tempfile::TempDir::new().unwrap();
let config = test_config(&tmp);
let host: crate::agent::HostTools = Arc::new(|_| crate::agent::HostTurnTools {
- withheld: std::collections::HashSet::from([
- tinytools::TOOL_SEARCH_NAME.to_string(),
- ]),
+ withheld: std::collections::HashSet::from([tinytools::TOOL_SEARCH_NAME.to_string()]),
..Default::default()
});
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 9a39fdbf90..c28473eb51 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
@@ -160,13 +160,10 @@ fn wildcard_belt_defers_but_keeps_reachable() {
/// it, and the belt's own `Direct` entries stay exactly as written.
#[test]
fn named_belt_opts_into_discovery_by_naming_tool_search() {
- let visible: std::collections::HashSet<String> = [
- "plain",
- tinytools::TOOL_SEARCH_NAME,
- ]
- .into_iter()
- .map(String::from)
- .collect();
+ let visible: std::collections::HashSet<String> = ["plain", tinytools::TOOL_SEARCH_NAME]
+ .into_iter()
+ .map(String::from)
+ .collect();
let agent = build_with(direct_and_deferred(), visible);
assert_eq!(
diff --git a/crates/openhuman-core/src/agent/session_host/builder/mod.rs b/crates/openhuman-core/src/agent/session_host/builder/mod.rs
index 978c22ebe0..173c2b5a6a 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/mod.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/mod.rs
@@ -26,8 +26,8 @@ pub use host_tools::{HostTools, HostTurnTools, TurnContext};
mod builder_tests;
use crate::agent::harness::definition::{AgentDefinition, ToolScope};
-use tinytools::ToolPolicySession;
use std::sync::Arc;
+use tinytools::ToolPolicySession;
use tinytools::{Tool, ToolSpec};
/// Drop entries with duplicate `name` fields, first occurrence wins.
diff --git a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
index 3cc2a9a835..28a5c4948b 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
@@ -3,9 +3,9 @@
//! (which rebuilds the tool policy snapshot on every change).
use super::super::types::{OpenHumanSessionHost, SessionHostBuilder};
-use tinytools::ToolPolicyEngine;
use std::collections::HashSet;
use std::sync::Arc;
+use tinytools::ToolPolicyEngine;
use tinytools::{Tool, ToolSpec};
use tinytools_agent::dialect::TranscriptEntry;
@@ -119,9 +119,7 @@ impl OpenHumanSessionHost {
}
#[cfg(test)]
- pub(crate) fn tool_policy_session_for_test(
- &self,
- ) -> &tinytools::ToolPolicySession {
+ pub(crate) fn tool_policy_session_for_test(&self) -> &tinytools::ToolPolicySession {
&self.tool_policy_session
}
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs
index f5e532256e..e2ed5de31e 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs
@@ -9,8 +9,8 @@ impl OpenHumanTurnPrelude {
/// this request is prepared.
pub(super) fn refresh_delegation_tool_surface(&self) -> anyhow::Result<()> {
use crate::agent::harness::definition::AgentDefinitionRegistry;
- use tinytools::ToolPolicyEngine;
use crate::tools::orchestrator_tools::collect_orchestrator_tools;
+ use tinytools::ToolPolicyEngine;
let Some(registry) = AgentDefinitionRegistry::current() else {
return Ok(());
diff --git a/crates/openhuman-core/src/agent/session_host/types.rs b/crates/openhuman-core/src/agent/session_host/types.rs
index a8e70d3c04..e34988ba85 100644
--- a/crates/openhuman-core/src/agent/session_host/types.rs
+++ b/crates/openhuman-core/src/agent/session_host/types.rs
@@ -12,8 +12,8 @@ use crate::agent::progress::AgentProgress;
use crate::agent::prompts::SystemPromptBuilder;
use crate::agent::tinyagents::TurnModelSource;
use crate::agent::tool_policy::ToolPolicy;
-use tinytools::ToolPolicySession;
use std::sync::Arc;
+use tinytools::ToolPolicySession;
use tinytools::{Tool, ToolSpec};
use tinytools_agent::dialect::ToolDialect;
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
index 2975aaa1ba..6062846a31 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/bundle.rs
@@ -16,8 +16,8 @@ use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::hooks::PostTurnHook;
use crate::config::Config;
use crate::security::policy::SecurityPolicy;
-use tinytools::ToolPolicySession;
use tinytools::Tool;
+use tinytools::ToolPolicySession;
use super::{
OpenHumanBudgetGate, OpenHumanContextComposer, OpenHumanDefinitionRegistry,
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs
index ce340f0b94..84b6fbe65c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs
@@ -316,10 +316,7 @@ impl OpenHumanDefinitionRegistry {
match &def.tools {
ToolScope::Named(named) => {
let mut names = named.clone();
- if named
- .iter()
- .any(|name| name == tinytools::TOOL_SEARCH_NAME)
- {
+ if named.iter().any(|name| name == tinytools::TOOL_SEARCH_NAME) {
if let Some(deferred) = self.deferred_tools.as_deref() {
names.extend(deferred.iter().cloned());
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs
index 848f84da8e..e5f95dcd06 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs
@@ -84,9 +84,9 @@ use tinyagents_harness::host::security_gate::{GateDecision, ToolCallRequest};
use crate::agent::tinyagents::policy_denial::PolicyDenial;
use crate::security::approval::{redact_args, summarize_action, ApprovalGate, GateOutcome};
use crate::security::policy::{GateDecision as PolicyGateDecision, SecurityPolicy};
-use tinytools::{ToolPolicyAction, ToolPolicySession};
use tinybox_bus::CommandClass;
use tinytools::{PermissionLevel, Tool};
+use tinytools::{ToolPolicyAction, ToolPolicySession};
#[path = "security_gate_shell_analysis.rs"]
mod shell_analysis;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route.rs
index 4ae9f8df87..da3fef0a99 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route.rs
@@ -11,9 +11,9 @@ use tinyagents_harness::error::Result as TaResult;
use tinyagents_harness::middleware::Middleware;
use tinyinference_llm::tool::ToolCall as TaToolCall;
-use tinytools::ToolPolicySession;
use crate::tools::toolpacks::{self, GroupMode};
use tinyagents_harness::tool::packs::USE_SKILL;
+use tinytools::ToolPolicySession;
/// `before_tool`: rewrite `name(args)` into
/// `use_skill { "skill": <pack>, "tool": name, "args": args }` when `name` is a
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
index 60bad8fba5..3a2761f20c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
@@ -9,13 +9,13 @@ use super::*;
// the route out of the session's own delegation tools.
use crate::agent::orchestration::tools::{ArchetypeDelegationTool, DelegationTarget};
+use crate::tools::toolpacks::{append_pack_tools, bind_pack_registry};
+use tinyagents_harness::tool::packs::USE_SKILL;
+use tinytools::{PermissionLevel, ToolResult};
use tinytools::{
TaskProfile, TaskRiskLevel, ToolCapability, ToolPolicyAction, ToolPolicyDecision,
ToolPolicySession,
};
-use crate::tools::toolpacks::{append_pack_tools, bind_pack_registry};
-use tinyagents_harness::tool::packs::USE_SKILL;
-use tinytools::{PermissionLevel, ToolResult};
struct RoutingFakeTool(&'static str);
@@ -326,8 +326,8 @@ async fn a_session_without_the_delegate_is_not_told_to_call_it() {
/// "Registered and callable: yes".
#[tokio::test]
async fn use_skill_reaches_a_withheld_packed_tool() {
- use tinytools::ToolPolicyEngine;
use crate::tools::toolpacks::strip_packed_from_visible;
+ use tinytools::ToolPolicyEngine;
let mut tools: Vec<Box<dyn tinytools::Tool>> = vec![Box::new(RoutingFakeTool("goal_set"))];
append_pack_tools(&mut tools);
@@ -376,8 +376,8 @@ async fn use_skill_reaches_a_withheld_packed_tool() {
/// remove, one hop later. The hint must fall back to the owning agent instead.
#[tokio::test]
async fn a_prompt_hidden_delegate_is_not_offered_as_a_direct_route() {
- use tinytools::ToolPolicyEngine;
use crate::tools::toolpacks::strip_packed_from_visible;
+ use tinytools::ToolPolicyEngine;
let mut tools: Vec<Box<dyn tinytools::Tool>> = vec![
Box::new(RoutingFakeTool("propose_workflow")),
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
index 6d4cb6a0a0..9e4e46eb7c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
@@ -417,10 +417,7 @@ async fn unknown_tool_call_in_a_child_run_projects_one_subagent_row() {
}
}
assert_eq!((started, completed), (1, 1));
- assert_eq!(
- class,
- Some(tinytools::status::ToolFailureClass::NotFound)
- );
+ assert_eq!(class, Some(tinytools::status::ToolFailureClass::NotFound));
}
/// W2-budget-dedupe: two `UsageRecorded` events for the *same* model call
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
index 81b5160437..e016ed3b08 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
@@ -27,9 +27,9 @@ use crate::flows;
#[cfg(test)]
use crate::security::credentials::HttpCredential;
use crate::security::credentials::HttpCredentialsStore;
-use crate::security::SecurityPolicy;
#[cfg(test)]
use crate::security::GateDecision;
+use crate::security::SecurityPolicy;
use tinybox_bus::CommandClass;
// The live Composio catalog and probe moved to `composio::catalog` -- the domain
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
index fbab86a165..79fc91d084 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
@@ -1,7 +1,7 @@
use super::*;
-use tinytools::status::POLICY_BLOCKED_MARKER;
use tinyagents_harness::tool::response_fields_from_schema;
use tinyflows::nodes::integration::agent_prompt::scale_timeout_for_iteration_cap;
+use tinytools::status::POLICY_BLOCKED_MARKER;
/// The tier gate an `http_request` (Network-class) node calls: BLOCKED under
/// a read-only tier, and passed through (to the ApprovalGate) under
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs
index ccece634ab..a2f2da2248 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tier.rs
@@ -9,8 +9,8 @@ use serde_json::Value;
use tinyflows::error::{EngineError, Result};
use crate::security::{GateDecision, SecurityPolicy};
-use tinytools::status::POLICY_BLOCKED_MARKER;
use tinybox_bus::CommandClass;
+use tinytools::status::POLICY_BLOCKED_MARKER;
/// Hard autonomy-tier gate for an *acting* flow node (Phase 2).
///
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
index 2abad5502a..9875bc76f9 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::security::AutonomyLevel;
-use tinytools::status::POLICY_BLOCKED_MARKER;
use tempfile::TempDir;
+use tinytools::status::POLICY_BLOCKED_MARKER;
fn security(autonomy: AutonomyLevel) -> Arc<SecurityPolicy> {
Arc::new(SecurityPolicy {
diff --git a/crates/openhuman-core/src/security/policy/command_checks.rs b/crates/openhuman-core/src/security/policy/command_checks.rs
index 712a348443..a34c7ab726 100644
--- a/crates/openhuman-core/src/security/policy/command_checks.rs
+++ b/crates/openhuman-core/src/security/policy/command_checks.rs
@@ -3,7 +3,6 @@ use std::path::{Path, PathBuf};
#[cfg(test)]
use super::types::CommandRiskLevel;
use super::types::{AutonomyLevel, GateDecision, SecurityPolicy};
-use tinytools::status::POLICY_BLOCKED_MARKER;
#[cfg(test)]
use crate::util::floor_char_boundary;
use tinybox_bus::CommandClass;
@@ -19,6 +18,7 @@ use tinybox_core::shell::scan::{
has_leading_env_assignment, normalized_command_name, skip_env_assignments,
split_unquoted_segments, strip_quoted_heredoc_bodies,
};
+use tinytools::status::POLICY_BLOCKED_MARKER;
impl SecurityPolicy {
/// Apply the supervised allowlist to parser facts returned by TinyBox.
diff --git a/crates/openhuman-core/src/security/policy/enforcement.rs b/crates/openhuman-core/src/security/policy/enforcement.rs
index cc6907117c..3e5f307670 100644
--- a/crates/openhuman-core/src/security/policy/enforcement.rs
+++ b/crates/openhuman-core/src/security/policy/enforcement.rs
@@ -3,8 +3,8 @@ use std::path::Path;
use super::types::{
ActionTracker, AutonomyLevel, SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot,
};
-use tinytools::status::POLICY_BLOCKED_MARKER;
use std::sync::Arc;
+use tinytools::status::POLICY_BLOCKED_MARKER;
use tokio::sync::OnceCell;
impl SecurityPolicy {
diff --git a/crates/openhuman-core/src/security/policy/path_checks.rs b/crates/openhuman-core/src/security/policy/path_checks.rs
index 30f7297e27..bff6796ce7 100644
--- a/crates/openhuman-core/src/security/policy/path_checks.rs
+++ b/crates/openhuman-core/src/security/policy/path_checks.rs
@@ -1,11 +1,11 @@
use std::path::{Path, PathBuf};
use super::types::{SecurityPolicy, TrustedAccess};
-use tinytools::status::POLICY_BLOCKED_MARKER;
use super::types::{
ACCOUNT_CONFIG_FILE, ARTIFACTS_DIR, ARTIFACT_TOOL_RESULTS_DIR, WORKSPACE_INTERNAL_DIRS,
WORKSPACE_INTERNAL_FILES,
};
+use tinytools::status::POLICY_BLOCKED_MARKER;
/// Credential-store path segments, matched case-insensitively at any depth.
pub(crate) const SENSITIVE_COMPONENTS: &[&str] =
diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs
index ae1c9ee846..c1b5459e6a 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs
@@ -296,7 +296,9 @@ fn shell_timeout_honors_explicit_per_call_value() {
// Above the cap clamps down to MAX_TIMEOUT_SECS (3600).
assert_eq!(
tool.explicit_timeout(Some(9_999)),
- Some(Duration::from_secs(tinytools_std::timeout::MAX_TIMEOUT_SECS))
+ Some(Duration::from_secs(
+ tinytools_std::timeout::MAX_TIMEOUT_SECS
+ ))
);
}
diff --git a/crates/openhuman-core/src/tools/timeout/mod.rs b/crates/openhuman-core/src/tools/timeout/mod.rs
index d5252df9ec..630f785a32 100644
--- a/crates/openhuman-core/src/tools/timeout/mod.rs
+++ b/crates/openhuman-core/src/tools/timeout/mod.rs
@@ -89,7 +89,9 @@ pub fn set_tool_timeout_secs(config_secs: u64) -> u64 {
"[tool_timeout] config update ignored: env {ENV_VAR}={effective}s overrides requested {config_secs}s"
);
} else {
- log::debug!("[tool_timeout] runtime timeout set to {effective}s (requested {config_secs}s)");
+ log::debug!(
+ "[tool_timeout] runtime timeout set to {effective}s (requested {config_secs}s)"
+ );
}
effective
}
diff --git a/crates/openhuman-embed/tests/process_cancellation.rs b/crates/openhuman-embed/tests/process_cancellation.rs
index 7bbf983eb7..8146fd150f 100644
--- a/crates/openhuman-embed/tests/process_cancellation.rs
+++ b/crates/openhuman-embed/tests/process_cancellation.rs
@@ -2,8 +2,8 @@
#![cfg(target_os = "linux")]
-use tinytools_std::timeout::{output_or_kill, output_unbounded, ProcessCleanup};
use std::time::Duration;
+use tinytools_std::timeout::{output_or_kill, output_unbounded, ProcessCleanup};
/// Cancelling a tool must also stop descendants of its shell.
#[cfg(target_os = "linux")]