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 assert formatting

Steven Enamakel1a85f60247e4
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
index 655dfda545..d10ad78758 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -12,8 +12,8 @@ use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunStatus, continue_subagent, continue_subagent_with_parent,
- load_subagent_checkpoint,
+ continue_subagent, continue_subagent_with_parent, load_subagent_checkpoint, SubagentRunOptions,
+ SubagentRunStatus,
};
use async_trait::async_trait;
use serde_json::json;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
index 0c88959017..2b68730791 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
@@ -15,7 +15,7 @@ use crate::agent::orchestration::subagent_sessions::{
use crate::agent::orchestration::tools::dispatch::incomplete_stop;
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
+ run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
};
use crate::threads::store::{self as conversations, ConversationMessage};
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
index 342bdce928..ed3f6de03b 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::agent::harness::definition::AgentDefinitionRegistry;
-use crate::agent::harness::fork_context::{ParentExecutionContext, with_parent_context};
+use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};
use crate::agent::prompts::ToolCallFormat;
use crate::config::AgentConfig;
use std::collections::HashSet;
@@ -195,10 +195,9 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
.iter()
.filter_map(|v| v.as_str())
.collect();
- assert!(
- next.iter()
- .any(|a| a.contains("delivered to you automatically"))
- );
+ assert!(next
+ .iter()
+ .any(|a| a.contains("delivered to you automatically")));
let message = format_async_subagent_accepted("task_manager_agent", &serialized, &fleet);
let prose = message.split("[async_subagent_ref]").next().unwrap();
@@ -502,10 +501,8 @@ fn scoped_instance_advertises_exactly_the_allowlist() {
schema["properties"]["agent_id"]["enum"],
serde_json::json!(["agent_memory", "workflow_builder"])
);
- assert!(
- schema["properties"]["agent_id"]["description"]
- .as_str()
- .unwrap_or_default()
- .contains("only these are dispatchable")
- );
+ assert!(schema["properties"]["agent_id"]["description"]
+ .as_str()
+ .unwrap_or_default()
+ .contains("only these are dispatchable"));
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
index 903e52bf4c..e1d7b5cc15 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
@@ -16,7 +16,7 @@ use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent_with_parent,
+ run_subagent_with_parent, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
};
use crate::threads::store::{self as conversations, ConversationMessage, CreateConversationThread};
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
index 4a88769a47..c440b28499 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
@@ -51,13 +51,11 @@ fn parameters_schema_advertises_dedicated_thread_flag() {
assert_eq!(flag.get("type").and_then(|v| v.as_str()), Some("boolean"));
// Must be off by default — workers are an opt-in escape hatch, not
// a free upgrade for every spawn.
- assert!(
- schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
- .unwrap_or(true)
- );
+ assert!(schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
+ .unwrap_or(true));
}
#[test]
@@ -67,13 +65,11 @@ fn parameters_schema_advertises_optional_model_override() {
let props = schema.get("properties").expect("schema has properties");
let model = props.get("model").expect("model override advertised");
assert_eq!(model.get("type").and_then(|v| v.as_str()), Some("string"));
- assert!(
- schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
- .unwrap_or(true)
- );
+ assert!(schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
+ .unwrap_or(true));
}
#[test]
@@ -227,11 +223,9 @@ async fn legacy_archetype_alias_is_accepted_for_lookup() {
.await
.unwrap();
assert!(result.is_error);
- assert!(
- result
- .output()
- .contains("unknown agent_id 'totally_made_up'")
- );
+ assert!(result
+ .output()
+ .contains("unknown agent_id 'totally_made_up'"));
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs
index 57b00d7b09..fed11cb7d7 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs
@@ -183,14 +183,12 @@ fn single_synthetic_delta_at_completion_records_no_ttft() {
(simple_call("gpt-6.1-sol"), 9_000),
]);
let g = generations(c.spans())[0];
- assert!(
- !g.attributes
- .contains_key("gen_ai.response.first_token_unix_ms")
- );
- assert!(
- !g.attributes
- .contains_key("gen_ai.response.time_to_first_token_ms")
- );
+ assert!(!g
+ .attributes
+ .contains_key("gen_ai.response.first_token_unix_ms"));
+ assert!(!g
+ .attributes
+ .contains_key("gen_ai.response.time_to_first_token_ms"));
assert_eq!(
g.attributes["gen_ai.response.streamed"],
serde_json::json!(false)
@@ -309,14 +307,12 @@ fn turn_without_completion_is_an_error() {
exported_attr(c.spans(), "agent.turn", "langfuse.observation.level").as_deref(),
Some("ERROR")
);
- assert!(
- exported_attr(
- c.spans(),
- "agent.turn",
- "langfuse.observation.status_message"
- )
- .is_some()
- );
+ assert!(exported_attr(
+ c.spans(),
+ "agent.turn",
+ "langfuse.observation.status_message"
+ )
+ .is_some());
}
#[test]
@@ -336,12 +332,10 @@ fn failed_turn_message_is_content_gated() {
let mut captured = collect_with_capture(&[(AgentProgress::TurnStarted, 1_000)]);
captured.finish_with_outcome(2_000, Some(failed()));
let turn = find(captured.spans(), "agent.turn");
- assert!(
- turn.attributes["error.message"]
- .as_str()
- .unwrap()
- .contains("provider rejected")
- );
+ assert!(turn.attributes["error.message"]
+ .as_str()
+ .unwrap()
+ .contains("provider rejected"));
}
#[test]
@@ -474,10 +468,9 @@ fn unpriced_model_placeholder_cost_is_not_recorded() {
g.attributes["gen_ai.cost.source"],
serde_json::json!("unpriced")
);
- assert!(
- !g.attributes
- .contains_key("gen_ai.pricing.input_per_mtok_usd")
- );
+ assert!(!g
+ .attributes
+ .contains_key("gen_ai.pricing.input_per_mtok_usd"));
assert_eq!(
exported_attr(
c.spans(),
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
index c49d7bd9fc..61f5467d22 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
@@ -96,14 +96,12 @@ fn tool_io_is_captured_when_capture_content_is_on() {
4,
);
let child_tool = find(c.spans(), "tool.read_file");
- assert!(
- child_tool
- .input
- .as_ref()
- .and_then(|v| v.as_str())
- .unwrap()
- .contains("notes.md")
- );
+ assert!(child_tool
+ .input
+ .as_ref()
+ .and_then(|v| v.as_str())
+ .unwrap()
+ .contains("notes.md"));
assert_eq!(
child_tool.output.as_ref().and_then(|v| v.as_str()),
Some("file contents")
@@ -337,16 +335,12 @@ fn zero_reasoning_turn_leaves_root_without_reasoning_attr() {
]);
c.finish(20);
let turn = find(c.spans(), "agent.turn");
- assert!(
- !turn
- .attributes
- .contains_key("gen_ai.usage.reasoning_tokens")
- );
- assert!(
- !turn
- .attributes
- .contains_key("gen_ai.usage.cache_creation_tokens")
- );
+ assert!(!turn
+ .attributes
+ .contains_key("gen_ai.usage.reasoning_tokens"));
+ assert!(!turn
+ .attributes
+ .contains_key("gen_ai.usage.cache_creation_tokens"));
}
// ── run-type classification ─────────────────────────────────────────────────
@@ -504,14 +498,12 @@ fn generation_records_request_messages_and_completion_when_capture_on() {
input.to_string().contains("You are OpenHuman."),
"system prompt must land in the generation input: {input}"
);
- assert!(
- generation
- .output
- .as_ref()
- .expect("generation output")
- .to_string()
- .contains("hello")
- );
+ assert!(generation
+ .output
+ .as_ref()
+ .expect("generation output")
+ .to_string()
+ .contains("hello"));
}
#[test]
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs
index 8fb012217a..7a370d27d7 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs
@@ -1,8 +1,8 @@
use super::*;
use crate::agent::progress_tracing::export::export_spans;
-use tinyagents_harness::observability::trace_export::SpanKind;
use tinyagents_harness::observability::trace_export::serialize::SpanEnvelope;
+use tinyagents_harness::observability::trace_export::SpanKind;
// ── config ────────────────────────────────────────────────────────────────
#[test]
@@ -431,11 +431,10 @@ fn finish_seals_all_open_spans_idempotently() {
assert!(c.spans().iter().all(|s| s.end_unix_ms.is_some()));
// idempotent.
c.finish(200);
- assert!(
- c.spans()
- .iter()
- .all(|s| s.end_unix_ms == Some(s.end_unix_ms.unwrap()))
- );
+ assert!(c
+ .spans()
+ .iter()
+ .all(|s| s.end_unix_ms == Some(s.end_unix_ms.unwrap())));
}
#[test]
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
index 10462e6534..b9a88a3b6f 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
@@ -6,8 +6,8 @@
use super::*;
use crate::agent::turn_stop::TurnStop;
-use tinyagents_harness::observability::trace_export::SpanStatus;
use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
+use tinyagents_harness::observability::trace_export::SpanStatus;
const BREAKER_NOTE: &str = "Stopping after 2 attempt(s): failure class \
`uncertain_side_effect` still blocks operation `web_answer_tool` on \
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
index b6984025d4..fb3318acbb 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
@@ -3,8 +3,8 @@
use super::*;
-use tinyagents_harness::observability::trace_export::SpanKind;
use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
+use tinyagents_harness::observability::trace_export::SpanKind;
fn iteration(iteration: u32) -> AgentProgress {
AgentProgress::IterationStarted {
@@ -90,16 +90,12 @@ fn unary_call_carries_no_first_token_attributes() {
(completed(1), 2_500),
]);
let generation = generations(c.spans())[0];
- assert!(
- !generation
- .attributes
- .contains_key("gen_ai.response.first_token_unix_ms")
- );
- assert!(
- !generation
- .attributes
- .contains_key("gen_ai.response.time_to_first_text_ms")
- );
+ assert!(!generation
+ .attributes
+ .contains_key("gen_ai.response.first_token_unix_ms"));
+ assert!(!generation
+ .attributes
+ .contains_key("gen_ai.response.time_to_first_text_ms"));
}
#[test]
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 ff5f41e70f..a19e1d18ad 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
@@ -249,14 +249,12 @@ fn connected_mcp_actions_enter_search_and_leave_on_disconnect() {
.clear();
prelude.refresh_delegation_tool_surface().unwrap();
assert!(!prelude.synthesized_tool_names_for_test().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 = "modules")]
@@ -286,12 +284,10 @@ 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_for_test().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
@@ -363,11 +359,9 @@ async fn a_resumed_orchestrator_keeps_the_integration_actions_it_was_sent() {
// Fresh process: no integrations known, so no actions are synthesised.
prelude.refresh_delegation_tool_surface().unwrap();
- assert!(
- !prelude
- .synthesized_tool_names_for_test()
- .contains("GMAIL_SEND_EMAIL")
- );
+ assert!(!prelude
+ .synthesized_tool_names_for_test()
+ .contains("GMAIL_SEND_EMAIL"));
// Resume hands back what the thread was sent.
let recorded = ToolSnapshot::new(vec![
@@ -600,18 +594,14 @@ 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/host/budget_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
index fe593773b2..5ffa34e7ed 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
@@ -245,10 +245,9 @@ fn a_refusing_budget_refuses_the_agent_over_it() {
fn a_warning_budget_never_refuses() {
let (_tmp, tracker) = ledger_with(2.0, "planner");
let gate = budgeted_gate(crate::config::BudgetAction::Warn);
- assert!(
- gate.check_budgets_against(&estimate_for("planner"), &gate.live_budgets(), &tracker)
- .is_none()
- );
+ assert!(gate
+ .check_budgets_against(&estimate_for("planner"), &gate.live_budgets(), &tracker)
+ .is_none());
}
#[tokio::test]
@@ -313,10 +312,9 @@ fn a_call_is_checked_against_its_own_model() {
// Another call left a different model in the shared attribution.
*gate.last_model.write() = "other".into();
let policies = gate.live_budgets();
- assert!(
- gate.check_budgets_against(&estimate_for("planner"), &policies, &tracker)
- .is_some()
- );
+ assert!(gate
+ .check_budgets_against(&estimate_for("planner"), &policies, &tracker)
+ .is_some());
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
index 67fc6ed5b5..b41a4d3adb 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs
@@ -69,8 +69,8 @@ use tinyagents_harness::host::{ContextComposer, TurnContextRequest};
use tinyinference_llm::message::Message;
use crate::agent::prompts::{
- AgentsMdContent, ConnectedIntegration, PromptContext, PromptTool, SystemPromptBuilder,
- ToolCallFormat, load_agents_md_layers, render_connected_identities,
+ load_agents_md_layers, render_connected_identities, AgentsMdContent, ConnectedIntegration,
+ PromptContext, PromptTool, SystemPromptBuilder, ToolCallFormat,
};
use crate::config::{Config, DEFAULT_MODEL};
use crate::skills::Workflow;
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs
index bc7d9dd51d..d46bc04321 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs
@@ -42,13 +42,11 @@ async fn composes_a_non_empty_prompt_carrying_the_agent_id() {
async fn preamble_is_empty_and_not_an_error() {
let dir = tempfile::tempdir().expect("tempdir");
let composer = OpenHumanContextComposer::new(config_in(dir.path()));
- assert!(
- composer
- .preamble(&request())
- .await
- .expect("preamble succeeds")
- .is_empty()
- );
+ assert!(composer
+ .preamble(&request())
+ .await
+ .expect("preamble succeeds")
+ .is_empty());
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs
index 006e752af3..5ac2e744a1 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs
@@ -121,13 +121,11 @@ async fn a_worker_parent_authorizes_nothing() {
synthetic("a_worker", AgentTier::Worker, &[]),
]);
- assert!(
- registry
- .delegates_for("leaf")
- .await
- .expect("delegates")
- .is_empty()
- );
+ assert!(registry
+ .delegates_for("leaf")
+ .await
+ .expect("delegates")
+ .is_empty());
// The *declared* list is still reported on the definition — declared
// and authorized are different questions.
let def = registry
@@ -295,11 +293,9 @@ fn named_discovery_scope_authorizes_only_registered_deferred_tools() {
let without_discovery = registry_of(vec![def.clone()])
.with_deferred_tools(Arc::new(vec!["browser_open".into()]))
.project(&def);
- assert!(
- !without_discovery
- .tools
- .contains(&"browser_open".to_string())
- );
+ assert!(!without_discovery
+ .tools
+ .contains(&"browser_open".to_string()));
}
/// A wildcard scope carrying a denylist must be materialised against the
@@ -406,12 +402,10 @@ fn the_projection_carries_the_definition_rule_layer() {
let mut open = synthetic("open", AgentTier::Worker, &[]);
open.disallowed_tools.clear();
- assert!(
- registry_of(vec![open.clone()])
- .project(&open)
- .tool_rules
- .is_none()
- );
+ assert!(registry_of(vec![open.clone()])
+ .project(&open)
+ .tool_rules
+ .is_none());
}
// ── config-backed custom agents ───────────────────────────────────────
@@ -502,13 +496,11 @@ async fn an_empty_catalogue_misses_everything_without_erroring() {
let registry = registry_of(Vec::new());
assert_eq!(registry.resolve("anything").await.expect("resolve"), None);
assert!(registry.list().await.expect("list").is_empty());
- assert!(
- registry
- .delegates_for("anything")
- .await
- .expect("delegates")
- .is_empty()
- );
+ assert!(registry
+ .delegates_for("anything")
+ .await
+ .expect("delegates")
+ .is_empty());
}
/// The defect behind #6404 / #6392 / #6393, at the layer that caused it.
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs b/crates/openhuman-core/src/agent/tinyagents/host/mod.rs
index 37d36527f3..65ee8d5dad 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/mod.rs
@@ -51,10 +51,10 @@ pub use learning_sink::OpenHumanLearningSink;
pub use model_resolver::OpenHumanModelResolver;
pub use progress_sink::OpenHumanProgressSink;
pub use run_context::{
- DispatchDecision, DispatchInputs, LastTurnUsage, OpenHumanRunContext, SubagentUsageEntry,
- TurnDispatchState, decide_dispatch,
+ decide_dispatch, DispatchDecision, DispatchInputs, LastTurnUsage, OpenHumanRunContext,
+ SubagentUsageEntry, TurnDispatchState,
};
-pub(crate) use run_context::{SessionTurnSidecar, direct_subagent_child};
-pub use security_gate::OpenHumanSecurityGate;
+pub(crate) use run_context::{direct_subagent_child, SessionTurnSidecar};
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/host/model_resolver.rs b/crates/openhuman-core/src/agent/tinyagents/host/model_resolver.rs
index 902d6ab2c2..3c4144b2c6 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/model_resolver.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/model_resolver.rs
@@ -67,9 +67,9 @@ use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use async_trait::async_trait;
-use tinyagents_harness::Result as TaResult;
use tinyagents_harness::error::TinyAgentsError;
use tinyagents_harness::host::{ModelResolveRequest, ModelResolver};
+use tinyagents_harness::Result as TaResult;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse, ModelStream};
use crate::config::Config;
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs
index 66249deaf2..6566decc45 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs
@@ -99,13 +99,13 @@
//! forwarded.
use std::collections::HashMap;
-use std::sync::Mutex;
use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::Mutex;
use std::time::Instant;
use async_trait::async_trait;
-use tokio::sync::mpsc::Sender;
use tokio::sync::mpsc::error::TrySendError;
+use tokio::sync::mpsc::Sender;
use tinyagents_harness::host::{ProgressEvent, ProgressSink};
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 15fcdede9e..d48cfa1dd0 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/run_context.rs
@@ -23,7 +23,7 @@ use crate::agent::stop_hooks::StopHook;
use crate::agent::subagent_host::SubagentUsage;
use crate::agent::tinyagents::turn_outcome::ToolOutcomeSink;
use crate::agent::tinyagents::{
- TurnContextMiddleware, turn_outcome::ToolCallOutcome, turn_policy::ToolPolicyEnforcement,
+ turn_outcome::ToolCallOutcome, turn_policy::ToolPolicyEnforcement, TurnContextMiddleware,
};
use crate::agent::turn_origin::AgentTurnOrigin;
use tinyagents_harness::store::InMemoryStore as ToolResultArtifactIndexStore;
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 06f8a39e19..edb3ce09d1 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
@@ -109,20 +109,16 @@ fn child_inherits_tree_handles_but_isolates_observations_and_usage() {
assert_eq!(child.spawn_depth, 1);
assert_eq!(child.thread_id.as_deref(), Some("thread-a"));
assert!(child.file_state_agent_id().is_none());
- assert!(
- child
- .resolved_route
- .lock()
- .expect("child route lock")
- .is_none()
- );
- assert!(
- child
- .subagent_usage
- .lock()
- .expect("child usage lock")
- .is_empty()
- );
+ assert!(child
+ .resolved_route
+ .lock()
+ .expect("child route lock")
+ .is_none());
+ assert!(child
+ .subagent_usage
+ .lock()
+ .expect("child usage lock")
+ .is_empty());
parent.cancellation.cancel();
assert!(child.cancellation.is_cancelled());
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 4f43c4c851..29596112ba 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs
@@ -85,10 +85,10 @@ use tinyagents_harness::host::security_gate::{
};
use crate::agent::tinyagents::policy_denial::PolicyDenial;
-use crate::security::approval::{ApprovalGate, GateOutcome, redact_args, summarize_action};
+use crate::security::approval::{redact_args, summarize_action, ApprovalGate, GateOutcome};
use crate::security::policy::{CommandClass, GateDecision as PolicyGateDecision, SecurityPolicy};
use crate::security::prompt_injection::{
- PromptEnforcementAction, PromptEnforcementContext, enforce_prompt_input,
+ enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,
};
use crate::tools::agent_policy::{ToolPolicyAction, ToolPolicySession};
use tinytools::{PermissionLevel, Tool};
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs
index 2d57566630..32aaf4c3d0 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs
@@ -135,24 +135,20 @@ async fn an_unregistered_tool_is_denied_not_allowed() {
.await
.unwrap();
assert!(!decision.is_allowed());
- assert!(
- decision
- .denial_reason()
- .expect("denial reason")
- .contains("definitely_not_a_tool")
- );
+ assert!(decision
+ .denial_reason()
+ .expect("denial reason")
+ .contains("definitely_not_a_tool"));
}
#[tokio::test]
async fn an_empty_registry_denies_everything() {
let gate = OpenHumanSecurityGate::new(policy(AutonomyLevel::Full), Vec::new());
- assert!(
- !gate
- .authorize_tool(&req("read_file", json!({})))
- .await
- .unwrap()
- .is_allowed()
- );
+ assert!(!gate
+ .authorize_tool(&req("read_file", json!({})))
+ .await
+ .unwrap()
+ .is_allowed());
}
#[tokio::test]
@@ -184,12 +180,10 @@ async fn a_write_shell_command_is_blocked_outright_in_read_only() {
.await
.unwrap();
assert!(!decision.is_allowed());
- assert!(
- decision
- .denial_reason()
- .expect("denial reason")
- .contains(crate::security::POLICY_BLOCKED_MARKER)
- );
+ assert!(decision
+ .denial_reason()
+ .expect("denial reason")
+ .contains(crate::security::POLICY_BLOCKED_MARKER));
}
#[tokio::test]
@@ -543,12 +537,10 @@ async fn a_nested_call_is_refused_even_for_a_read_only_tool() {
.await
.unwrap();
assert!(!decision.is_allowed());
- assert!(
- decision
- .denial_reason()
- .expect("denial reason")
- .contains("may not call other tools")
- );
+ assert!(decision
+ .denial_reason()
+ .expect("denial reason")
+ .contains("may not call other tools"));
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs
index 4480ecf61b..65affb6468 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs
@@ -75,7 +75,7 @@ use std::sync::Arc;
use tinyagents_harness::host::{OutcomeClass, ToolOutcomeClassifier};
use tinytools::ToolResult;
-use crate::tools::status::{ToolFailureClass, classify};
+use crate::tools::status::{classify, ToolFailureClass};
/// OpenHuman's [`ToolOutcomeClassifier`], backed by
/// [`crate::tools::status::classify`].
diff --git a/crates/openhuman-core/src/skills/run_log_tests.rs b/crates/openhuman-core/src/skills/run_log_tests.rs
index 668b116d0d..290092dddb 100644
--- a/crates/openhuman-core/src/skills/run_log_tests.rs
+++ b/crates/openhuman-core/src/skills/run_log_tests.rs
@@ -85,13 +85,11 @@ fn scan_runs_parses_header_footer_and_status() {
assert_eq!(all[0].duration_ms, None);
assert_eq!(all[1].status, "DONE");
assert_eq!(all[1].duration_ms, Some(617236));
- assert!(
- all[1]
- .finished
- .as_deref()
- .unwrap()
- .starts_with("2026-05-28T08:01:30")
- );
+ assert!(all[1]
+ .finished
+ .as_deref()
+ .unwrap()
+ .starts_with("2026-05-28T08:01:30"));
// Filter by workflow_id
let only_pr = scan_runs(tmp.path(), Some("pr-review-shepherd"), 10);
@@ -247,21 +245,17 @@ fn read_terminal_outcome_requires_finished_line() {
#[test]
fn noisy_events_are_skipped_steps_are_kept() {
- assert!(
- format_event(&AgentProgress::TextDelta {
- delta: "hi".into(),
- iteration: 1
- })
- .is_none()
- );
+ assert!(format_event(&AgentProgress::TextDelta {
+ delta: "hi".into(),
+ iteration: 1
+ })
+ .is_none());
// Content (prompt/reply) rides its own event and is never logged here.
- assert!(
- format_event(&AgentProgress::TurnContent {
- input: Some("secret prompt".into()),
- output: Some("secret reply".into()),
- })
- .is_none()
- );
+ assert!(format_event(&AgentProgress::TurnContent {
+ input: Some("secret prompt".into()),
+ output: Some("secret reply".into()),
+ })
+ .is_none());
let line = format_event(&AgentProgress::ToolCallStarted {
call_id: "c1".into(),
tool_name: "memory_search".into(),