Skip to content

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

chore: apply rustfmt import ordering and formatting

Steven Enamakel64c7ab515983
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 7558863483..655dfda545 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -9,11 +9,11 @@
//! appended to the conversation history.
use crate::agent::harness::definition::AgentDefinitionRegistry;
-use crate::agent::progress::AgentProgress;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
+use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- continue_subagent, continue_subagent_with_parent, load_subagent_checkpoint, SubagentRunOptions,
- SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, continue_subagent, continue_subagent_with_parent,
+ load_subagent_checkpoint,
};
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 d8b0d7a946..0c88959017 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
@@ -8,14 +8,14 @@ use super::subagent_abort_report::AbortReport;
use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::orchestration::fleet_tools::FleetToolSet;
use crate::agent::orchestration::running_subagents;
-use crate::agent::orchestration::tools::dispatch::incomplete_stop;
use crate::agent::orchestration::subagent_sessions::{
self, DurableSubagentStatus, SubagentSessionSelector, SubagentSessionStore,
SubagentSessionUpsert,
};
+use crate::agent::orchestration::tools::dispatch::incomplete_stop;
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
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 ed3f6de03b..342bdce928 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::{with_parent_context, ParentExecutionContext};
+use crate::agent::harness::fork_context::{ParentExecutionContext, with_parent_context};
use crate::agent::prompts::ToolCallFormat;
use crate::config::AgentConfig;
use std::collections::HashSet;
@@ -195,9 +195,10 @@ 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();
@@ -501,8 +502,10 @@ 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 565c39b240..903e52bf4c 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
@@ -13,10 +13,10 @@
//! prompt with a filtered tool list, on a cheaper model where applicable.
//!
use crate::agent::harness::definition::AgentDefinitionRegistry;
-use crate::agent::progress::AgentProgress;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
+use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent_with_parent,
};
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 c440b28499..4a88769a47 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,11 +51,13 @@ 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]
@@ -65,11 +67,13 @@ 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]
@@ -223,9 +227,11 @@ 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_sink_tests.rs b/crates/openhuman-core/src/agent/progress_sink_tests.rs
index f0990cfbe5..4117bc93ff 100644
--- a/crates/openhuman-core/src/agent/progress_sink_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_sink_tests.rs
@@ -37,12 +37,18 @@ async fn nested_scope_yields_the_inner_sink() {
.expect("a sink is visible inside the nested scope");
observed
- .send(AgentProgress::TurnCompleted { iterations: 1, stop: None })
+ .send(AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ })
.await
.expect("send on the innermost sink");
assert!(matches!(
inner_rx.recv().await,
- Some(AgentProgress::TurnCompleted { iterations: 1, stop: None })
+ Some(AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None
+ })
));
// The outer sink saw nothing — the inner scope shadows it.
assert!(outer_rx.try_recv().is_err());
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 ed2b76049f..57b00d7b09 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,12 +183,14 @@ 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)
@@ -224,7 +226,13 @@ fn late_child_tool_completion_after_subagent_completed_closes_the_span() {
child_tool_completed("t1", "c1", "get_node_kind_contract", 4),
2_050,
),
- (AgentProgress::TurnCompleted { iterations: 1, stop: None }, 400_000),
+ (
+ AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ },
+ 400_000,
+ ),
]);
c.finish(400_000);
let tool = find(c.spans(), "tool.get_node_kind_contract");
@@ -262,7 +270,13 @@ fn tool_without_completion_is_force_closed_at_its_parent_end() {
(tool_started("c1", "composio_list_toolkits", 1), 1_500),
(iteration(2), 2_000),
(simple_call("chat-v1"), 3_000),
- (AgentProgress::TurnCompleted { iterations: 2, stop: None }, 440_000),
+ (
+ AgentProgress::TurnCompleted {
+ iterations: 2,
+ stop: None,
+ },
+ 440_000,
+ ),
]);
c.finish(440_000);
let tool = find(c.spans(), "tool.composio_list_toolkits");
@@ -295,12 +309,14 @@ 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]
@@ -320,10 +336,12 @@ 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]
@@ -346,7 +364,13 @@ fn cancelled_turn_is_a_warning_not_an_error() {
fn completed_turn_is_not_reclassified_by_finish() {
let mut c = collect(&[
(AgentProgress::TurnStarted, 1_000),
- (AgentProgress::TurnCompleted { iterations: 1, stop: None }, 2_000),
+ (
+ AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ },
+ 2_000,
+ ),
]);
c.finish_with_outcome(
3_000,
@@ -450,9 +474,10 @@ 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 61f5467d22..c49d7bd9fc 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,12 +96,14 @@ 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")
@@ -335,12 +337,16 @@ 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 ─────────────────────────────────────────────────
@@ -498,12 +504,14 @@ 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 d4b3602417..8fb012217a 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::serialize::SpanEnvelope;
use tinyagents_harness::observability::trace_export::SpanKind;
+use tinyagents_harness::observability::trace_export::serialize::SpanEnvelope;
// ── config ────────────────────────────────────────────────────────────────
#[test]
@@ -64,7 +64,13 @@ fn full_turn_builds_correlated_span_tree() {
},
1_030,
),
- (AgentProgress::TurnCompleted { iterations: 1, stop: None }, 1_040),
+ (
+ AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ },
+ 1_040,
+ ),
]);
c.finish(2_000);
let spans = c.spans();
@@ -425,10 +431,11 @@ 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 8d995ef378..10462e6534 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::otlp::otlp_requests;
use tinyagents_harness::observability::trace_export::SpanStatus;
+use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
const BREAKER_NOTE: &str = "Stopping after 2 attempt(s): failure class \
`uncertain_side_effect` still blocks operation `web_answer_tool` on \
@@ -65,8 +65,16 @@ fn a_breaker_stopped_turn_closes_at_warning_with_stop_attributes() {
c.finish(50);
let spans = c.into_spans();
let turn = root(&spans);
- assert_ne!(turn.status, SpanStatus::Error, "a stop is not a harness error");
- assert_ne!(turn.status, SpanStatus::Ok, "a stop is not a clean completion");
+ assert_ne!(
+ turn.status,
+ SpanStatus::Error,
+ "a stop is not a harness error"
+ );
+ assert_ne!(
+ turn.status,
+ SpanStatus::Ok,
+ "a stop is not a clean completion"
+ );
assert_eq!(attr(turn, "observation.level"), Some("WARNING"));
assert_eq!(attr(turn, "turn.outcome"), Some("stopped"));
assert_eq!(attr(turn, "turn.stop_kind"), Some("breaker"));
@@ -166,7 +174,11 @@ fn a_stopped_subagent_span_closes_at_warning_with_stop_attributes() {
c.finish(50);
let spans = c.into_spans();
let sub = find(&spans, "subagent.Research");
- assert_ne!(sub.status, SpanStatus::Ok, "a stopped child is not a clean finish");
+ assert_ne!(
+ sub.status,
+ SpanStatus::Ok,
+ "a stopped child is not a clean finish"
+ );
assert_eq!(attr(sub, "observation.level"), Some("WARNING"));
assert_eq!(attr(sub, "turn.outcome"), Some("stopped"));
assert_eq!(attr(sub, "turn.stop_kind"), Some("breaker"));
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
index 0db9d48089..1ec0b56206 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
@@ -84,7 +84,13 @@ fn spawn(task: &str, display: &str) -> AgentProgress {
fn one_turn_spans() -> Vec<TraceSpan> {
let mut c = collect(&[
(AgentProgress::TurnStarted, 0),
- (AgentProgress::TurnCompleted { iterations: 1, stop: None }, 10),
+ (
+ AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ },
+ 10,
+ ),
]);
c.finish(10);
c.into_spans()
@@ -151,9 +157,9 @@ mod attribution_tests;
mod content_gate_tests;
#[path = "progress_tracing_span_tree_tests.rs"]
mod span_tree_tests;
+#[path = "progress_tracing_stop_tests.rs"]
+mod stop_tests;
#[path = "progress_tracing_tool_span_tests.rs"]
mod tool_span_tests;
#[path = "progress_tracing_ttft_tests.rs"]
mod ttft_tests;
-#[path = "progress_tracing_stop_tests.rs"]
-mod stop_tests;
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 fb3318acbb..b6984025d4 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::otlp::otlp_requests;
use tinyagents_harness::observability::trace_export::SpanKind;
+use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
fn iteration(iteration: u32) -> AgentProgress {
AgentProgress::IterationStarted {
@@ -90,12 +90,16 @@ 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/post_commit_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit_tests.rs
index af405a3ca9..67b84b1027 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/post_commit_tests.rs
@@ -52,7 +52,10 @@ async fn completion_is_published_before_slow_post_commit_work_finishes() {
};
let publish = async {
progress_tx
- .send(AgentProgress::TurnCompleted { iterations: 1, stop: None })
+ .send(AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ })
.await
.is_ok()
};
@@ -67,7 +70,10 @@ async fn completion_is_published_before_slow_post_commit_work_finishes() {
assert!(delivered);
assert!(matches!(
progress_rx.try_recv(),
- Ok(AgentProgress::TurnCompleted { iterations: 1, stop: None })
+ Ok(AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None
+ })
));
assert!(
!tail_done.load(std::sync::atomic::Ordering::SeqCst),
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 9b09206d5d..ff5f41e70f 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
@@ -43,7 +43,10 @@ async fn committed_progress_uses_each_turns_receipt_sender() {
));
assert!(matches!(
second_rx.recv().await,
- Some(AgentProgress::TurnCompleted { iterations: 2, stop: None })
+ Some(AgentProgress::TurnCompleted {
+ iterations: 2,
+ stop: None
+ })
));
assert!(matches!(
first_rx.try_recv(),
@@ -146,7 +149,10 @@ async fn committed_turn_completion_waits_for_a_full_progress_channel() {
tokio::time::timeout(std::time::Duration::from_secs(1), rx.recv())
.await
.expect("terminal progress event"),
- Some(AgentProgress::TurnCompleted { iterations: 2, stop: None })
+ Some(AgentProgress::TurnCompleted {
+ iterations: 2,
+ stop: None
+ })
));
assert!(matches!(
tokio::time::timeout(std::time::Duration::from_secs(1), rx.recv())
@@ -168,7 +174,9 @@ async fn committed_turn_completion_is_bounded_when_progress_stalls() {
let (tx, mut rx) = tokio::sync::mpsc::channel(1);
tx.send(AgentProgress::TurnStarted).await.unwrap();
- assert!(!super::progress::send_committed_turn_progress(&tx, "question", "answer", 2, None).await);
+ assert!(
+ !super::progress::send_committed_turn_progress(&tx, "question", "answer", 2, None).await
+ );
assert!(matches!(rx.recv().await, Some(AgentProgress::TurnStarted)));
assert!(rx.try_recv().is_err(), "timed-out send must be cancelled");
}
@@ -241,12 +249,14 @@ 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")]
@@ -276,10 +286,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_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
@@ -351,9 +363,11 @@ 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![
@@ -586,14 +600,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/host/budget_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
index 5ffa34e7ed..fe593773b2 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,9 +245,10 @@ 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]
@@ -312,9 +313,10 @@ 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 b41a4d3adb..67fc6ed5b5 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::{
- load_agents_md_layers, render_connected_identities, AgentsMdContent, ConnectedIntegration,
- PromptContext, PromptTool, SystemPromptBuilder, ToolCallFormat,
+ AgentsMdContent, ConnectedIntegration, PromptContext, PromptTool, SystemPromptBuilder,
+ ToolCallFormat, load_agents_md_layers, render_connected_identities,
};
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 d46bc04321..bc7d9dd51d 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,11 +42,13 @@ 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 5ac2e744a1..006e752af3 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,11 +121,13 @@ 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
@@ -293,9 +295,11 @@ 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
@@ -402,10 +406,12 @@ 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 ───────────────────────────────────────
@@ -496,11 +502,13 @@ 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 64e531fa37..37d36527f3 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, SessionTurnSidecar};
pub use run_context::{
- decide_dispatch, DispatchDecision, DispatchInputs, LastTurnUsage, OpenHumanRunContext,
- SubagentUsageEntry, TurnDispatchState,
+ DispatchDecision, DispatchInputs, LastTurnUsage, OpenHumanRunContext, SubagentUsageEntry,
+ TurnDispatchState, decide_dispatch,
};
-pub(crate) use security_gate::with_untrusted_input_turn;
+pub(crate) use run_context::{SessionTurnSidecar, direct_subagent_child};
pub use security_gate::OpenHumanSecurityGate;
+pub(crate) use security_gate::with_untrusted_input_turn;
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 3c4144b2c6..902d6ab2c2 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 e273f81526..66249deaf2 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::atomic::{AtomicU64, Ordering};
use std::sync::Mutex;
+use std::sync::atomic::{AtomicU64, Ordering};
use std::time::Instant;
use async_trait::async_trait;
-use tokio::sync::mpsc::error::TrySendError;
use tokio::sync::mpsc::Sender;
+use tokio::sync::mpsc::error::TrySendError;
use tinyagents_harness::host::{ProgressEvent, ProgressSink};
@@ -569,7 +569,7 @@ impl ProgressSink for OpenHumanProgressSink {
iterations,
stop: None,
})
- .await;
+ .await;
}
ProgressEvent::Error { run, message } => {
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs
index 0a8f7dac9e..c67be2d298 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs
@@ -406,7 +406,10 @@ async fn finished_without_usage_still_completes_the_turn() {
.await;
assert!(matches!(
rx.try_recv().expect("event forwarded"),
- AgentProgress::TurnCompleted { iterations: 1, stop: None }
+ AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None
+ }
));
}
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 d48cfa1dd0..15fcdede9e 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::{
- turn_outcome::ToolCallOutcome, turn_policy::ToolPolicyEnforcement, TurnContextMiddleware,
+ TurnContextMiddleware, turn_outcome::ToolCallOutcome, turn_policy::ToolPolicyEnforcement,
};
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 edb3ce09d1..06f8a39e19 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,16 +109,20 @@ 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 29596112ba..4f43c4c851 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::{redact_args, summarize_action, ApprovalGate, GateOutcome};
+use crate::security::approval::{ApprovalGate, GateOutcome, redact_args, summarize_action};
use crate::security::policy::{CommandClass, GateDecision as PolicyGateDecision, SecurityPolicy};
use crate::security::prompt_injection::{
- enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,
+ PromptEnforcementAction, PromptEnforcementContext, enforce_prompt_input,
};
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 32aaf4c3d0..2d57566630 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,20 +135,24 @@ 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]
@@ -180,10 +184,12 @@ 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]
@@ -537,10 +543,12 @@ 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 65affb6468..4480ecf61b 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::{classify, ToolFailureClass};
+use crate::tools::status::{ToolFailureClass, classify};
/// OpenHuman's [`ToolOutcomeClassifier`], backed by
/// [`crate::tools::status::classify`].
diff --git a/crates/openhuman-core/src/agent/turn_stop.rs b/crates/openhuman-core/src/agent/turn_stop.rs
index 565c5ab0c0..1c94f6865f 100644
--- a/crates/openhuman-core/src/agent/turn_stop.rs
+++ b/crates/openhuman-core/src/agent/turn_stop.rs
@@ -89,10 +89,9 @@ impl TurnStop {
let failure_class = backticked_after(lead, "failure class `")
.and_then(ident)
.or_else(|| {
- let key = crate::agent::session_host::stop_summary::StopReasonKind::from_stop_note(
- note,
- )
- .key();
+ let key =
+ crate::agent::session_host::stop_summary::StopReasonKind::from_stop_note(note)
+ .key();
ident(key.strip_prefix("turn_stop.").unwrap_or(key))
});
let operation = backticked_after(lead, "still blocks operation `").and_then(ident);
diff --git a/crates/openhuman-core/src/agent/turn_stop_tests.rs b/crates/openhuman-core/src/agent/turn_stop_tests.rs
index cf5b446a3e..13510cc551 100644
--- a/crates/openhuman-core/src/agent/turn_stop_tests.rs
+++ b/crates/openhuman-core/src/agent/turn_stop_tests.rs
@@ -69,10 +69,7 @@ fn an_incomplete_reason_maps_to_cap_or_breaker() {
.as_deref(),
Some("web_answer_tool")
);
- assert_eq!(
- TurnStop::wind_down().status_message(),
- "stopped: wind_down"
- );
+ assert_eq!(TurnStop::wind_down().status_message(), "stopped: wind_down");
assert_eq!(
TurnStop::iteration_cap().status_message(),
"stopped: iteration_cap"
diff --git a/crates/openhuman-core/src/skills/run_log.rs b/crates/openhuman-core/src/skills/run_log.rs
index 299014d7c0..2e6d75ab22 100644
--- a/crates/openhuman-core/src/skills/run_log.rs
+++ b/crates/openhuman-core/src/skills/run_log.rs
@@ -224,10 +224,7 @@ pub fn format_event(ev: &AgentProgress) -> Option<String> {
AgentProgress::TurnCompleted {
iterations,
stop: Some(stop),
- } => format!(
- "turn {} ({iterations} iterations)",
- stop.status_message()
- ),
+ } => format!("turn {} ({iterations} iterations)", stop.status_message()),
AgentProgress::TurnCompleted { iterations, .. } => {
format!("turn completed ({iterations} iterations)")
}
diff --git a/crates/openhuman-core/src/skills/run_log_tests.rs b/crates/openhuman-core/src/skills/run_log_tests.rs
index 0168e9e497..668b116d0d 100644
--- a/crates/openhuman-core/src/skills/run_log_tests.rs
+++ b/crates/openhuman-core/src/skills/run_log_tests.rs
@@ -85,11 +85,13 @@ 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);
@@ -245,17 +247,21 @@ 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(),
@@ -285,7 +291,10 @@ async fn drain_to_log_returns_the_turns_stop() {
.unwrap();
drop(tx);
let stop = drain_to_log(rx, path.clone()).await;
- assert_eq!(stop, Some(crate::agent::turn_stop::TurnStop::iteration_cap()));
+ assert_eq!(
+ stop,
+ Some(crate::agent::turn_stop::TurnStop::iteration_cap())
+ );
let log = std::fs::read_to_string(&path).expect("log written");
assert!(log.contains("stopped: iteration_cap"), "{log}");
}
diff --git a/crates/openhuman-core/src/skills/runtime/run_machinery.rs b/crates/openhuman-core/src/skills/runtime/run_machinery.rs
index cea5d5acab..27f7f03dcb 100644
--- a/crates/openhuman-core/src/skills/runtime/run_machinery.rs
+++ b/crates/openhuman-core/src/skills/runtime/run_machinery.rs
@@ -261,7 +261,10 @@ pub async fn spawn_workflow_run_background(
// The harness stopped the run's turn early (breaker,
// wind-down, iteration cap): it did not finish, so it is
// not `DONE`. `run_workflow` reports `STOPPED` as a failure.
- let summary = stop.as_ref().map(|s| s.status_message()).unwrap_or_default();
+ let summary = stop
+ .as_ref()
+ .map(|s| s.status_message())
+ .unwrap_or_default();
let _ = run_log::write_footer(&log_path, "STOPPED", ms, &out).await;
tracing::warn!(
run_id = %run_id,
diff --git a/crates/openhuman-core/src/threads/turn_state/mirror_observe_tests.rs b/crates/openhuman-core/src/threads/turn_state/mirror_observe_tests.rs
index 156d94516f..436e5f03cb 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror_observe_tests.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror_observe_tests.rs
@@ -447,7 +447,10 @@ fn turn_completed_keeps_snapshot_as_completed_and_finish_is_noop() {
let dir = tempdir().expect("tempdir");
let store = TurnStateStore::new(dir.path().to_path_buf());
let mut mirror = TurnStateMirror::new(store.clone(), "t", "req-1");
- mirror.observe(&AgentProgress::TurnCompleted { iterations: 3, stop: None });
+ mirror.observe(&AgentProgress::TurnCompleted {
+ iterations: 3,
+ stop: None,
+ });
// The snapshot is kept (not deleted) so a reloaded client can replay the
// finished turn's processing transcript, marked terminal `Completed` with
// the live fields quiesced.
diff --git a/crates/openhuman-core/src/voice/realtime_harness_tests.rs b/crates/openhuman-core/src/voice/realtime_harness_tests.rs
index 179ad526cb..d2850ea658 100644
--- a/crates/openhuman-core/src/voice/realtime_harness_tests.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness_tests.rs
@@ -102,7 +102,10 @@ fn spoken_delta_suppresses_internal_events() {
);
// Lifecycle events carry no spoken text.
assert_eq!(
- spoken_delta(&AgentProgress::TurnCompleted { iterations: 1, stop: None }),
+ spoken_delta(&AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None
+ }),
None
);
}
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs b/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs
index d8f81fba60..86469cbf03 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs
@@ -275,9 +275,12 @@ async fn stops_heartbeat_after_turn_completed() {
}
// Complete the turn, then drop the sender so the bridge loop breaks.
- tx.send(AgentProgress::TurnCompleted { iterations: 1, stop: None })
- .await
- .unwrap();
+ tx.send(AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ })
+ .await
+ .unwrap();
drop(tx);
// Let the bridge process TurnCompleted + observe the closed channel.
@@ -439,9 +442,12 @@ async fn wait_drained_returns_after_queued_events_are_forwarded() {
})
.await
.unwrap();
- tx.send(AgentProgress::TurnCompleted { iterations: 1, stop: None })
- .await
- .unwrap();
+ tx.send(AgentProgress::TurnCompleted {
+ iterations: 1,
+ stop: None,
+ })
+ .await
+ .unwrap();
// The sender stays alive (as a detached sub-agent's clone would), so the
// drain must come from `TurnCompleted`, not from the channel closing.