The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: reorder imports across multiple files
Steven Enamakel15c9e28d343d
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rsindex d03b29e9b9..8c9c7480f4 100644--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs@@ -237,7 +237,10 @@ fn hand_off_route(ctx: &PromptContext<'_>, specialist: &str) -> Option<String> {// itself. A filtered belt holding neither the delegate nor `use_skill` has// no way to reach the specialist, and naming one anyway is the same "call a// tool you do not have" failure this whole block exists to end (#6302).- if !ctx.visible_tool_names.contains(tinyagents_harness::tool::packs::USE_SKILL) {+ if !ctx+ .visible_tool_names+ .contains(tinyagents_harness::tool::packs::USE_SKILL)+ {return None;}toolpacks::pack_for_tool(&tool).map(|pack| {diff --git a/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs b/crates/openhuman-core/src/agent/session_host/artifact_wiring.rsindex c2224bb4b7..c3041cbd9f 100644--- a/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs+++ b/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs@@ -69,8 +69,7 @@ pub(super) fn build_artifact_store(action_dir: &Path,session_key: &str,) -> ToolResultArtifactStore {- let store =- new_tool_result_store(artifact_root(workspace_descriptor, action_dir), session_key);+ let store = new_tool_result_store(artifact_root(workspace_descriptor, action_dir), session_key);match store.prune_stale_sessions(ARTIFACT_RETENTION) {Ok(0) => {}Ok(removed) => log::debug!(diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rsindex a95c2f3bad..3c5fcfbe3d 100644--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs@@ -15,7 +15,6 @@ use tinyagents_registry::{CapabilityRegistry, RegistryDiagnostic, RegistrySnapshuse tinyinference_llm::model::CapabilitySet;use tokio::sync::mpsc::Sender;-use tinyagents_harness::store::InMemoryStore as ToolResultArtifactIndexStore;use crate::agent::progress::AgentProgress;use crate::agent::tinyagents::harness_context_ladder::install_context_ladder;use crate::agent::tinyagents::harness_tool_registration::register_turn_tools_and_agents;@@ -32,6 +31,7 @@ use crate::agent::tinyagents::tools::EarlyExitHook;use crate::agent::tinyagents::turn_models::TurnModels;use crate::agent::tinyagents::turn_outcome::{HaltSummarySlot, ToolOutcomeSink};use crate::agent::tinyagents::turn_policy::{run_policy_for, REPEATED_TOOL_FAILURE_THRESHOLD};+use tinyagents_harness::store::InMemoryStore as ToolResultArtifactIndexStore;use super::ToolPolicyEnforcement;diff --git a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rsindex 56b4234bde..c434e55e41 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs@@ -18,7 +18,6 @@ use tokio::sync::mpsc::Sender;use crate::agent::harness::definition::SandboxMode;use crate::agent::harness::fork_context::{AgentContextPreparedSource, ParentExecutionContext};-use tinyagents_harness::store::InMemoryStore as ToolResultArtifactIndexStore;use crate::agent::progress::AgentProgress;use crate::agent::stop_hooks::StopHook;use crate::agent::subagent_host::SubagentUsage;@@ -27,6 +26,7 @@ use crate::agent::tinyagents::{turn_outcome::ToolCallOutcome, turn_policy::ToolPolicyEnforcement, TurnContextMiddleware,};use crate::agent::turn_origin::AgentTurnOrigin;+use tinyagents_harness::store::InMemoryStore as ToolResultArtifactIndexStore;use tinyinference_llm::model::ResolvedModelRoute;/// Allocate a durable-unique root [`RunConfig`](tinyagents_harness::context::RunConfig).diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rsindex 1acb145351..e3019630e2 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs@@ -18,12 +18,12 @@ use tinytools::{ToolPolicy as TaToolPolicy, ToolResult as TaToolResult};use crate::agent::harness::tool_result_artifacts::{artifact_read_target, page_artifact_read, TINYAGENTS_TOOL_RESULT_ARTIFACT_STORE,};-use tinyagents_harness::artifacts::tool_results::{- apply_per_result_persistence, ArtifactRead, ToolResultArtifactStore,-};use crate::agent::tinyagents::payload_summarizer::PayloadSummarizer;use crate::inference::tokenjuice::generate::GenerateTicket;use crate::inference::tokenjuice::AgentTokenjuiceCompression;+use tinyagents_harness::artifacts::tool_results::{+ apply_per_result_persistence, ArtifactRead, ToolResultArtifactStore,+};/// TinyJuice's own estimate: `ceil(characters / 4)`, not bytes. Multibyte/// content has more bytes than characters, so a byte-based estimate herediff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rsindex ab7a06ee9a..abe596c5fe 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output_tests.rs@@ -14,10 +14,12 @@ async fn same_tool_calls_persist_artifacts_under_distinct_call_ids() {let middleware = ToolOutputMiddleware {budget_bytes: 8,payload_summarizer: None,- artifact_store: Some(crate::agent::harness::tool_result_artifacts::new_tool_result_store(- temp.path().to_path_buf(),- "identity-session",- )),+ artifact_store: Some(+ crate::agent::harness::tool_result_artifacts::new_tool_result_store(+ temp.path().to_path_buf(),+ "identity-session",+ ),+ ),tokenjuice_compaction_enabled: false,tokenjuice_compression: AgentTokenjuiceCompression::Off,runtime_config: None,diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rsindex 562fea6283..0fa69d83da 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs@@ -140,7 +140,10 @@ impl ToolPolicyMiddleware {}/// The route sentence for a pack, resolved against THIS session.- pub(crate) fn route_for_pack(&self, pack: &tinyagents_harness::tool::packs::ToolPack) -> String {+ pub(crate) fn route_for_pack(+ &self,+ pack: &tinyagents_harness::tool::packs::ToolPack,+ ) -> String {tinyagents_harness::tool::packs::route_sentence(&self.callable_delegates_for(pack.owners),pack.owners,diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rsindex 66c3053fd4..7eea0665d4 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs@@ -16,10 +16,10 @@ use tinyinference_llm::message::Message;use tinyinference_llm::model::{ModelRequest, ModelResponse, ResolvedModelRoute};use tinytools::{ToolPolicy as TaToolPolicy, ToolResult as TaToolResult};-use tinyagents_harness::artifacts::tool_results::ToolResultArtifactStore;use crate::agent::tinyagents::payload_summarizer::PayloadSummarizer;use crate::agent::tinyagents::turn_outcome::ToolCallOutcome;use crate::inference::tokenjuice::AgentTokenjuiceCompression;+use tinyagents_harness::artifacts::tool_results::ToolResultArtifactStore;use super::tool_output::ToolOutputMiddleware;diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_wrap_up_toc_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_wrap_up_toc_tests.rsindex 36e56ea030..265bf3c1ed 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_wrap_up_toc_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_wrap_up_toc_tests.rs@@ -301,9 +301,7 @@ async fn ctx_with_artifacts_and_config(config: RunConfig,) -> RunContext<crate::agent::tinyagents::host::OpenHumanRunContext> {use tinyagents_harness::store::StoreRegistry;- let index = std::sync::Arc::new(- tinyagents_harness::store::InMemoryStore::new(),- );+ let index = std::sync::Arc::new(tinyagents_harness::store::InMemoryStore::new());for (call_id, tool, path, bytes) in entries {let mut fields = serde_json::Map::new();fields.insert("tool".to_string(), (*tool).into());diff --git a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rsindex f4371aec4b..01ee5a32af 100644--- a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs@@ -19,12 +19,12 @@ use crate::agent::harness::ParentExecutionContext;use crate::agent::prompts::ToolCallFormat;use crate::agent::tinyagents::tools::CanonicalSharedToolAdapter;use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};-use tinyagents_harness::tool::packs::{PackRegistryHandle, UseSkillTool};use async_trait::async_trait;use serde_json::json;use std::path::Path;use std::sync::Arc;use tinyagents_harness::context::RunConfig;+use tinyagents_harness::tool::packs::{PackRegistryHandle, UseSkillTool};use tinyagents_harness::CallId;use tinyinference_llm::message::Message;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};@@ -178,14 +178,19 @@ fn parent_execution_context(workspace_dir: &Path) -> ParentExecutionContext {/// wrapping `use_skill` that the harness would have registered.fn build_use_skill_dispatch() -> UseSkillDispatch {let handle = PackRegistryHandle::default();- let use_skill_tool: Box<dyn Tool> = Box::new(UseSkillTool::new(handle.clone(), crate::tools::toolpacks::CATALOG));+ let use_skill_tool: Box<dyn Tool> = Box::new(UseSkillTool::new(+ handle.clone(),+ crate::tools::toolpacks::CATALOG,+ ));let create_image_tool: Box<dyn Tool> = Box::new(StubCreateImage);let durable: Arc<Vec<Box<dyn Tool>>> = Arc::new(vec![use_skill_tool, create_image_tool]);handle.bind(Arc::downgrade(&durable));- let adapter =- CanonicalSharedToolAdapter::for_name(vec![durable], tinyagents_harness::tool::packs::USE_SKILL)- .expect("use_skill resolves in the durable registry it was just placed in");+ let adapter = CanonicalSharedToolAdapter::for_name(+ vec![durable],+ tinyagents_harness::tool::packs::USE_SKILL,+ )+ .expect("use_skill resolves in the durable registry it was just placed in");UseSkillDispatch::new(Arc::new(adapter), handle)}diff --git a/crates/openhuman-core/src/tools/toolpacks/ops.rs b/crates/openhuman-core/src/tools/toolpacks/ops.rsindex fe49e692b1..0bfa4fb820 100644--- a/crates/openhuman-core/src/tools/toolpacks/ops.rs+++ b/crates/openhuman-core/src/tools/toolpacks/ops.rs@@ -12,7 +12,10 @@ use tinytools::Tool;/// It starts unbound; [`bind_pack_registry`] gives it its view of the registry/// once that is behind an `Arc`.pub fn append_pack_tools(tools: &mut Vec<Box<dyn Tool>>) {- tools.push(Box::new(UseSkillTool::new(PackRegistryHandle::default(), registry::CATALOG)));+ tools.push(Box::new(UseSkillTool::new(+ PackRegistryHandle::default(),+ registry::CATALOG,+ )));}/// Point the pack tool at the durable registry it lives in.diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rsindex 39d306dff4..99d2f5e29f 100644--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs@@ -31,7 +31,10 @@ fn the_index_drops_a_pack_this_session_can_call_nothing_in() {// Only the workflows pack is reachable.let workflows = pack("workflows").expect("workflows pack");- let kept = tinyagents_harness::tool::packs::scope_use_skill_spec(&CATALOG, &mut spec, &|name| workflows.tools.contains(&name));+ let kept =+ tinyagents_harness::tool::packs::scope_use_skill_spec(&CATALOG, &mut spec, &|name| {+ workflows.tools.contains(&name)+ });assert!(kept,"workflows is callable, so use_skill stays on the wire"@@ -57,7 +60,9 @@ fn the_index_drops_a_pack_this_session_can_call_nothing_in() {fn the_skill_enum_offers_only_reachable_packs() {let mut spec = use_skill_spec();let workflows = pack("workflows").expect("workflows pack");- tinyagents_harness::tool::packs::scope_use_skill_spec(&CATALOG, &mut spec, &|name| workflows.tools.contains(&name));+ tinyagents_harness::tool::packs::scope_use_skill_spec(&CATALOG, &mut spec, &|name| {+ workflows.tools.contains(&name)+ });let values = spec.parameters@@ -92,7 +97,9 @@ fn scoping_the_index_only_ever_shrinks_it() {let mut spec = use_skill_spec();let before = spec.description.len();let workflows = pack("workflows").expect("workflows pack");- tinyagents_harness::tool::packs::scope_use_skill_spec(&CATALOG, &mut spec, &|name| workflows.tools.contains(&name));+ tinyagents_harness::tool::packs::scope_use_skill_spec(&CATALOG, &mut spec, &|name| {+ workflows.tools.contains(&name)+ });assert!(spec.description.len() < before,"scoped index ({}) must be smaller than the full one ({before})",@@ -237,7 +244,8 @@ fn a_non_owner_listing_omits_the_tools_the_gate_will_refuse() {let handle = crate::tools::host_extensions::pack_registry_handle(find(&tools, USE_SKILL)).expect("use_skill carries the pack handle");- let rendered = tinyagents_harness::tool::packs::render_pack_filtered(&CATALOG,+ let rendered = tinyagents_harness::tool::packs::render_pack_filtered(+ &CATALOG,"workflows",handle,&|name: &str| name != "propose_workflow",@@ -264,8 +272,14 @@ fn a_listing_with_nothing_callable_names_the_route_out() {.expect("use_skill carries the pack handle");let route = route_sentence(&["build_workflow".to_string()], &["workflow_builder"]);- let err = tinyagents_harness::tool::packs::render_pack_filtered(&CATALOG, "workflows", handle, &|_| false, &route)- .expect_err("nothing callable must not render a menu");+ let err = tinyagents_harness::tool::packs::render_pack_filtered(+ &CATALOG,+ "workflows",+ handle,+ &|_| false,+ &route,+ )+ .expect_err("nothing callable must not render a menu");assert!(err.contains("build_workflow"),diff --git a/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs b/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rsindex c4f0f4bfeb..8b8710dd1a 100644--- a/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs@@ -27,13 +27,11 @@ use std::sync::Arc;use async_trait::async_trait;use serde_json::{json, Value};-use openhuman_core::agent::tool_policy::{- GeneratedToolRuntimeContext, GeneratedToolRuntimeRisk,-};+use openhuman_core::agent::tool_policy::{GeneratedToolRuntimeContext, GeneratedToolRuntimeRisk};use openhuman_core::skills::types::tool_result_from_mcp;+use openhuman_core::tools::host_extensions::{generated_runtime_context, pack_registry_handle};use openhuman_core::tools::toolpacks::registry::{CATALOG, PACKS};use tinyagents_harness::tool::packs::{PackRegistryHandle, UseSkillTool};-use openhuman_core::tools::host_extensions::{generated_runtime_context, pack_registry_handle};use tinytools::{PermissionLevel, Tool, ToolResult};/// A production pack tool's registry handle survives the round trip through