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 Enamakel4b3d20db0a91
diff --git a/crates/openhuman-core/src/agent/multimodal.rs b/crates/openhuman-core/src/agent/multimodal.rs
index ebe3580dc4..cfcd999f88 100644
--- a/crates/openhuman-core/src/agent/multimodal.rs
+++ b/crates/openhuman-core/src/agent/multimodal.rs
@@ -14,17 +14,16 @@ use async_trait::async_trait;
use reqwest::Client;
use crate::config::{
- build_runtime_proxy_client_with_timeouts, MultimodalConfig, MultimodalFileConfig,
+ MultimodalConfig, MultimodalFileConfig, build_runtime_proxy_client_with_timeouts,
};
use tinyagents_session::transcript::{TranscriptMessage, TranscriptPart};
use tinyagents_harness::multimodal::{
- self as mm,
+ self as mm, BlobAttachmentStash,
config::{FileLimits, ImageLimits},
markers,
payload::sha256_prefix,
- resolve::{resolve_file, resolve_image, TextExtractor},
- BlobAttachmentStash,
+ resolve::{TextExtractor, resolve_file, resolve_image},
};
use tinyagents_harness::multimodal::{FilePayload, MultimodalError};
diff --git a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
index 61b92e8651..d9848e44d5 100644
--- a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
+++ b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
@@ -261,9 +261,11 @@ async fn rehydrate_missing_stash_id_keeps_placeholder_text() {
"see [Image: image #att:deadbeefdeadbeef]".to_string(),
)];
let out = rehydrate_image_placeholders(&messages).await;
- assert!(out[0]
- .content
- .contains("[Image: image #att:deadbeefdeadbeef]"));
+ assert!(
+ out[0]
+ .content
+ .contains("[Image: image #att:deadbeefdeadbeef]")
+ );
assert!(!out[0].content.contains("[IMAGE:data:"));
}
diff --git a/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs b/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs
index da8fd5e366..b194a3cb87 100644
--- a/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs
+++ b/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs
@@ -21,9 +21,11 @@ async fn prepare_messages_rejects_too_many_images() {
.await
.expect_err("should reject image count overflow");
- assert!(error
- .to_string()
- .contains("multimodal image limit exceeded"));
+ assert!(
+ error
+ .to_string()
+ .contains("multimodal image limit exceeded")
+ );
}
#[tokio::test]
@@ -80,7 +82,8 @@ async fn prepare_messages_rejects_oversized_file() {
.await
.expect_err("oversized file must be rejected");
- assert!(err
- .to_string()
- .contains("multimodal file size limit exceeded"));
+ assert!(
+ err.to_string()
+ .contains("multimodal file size limit exceeded")
+ );
}
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 feb33e34e0..ad5bfa5e23 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -33,7 +33,7 @@ use super::types::OpenHumanSessionHost;
use crate::agent::{
message_convert::{user_message_from_text, user_text_with_markers},
session_host::{
- driver::OpenHumanSessionDriver, OpenHumanSessionHooks, OpenHumanTranscriptCodec,
+ OpenHumanSessionHooks, OpenHumanTranscriptCodec, driver::OpenHumanSessionDriver,
},
tinyagents::{host::OpenHumanRunContext, middleware::turn_context::TurnContextMiddleware},
};
@@ -76,8 +76,8 @@ struct OpenHumanTurnPrelude {
context_config: crate::config::ContextConfig,
tool_policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
tool_dispatcher: Arc<dyn tinytools_agent::dialect::ToolDialect>,
workspace_dir: std::path::PathBuf,
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs
index b0cb9e3e6c..5ded847bfa 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use tinyagents_harness::summarization::{checkpoint_message, SummaryPlacement};
+use tinyagents_harness::summarization::{SummaryPlacement, checkpoint_message};
use tinyinference_llm::ToolCall;
fn assistant_with_call(id: &str, name: &str) -> Message {
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
index 2137af49b0..54fe438700 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use std::{collections::HashSet, sync::Arc};
-use tinyagents_session::transcript::{session_stem, SessionRef};
+use tinyagents_session::transcript::{SessionRef, session_stem};
use tinyinference_llm::message::Message;
use tinytools::ToolSpec;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
index 47a0ce7450..4fa74e3d08 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
@@ -265,12 +265,14 @@ fn connected_mcp_actions_enter_search_and_leave_on_disconnect() {
.clear();
prelude.refresh_delegation_tool_surface().unwrap();
assert!(!synthesized_tool_names(&prelude).contains(&action));
- assert!(!prelude
- .tool_surface
- .lock()
- .expect("tool surface")
- .deferred_tool_names
- .contains(&action));
+ assert!(
+ !prelude
+ .tool_surface
+ .lock()
+ .expect("tool surface")
+ .deferred_tool_names
+ .contains(&action)
+ );
}
#[cfg(feature = "mcp")]
@@ -396,10 +398,12 @@ async fn desktop_browser_setting_keeps_deferred_tools_in_fresh_and_resumed_surfa
.expect("desktop orchestrator");
for name in ["browser", "browser_open"] {
assert!(host.deferred_tool_names.contains(name), "{name}");
- assert!(!host
- .visible_tool_specs_arc()
- .iter()
- .any(|spec| spec.name == name));
+ assert!(
+ !host
+ .visible_tool_specs_arc()
+ .iter()
+ .any(|spec| spec.name == name)
+ );
}
host.ensure_runtime_session().expect("runtime session");
let prelude = host
@@ -708,14 +712,18 @@ async fn newly_connected_action_cannot_shadow_a_permanent_source() {
mutable.connected_integrations_authoritative = true;
}
let error = prelude.refresh_delegation_tool_surface().unwrap_err();
- assert!(error
- .to_string()
- .contains("collision with synthesized tool"));
+ assert!(
+ error
+ .to_string()
+ .contains("collision with synthesized tool")
+ );
let surface = prelude.tool_surface.lock().unwrap();
assert!(Arc::ptr_eq(&surface.visible_tool_specs, &before));
assert_eq!(surface.tools[0].description(), "host-owned action");
- assert!(!surface
- .synthesized_tools
- .iter()
- .any(|tool| tool.name() == "GMAIL_SEND_EMAIL"));
+ assert!(
+ !surface
+ .synthesized_tools
+ .iter()
+ .any(|tool| tool.name() == "GMAIL_SEND_EMAIL")
+ );
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs b/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
index 7a98f77e2c..4caccf0619 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
@@ -260,11 +260,9 @@ fn build_turn_models_crate(
.host_overrides()
.and_then(|local| local.role_models.get("summarization").cloned())
{
- Some(custom) => crate::attachments::provider::wrap_injected(
- ctx,
- custom,
- Arc::new(config.clone()),
- ),
+ Some(custom) => {
+ crate::attachments::provider::wrap_injected(ctx, custom, Arc::new(config.clone()))
+ }
None => build_primary(model)?,
};
diff --git a/crates/openhuman-core/src/agent_registry/agents/fleet_prompt_tests.rs b/crates/openhuman-core/src/agent_registry/agents/fleet_prompt_tests.rs
index 3a48aa66c1..c561ed789d 100644
--- a/crates/openhuman-core/src/agent_registry/agents/fleet_prompt_tests.rs
+++ b/crates/openhuman-core/src/agent_registry/agents/fleet_prompt_tests.rs
@@ -6,8 +6,8 @@
//! anyone writing a test for it.
use super::load_builtins;
-use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent::prompts::PromptContext;
+use crate::agent_registry::host_definition::AgentDefinition;
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::sync::Arc;
use tinyagents_definition::{PromptSource, SubagentEntry, ToolScope};
diff --git a/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt.rs b/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt.rs
index 38e03d3bf4..4ba443c470 100644
--- a/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt.rs
+++ b/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt.rs
@@ -10,11 +10,11 @@
//! delegate to any more. That prose lives here (not in the shared prompts
//! module) so nobody has to branch on `agent_id` in a shared section impl.
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::prompts::{
ConnectedIntegration, PromptContext, render_datetime, render_identity, render_tools,
render_workspace,
};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::tools::orchestrator_tools::sanitise_slug;
use crate::tools::toolpacks;
use anyhow::Result;
diff --git a/crates/openhuman-core/src/agent_runs/mod.rs b/crates/openhuman-core/src/agent_runs/mod.rs
index 1a8844944d..30ab8d83e6 100644
--- a/crates/openhuman-core/src/agent_runs/mod.rs
+++ b/crates/openhuman-core/src/agent_runs/mod.rs
@@ -32,7 +32,8 @@ pub(crate) use worktree_schemas::{
};
/// Registers the orchestration RPC surfaces in their catalogue order.
-pub(crate) fn all_orchestration_registered_controllers() -> Vec<crate::core::all::RegisteredController> {
+pub(crate) fn all_orchestration_registered_controllers()
+-> Vec<crate::core::all::RegisteredController> {
let mut controllers = Vec::new();
controllers.extend(all_command_center_registered_controllers());
controllers.extend(all_workflow_run_registered_controllers());
diff --git a/crates/openhuman-core/src/agent_runs/schemas.rs b/crates/openhuman-core/src/agent_runs/schemas.rs
index ab8d788371..6abc67db60 100644
--- a/crates/openhuman-core/src/agent_runs/schemas.rs
+++ b/crates/openhuman-core/src/agent_runs/schemas.rs
@@ -384,9 +384,7 @@ fn handle_triage_evaluate(ctx: DispatchCtx, params: Map<String, Value>) -> Contr
let tunnel_id = p.external_id.as_deref().unwrap_or("unknown");
let method = p.toolkit.as_deref().unwrap_or("POST");
let path = p.trigger.as_deref().unwrap_or("/");
- crate::triage::TriggerEnvelope::from_webhook(
- tunnel_id, method, path, p.payload,
- )
+ crate::triage::TriggerEnvelope::from_webhook(tunnel_id, method, path, p.payload)
}
"cron" => {
tracing::trace!("[rpc][agent] building cron trigger envelope");
diff --git a/crates/openhuman-core/src/triage/events_tests.rs b/crates/openhuman-core/src/triage/events_tests.rs
index b66ef4890f..a593a9a379 100644
--- a/crates/openhuman-core/src/triage/events_tests.rs
+++ b/crates/openhuman-core/src/triage/events_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::triage::TriggerEnvelope;
use crate::core::events::DomainEvent;
+use crate::triage::TriggerEnvelope;
use serde_json::json;
use std::sync::Arc;
use tokio::sync::Mutex;
diff --git a/crates/openhuman-core/src/triage/origin_tests.rs b/crates/openhuman-core/src/triage/origin_tests.rs
index d6741923b9..e20b5af23b 100644
--- a/crates/openhuman-core/src/triage/origin_tests.rs
+++ b/crates/openhuman-core/src/triage/origin_tests.rs
@@ -124,9 +124,7 @@ fn every_dispatch_site_scopes_an_origin() {
// The triage module defines and tests `apply_decision`; it is the
// callee, not a call site. Test files model callers rather than
// being them.
- if rel.starts_with("crates/openhuman-core/src/triage/")
- || rel.ends_with("_tests.rs")
- {
+ if rel.starts_with("crates/openhuman-core/src/triage/") || rel.ends_with("_tests.rs") {
continue;
}
let Ok(text) = std::fs::read_to_string(&path) else {