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
style: apply rustfmt formatting and import ordering
Steven Enamakel71621605e7e4
diff --git a/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs b/crates/openhuman-core/src/agent/artifacts/migrate_tests.rsindex e6edda1cd0..478c2208b2 100644--- a/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs+++ b/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs@@ -4,7 +4,8 @@ use tempfile::TempDir;use super::*;use crate::agent::artifacts::store::{- get_artifact, list_artifacts, read_artifact_args, read_artifact_bytes, save_artifact_args, save_artifact_meta,+ get_artifact, list_artifacts, read_artifact_args, read_artifact_bytes, save_artifact_args,+ save_artifact_meta,};use crate::agent::artifacts::types::ArtifactKind;diff --git a/crates/openhuman-core/src/agent/tinyagents/budget_stop_turn_tests.rs b/crates/openhuman-core/src/agent/tinyagents/budget_stop_turn_tests.rsindex 7f48729b43..fed88cf87b 100644--- a/crates/openhuman-core/src/agent/tinyagents/budget_stop_turn_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/budget_stop_turn_tests.rs@@ -297,10 +297,11 @@ fn a_turn_before_its_wind_down_point_runs_to_its_final_answer() {.expect("scripted turn models build");let (tx, _rx) = tokio::sync::mpsc::channel(64);let mut context = root_context("deadline-fresh", "/tmp/deadline-fresh", tx);- context.turn_deadline =- Some(tinyagents_harness::turn_deadline::TurnDeadline::starting_now(+ context.turn_deadline = Some(+ tinyagents_harness::turn_deadline::TurnDeadline::starting_now(std::time::Duration::from_secs(900),- ));+ ),+ );let outcome = run_root_turn_via_hosted_agent(context,hosted_base(),diff --git a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs b/crates/openhuman-core/src/agent/tinyagents/host/mod.rsindex abf3a2e21d..c9d6d46523 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/mod.rs@@ -50,11 +50,11 @@ pub use definition_registry::OpenHumanDefinitionRegistry;pub use learning_sink::OpenHumanLearningSink;pub use model_resolver::OpenHumanModelResolver;pub use progress_sink::OpenHumanProgressSink;+pub(crate) use run_context::direct_subagent_child;pub use run_context::{decide_dispatch, DispatchDecision, DispatchInputs, LastTurnUsage, OpenHumanRunContext,SubagentUsageEntry, TurnDispatchState,};-pub(crate) use run_context::direct_subagent_child;pub(crate) use security_gate::with_untrusted_input_turn;pub use security_gate::OpenHumanSecurityGate;pub use tool_outcome_classifier::OpenHumanToolOutcomeClassifier;diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rsindex 7492b6678f..4ca1ffe45a 100644--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs@@ -21,11 +21,11 @@mod compaction_carry;pub mod config;+mod context_wiring;mod deadline_wind_down;pub mod discovery;mod embeddings;mod harness_assembly;-mod context_wiring;pub(crate) mod harness_tool_registration;pub mod host;pub(crate) mod hosted_error;diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rsindex 2476cfac2f..cdd346282b 100644--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs@@ -24,8 +24,8 @@ use std::sync::Arc;use anyhow::{anyhow, Result};use tinyagents_harness::context::RunContext;-use tinyagents_harness::summarization::summary_child_config;use tinyagents_harness::runtime::{AgentHarness, InvalidArgsPolicy, RunPolicy, UnknownToolPolicy};+use tinyagents_harness::summarization::payload_summarizer::summary_child_config;use tinyinference_llm::message::Message;use tracing::debug;diff --git a/crates/openhuman-core/src/integrations/composio/identity_store.rs b/crates/openhuman-core/src/integrations/composio/identity_store.rsindex 33edd37986..d372660c9c 100644--- a/crates/openhuman-core/src/integrations/composio/identity_store.rs+++ b/crates/openhuman-core/src/integrations/composio/identity_store.rs@@ -47,37 +47,41 @@ pub async fn persist_provider_profile(let written = rows.len();let (key_source, key_identifier) = (toolkit.clone(), identifier.clone());- file_store::update(config, IDENTITIES_FILE, move |identities: &mut Vec<ConnectedIdentity>| {- let index = match identities- .iter()- .position(|id| id.source == key_source && id.identifier == key_identifier)- {- Some(index) => index,- None => {- identities.push(ConnectedIdentity {- source: key_source.clone(),- identifier: key_identifier.clone(),- ..ConnectedIdentity::default()- });- identities.len() - 1- }- };- let entry = &mut identities[index];- for (kind, value) in rows.iter().cloned() {- let slot = match kind {- IdentityKind::DisplayName => &mut entry.display_name,- IdentityKind::Email => &mut entry.email,- IdentityKind::Handle => &mut entry.handle,- IdentityKind::Phone => &mut entry.phone,- IdentityKind::UserId => &mut entry.user_id,- IdentityKind::AvatarUrl => &mut entry.avatar_url,- IdentityKind::ProfileUrl => &mut entry.profile_url,+ file_store::update(+ config,+ IDENTITIES_FILE,+ move |identities: &mut Vec<ConnectedIdentity>| {+ let index = match identities+ .iter()+ .position(|id| id.source == key_source && id.identifier == key_identifier)+ {+ Some(index) => index,+ None => {+ identities.push(ConnectedIdentity {+ source: key_source.clone(),+ identifier: key_identifier.clone(),+ ..ConnectedIdentity::default()+ });+ identities.len() - 1+ }};- *slot = Some(value);- }- identities.sort_by(|a, b| (&a.source, &a.identifier).cmp(&(&b.source, &b.identifier)));- ((), true)- })+ let entry = &mut identities[index];+ for (kind, value) in rows.iter().cloned() {+ let slot = match kind {+ IdentityKind::DisplayName => &mut entry.display_name,+ IdentityKind::Email => &mut entry.email,+ IdentityKind::Handle => &mut entry.handle,+ IdentityKind::Phone => &mut entry.phone,+ IdentityKind::UserId => &mut entry.user_id,+ IdentityKind::AvatarUrl => &mut entry.avatar_url,+ IdentityKind::ProfileUrl => &mut entry.profile_url,+ };+ *slot = Some(value);+ }+ identities.sort_by(|a, b| (&a.source, &a.identifier).cmp(&(&b.source, &b.identifier)));+ ((), true)+ },+ ).await?;tracing::debug!(@@ -171,18 +175,22 @@ pub async fn delete_connected_identity_facets(let source = keys.next().unwrap_or_default();let identifier = keys.next().unwrap_or_default();- file_store::update(config, IDENTITIES_FILE, move |identities: &mut Vec<ConnectedIdentity>| {- let mut deleted = 0usize;- identities.retain(|id| {- if id.source == source && id.identifier == identifier {- deleted += field_count(id);- false- } else {- true- }- });- (deleted, deleted > 0)- })+ file_store::update(+ config,+ IDENTITIES_FILE,+ move |identities: &mut Vec<ConnectedIdentity>| {+ let mut deleted = 0usize;+ identities.retain(|id| {+ if id.source == source && id.identifier == identifier {+ deleted += field_count(id);+ false+ } else {+ true+ }+ });+ (deleted, deleted > 0)+ },+ ).await}diff --git a/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rs b/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rsindex f2ed283caa..0e366e078b 100644--- a/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rs@@ -90,11 +90,12 @@ async fn migrate_legacy(config: &Config) {}}if !rows.is_empty() {- let cleared = file_store::update(config, USER_SCOPES_FILE, |prefs: &mut LegacyScopeFile| {- prefs.clear();- ((), true)- })- .await;+ let cleared =+ file_store::update(config, USER_SCOPES_FILE, |prefs: &mut LegacyScopeFile| {+ prefs.clear();+ ((), true)+ })+ .await;if let Err(error) = cleared {tracing::warn!(%error, "{LOG} legacy pref file could not be emptied");return;diff --git a/crates/openhuman-core/src/platform/cost/tracker_documents.rs b/crates/openhuman-core/src/platform/cost/tracker_documents.rsindex 0f12c457b1..6226e88e5b 100644--- a/crates/openhuman-core/src/platform/cost/tracker_documents.rs+++ b/crates/openhuman-core/src/platform/cost/tracker_documents.rs@@ -38,7 +38,11 @@ pub(super) fn current(workspace_dir: &std::path::Path) -> Result<CostDocs> {if let Some(docs) = TEST_OVERRIDE.with(|slot| slot.borrow().clone()) {return Ok(docs);}- Ok(CostDocs(Repo::current_for(workspace_dir, DOMAIN, collections)?))+ Ok(CostDocs(Repo::current_for(+ workspace_dir,+ DOMAIN,+ collections,+ )?))}/// Runs `f` with `docs` standing in for the installed backend, on this threaddiff --git a/crates/openhuman-core/src/platform/cost/tracker_tests.rs b/crates/openhuman-core/src/platform/cost/tracker_tests.rsindex 2b842ed9e7..295c550e52 100644--- a/crates/openhuman-core/src/platform/cost/tracker_tests.rs+++ b/crates/openhuman-core/src/platform/cost/tracker_tests.rs@@ -1,7 +1,7 @@use super::*;+use chrono::{Datelike, Duration};use std::fs::{self, OpenOptions};use std::io::Write;-use chrono::{Datelike, Duration};use tempfile::TempDir;fn enabled_config() -> CostConfig {