Skip to content

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

chore(agent): apply rustfmt formatting across agent modules

Steven Enamakele1f463e6937b
diff --git a/crates/openhuman-core/src/agent/goals/runtime.rs b/crates/openhuman-core/src/agent/goals/runtime.rs
index df5246a200..8a46d85c69 100644
--- a/crates/openhuman-core/src/agent/goals/runtime.rs
+++ b/crates/openhuman-core/src/agent/goals/runtime.rs
@@ -32,7 +32,10 @@ use tinyagents_hooks::stop::{StopDecision, StopHook, TurnState};
pub async fn load_for_thread(workspace_dir: &Path, thread_id: Option<&str>) -> Option<ThreadGoal> {
let thread_id = normalized_thread(thread_id)?;
let store = crate::agent::session_store::stores_or_ephemeral(workspace_dir).kv;
- match tinyagents_graph::goals::store::get(&store, &thread_id).await.map_err(|e| e.to_string()) {
+ match tinyagents_graph::goals::store::get(&store, &thread_id)
+ .await
+ .map_err(|e| e.to_string())
+ {
Ok(goal) => goal,
Err(e) => {
tracing::debug!(thread_id = %thread_id, error = %e, "[thread_goals] load_for_thread failed");
@@ -49,7 +52,10 @@ pub async fn resume_for_thread(
) -> Option<Option<ThreadGoal>> {
let thread_id = normalized_thread(thread_id)?;
let store = crate::agent::session_store::stores_or_ephemeral(workspace_dir).kv;
- match tinyagents_graph::goals::store::resume(&store, &thread_id).await.map_err(|e| e.to_string()) {
+ match tinyagents_graph::goals::store::resume(&store, &thread_id)
+ .await
+ .map_err(|e| e.to_string())
+ {
Ok(goal) => {
if goal.status.is_active() {
BUS.publish(DomainEvent::ThreadGoalUpdated {
@@ -82,7 +88,10 @@ pub async fn complete_for_thread(workspace_dir: &Path, thread_id: Option<&str>)
return;
};
let store = crate::agent::session_store::stores_or_ephemeral(workspace_dir).kv;
- match tinyagents_graph::goals::store::complete(&store, &thread_id).await.map_err(|e| e.to_string()) {
+ match tinyagents_graph::goals::store::complete(&store, &thread_id)
+ .await
+ .map_err(|e| e.to_string())
+ {
Ok(goal) => {
if matches!(goal.status, ThreadGoalStatus::Complete) {
BUS.publish(DomainEvent::ThreadGoalUpdated {
@@ -111,7 +120,10 @@ pub async fn clear_for_thread(workspace_dir: &Path, thread_id: Option<&str>) {
return;
};
let store = crate::agent::session_store::stores_or_ephemeral(workspace_dir).kv;
- match tinyagents_graph::goals::store::clear(&store, &thread_id).await.map_err(|e| e.to_string()) {
+ match tinyagents_graph::goals::store::clear(&store, &thread_id)
+ .await
+ .map_err(|e| e.to_string())
+ {
Ok(existed) => {
if existed {
BUS.publish(DomainEvent::ThreadGoalCleared {
@@ -153,7 +165,10 @@ pub async fn account_turn_against_goal(
return;
};
let store = crate::agent::session_store::stores_or_ephemeral(workspace_dir).kv;
- let prev = match tinyagents_graph::goals::store::get(&store, &thread_id).await.map_err(|e| e.to_string()) {
+ let prev = match tinyagents_graph::goals::store::get(&store, &thread_id)
+ .await
+ .map_err(|e| e.to_string())
+ {
Ok(Some(goal)) => goal,
Ok(None) => return,
Err(e) => {
diff --git a/crates/openhuman-core/src/agent/goals/runtime_tests.rs b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
index eb3a0ae8b6..a6c4a3277f 100644
--- a/crates/openhuman-core/src/agent/goals/runtime_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
@@ -15,9 +15,22 @@ fn cost_with_tokens(input: u64, output: u64) -> TurnCost {
async fn account_turn_charges_active_goal_and_trips_budget() {
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-acct", "obj", Some(100)).await.unwrap();
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-acct",
+ "obj",
+ Some(100),
+ )
+ .await
+ .unwrap();
account_turn_against_goal(&dir, Some("t-acct"), 80, 40, 3).await; // 120 >= 100
- let g = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-acct").await.unwrap().unwrap();
+ let g = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-acct",
+ )
+ .await
+ .unwrap()
+ .unwrap();
assert_eq!(g.tokens_used, 120);
assert_eq!(g.status, ThreadGoalStatus::BudgetLimited);
}
@@ -26,12 +39,23 @@ async fn account_turn_charges_active_goal_and_trips_budget() {
async fn account_turn_skips_non_active_goal() {
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-paused", "obj", Some(1000))
- .await
- .unwrap();
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-paused",
+ "obj",
+ Some(1000),
+ )
+ .await
+ .unwrap();
store::pause(&dir, "t-paused").await.unwrap();
account_turn_against_goal(&dir, Some("t-paused"), 500, 500, 1).await;
- let g = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-paused").await.unwrap().unwrap();
+ let g = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-paused",
+ )
+ .await
+ .unwrap()
+ .unwrap();
assert_eq!(g.tokens_used, 0, "paused goal must not accrue usage");
}
@@ -41,11 +65,22 @@ async fn complete_for_thread_settles_active_goal() {
// later turn stops re-injecting its `[active_goal]` block (#1725).
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-complete", "obj", Some(1000))
- .await
- .unwrap();
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-complete",
+ "obj",
+ Some(1000),
+ )
+ .await
+ .unwrap();
complete_for_thread(&dir, Some("t-complete")).await;
- let g = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-complete").await.unwrap().unwrap();
+ let g = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-complete",
+ )
+ .await
+ .unwrap()
+ .unwrap();
assert_eq!(
g.status,
ThreadGoalStatus::Complete,
@@ -63,11 +98,21 @@ async fn clear_for_thread_removes_the_goal_row() {
// injects no goal block at all — the strongest anti-leak guarantee.
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-clear", "obj", Some(1000))
- .await
- .unwrap();
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-clear",
+ "obj",
+ Some(1000),
+ )
+ .await
+ .unwrap();
clear_for_thread(&dir, Some("t-clear")).await;
- let g = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-clear").await.unwrap();
+ let g = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-clear",
+ )
+ .await
+ .unwrap();
assert!(
g.is_none(),
"clearing must delete the goal row so no [active_goal] can leak forward"
@@ -82,7 +127,15 @@ async fn complete_and_clear_are_safe_without_a_goal_or_thread() {
let dir = tmp.path().to_path_buf();
complete_for_thread(&dir, Some("t-empty")).await;
clear_for_thread(&dir, Some("t-empty")).await;
- assert!(tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-empty").await.unwrap().is_none());
+ assert!(
+ tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-empty"
+ )
+ .await
+ .unwrap()
+ .is_none()
+ );
// No ambient thread scope at all.
complete_for_thread(&dir, None).await;
clear_for_thread(&dir, None).await;
@@ -92,9 +145,14 @@ async fn complete_and_clear_are_safe_without_a_goal_or_thread() {
async fn account_turn_clears_suppression_without_losing_usage() {
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- let goal = tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-suppressed", "obj", Some(1000))
- .await
- .unwrap();
+ let goal = tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-suppressed",
+ "obj",
+ Some(1000),
+ )
+ .await
+ .unwrap();
tinyagents_graph::goals::store::set_continuation_suppressed_if(
&crate::agent::session_store::stores_or_ephemeral(&dir).kv,
"t-suppressed",
@@ -106,7 +164,13 @@ async fn account_turn_clears_suppression_without_losing_usage() {
account_turn_against_goal(&dir, Some("t-suppressed"), 80, 40, 3).await;
- let updated = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-suppressed").await.unwrap().unwrap();
+ let updated = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-suppressed",
+ )
+ .await
+ .unwrap()
+ .unwrap();
assert_eq!(updated.goal_id, goal.goal_id);
assert!(!updated.continuation_suppressed);
assert_eq!(updated.tokens_used, 120);
@@ -117,12 +181,25 @@ async fn account_turn_clears_suppression_without_losing_usage() {
async fn budget_stop_hook_fires_on_crossing() {
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- let goal = tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-hook", "obj", Some(1000)).await.unwrap();
+ let goal = tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-hook",
+ "obj",
+ Some(1000),
+ )
+ .await
+ .unwrap();
// 600 already used in a prior turn.
store::account_usage(&dir, "t-hook", &goal.goal_id, 600, 0)
.await
.unwrap();
- let goal = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "t-hook").await.unwrap().unwrap();
+ let goal = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "t-hook",
+ )
+ .await
+ .unwrap()
+ .unwrap();
let hook = GoalBudgetStopHook::for_goal(&dir, &goal).expect("budgeted active goal");
// This turn so far: 300 in + 200 out = 500. 600 + 500 = 1100 >= 1000.
@@ -150,10 +227,30 @@ async fn budget_stop_hook_fires_on_crossing() {
async fn no_hook_without_budget_or_when_inactive() {
let tmp = tempfile::tempdir().unwrap();
let dir = tmp.path().to_path_buf();
- let no_budget = tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "a", "obj", None).await.unwrap();
+ let no_budget = tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "a",
+ "obj",
+ None,
+ )
+ .await
+ .unwrap();
assert!(GoalBudgetStopHook::for_goal(&dir, &no_budget).is_none());
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "b", "obj", Some(100)).await.unwrap();
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "b",
+ "obj",
+ Some(100),
+ )
+ .await
+ .unwrap();
store::pause(&dir, "b").await.unwrap();
- let paused = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "b").await.unwrap().unwrap();
+ let paused = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "b",
+ )
+ .await
+ .unwrap()
+ .unwrap();
assert!(GoalBudgetStopHook::for_goal(&dir, &paused).is_none());
}
diff --git a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
index 9d3e3fa61a..5dd7a5796b 100644
--- a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
@@ -17,8 +17,8 @@ use std::sync::Arc;
use super::*;
use crate::security::{AutonomyLevel, SecurityPolicy, TrustedAccess, TrustedRoot};
use tinyagents_harness::artifacts::{
- extract_artifact_paths, ArtifactKind, ArtifactPathPolicy, ARTIFACT_POINTER_PREFIX,
- DEFAULT_OFFLOAD_THRESHOLD_BYTES,
+ ARTIFACT_POINTER_PREFIX, ArtifactKind, ArtifactPathPolicy, DEFAULT_OFFLOAD_THRESHOLD_BYTES,
+ extract_artifact_paths,
};
/// Policy with disjoint action/workspace roots, the shipped default layout
diff --git a/crates/openhuman-core/src/agent/harness/artifact_offload/policy.rs b/crates/openhuman-core/src/agent/harness/artifact_offload/policy.rs
index b39e2d065d..5307f30e60 100644
--- a/crates/openhuman-core/src/agent/harness/artifact_offload/policy.rs
+++ b/crates/openhuman-core/src/agent/harness/artifact_offload/policy.rs
@@ -15,8 +15,8 @@ use std::sync::Arc;
use tinyagents_harness::artifacts::{ArtifactPathPolicy, ArtifactRedactor, Redacted};
-use crate::security::scrub::sanitize_text;
use crate::security::SecurityPolicy;
+use crate::security::scrub::sanitize_text;
/// Refuses artifact writes that reach the core's internal `workspace_dir`.
///
diff --git a/crates/openhuman-core/src/agent/harness/mod.rs b/crates/openhuman-core/src/agent/harness/mod.rs
index 763e02ecf7..f3aa94972a 100644
--- a/crates/openhuman-core/src/agent/harness/mod.rs
+++ b/crates/openhuman-core/src/agent/harness/mod.rs
@@ -21,11 +21,11 @@
//! `crate::agent::tinyagents`); there is no in-house interrupt fence.
pub mod artifact_offload;
-#[cfg(test)]
-pub(crate) mod test_support;
pub mod fork_context;
pub(crate) mod graph;
pub mod host_definition;
+#[cfg(test)]
+pub(crate) mod test_support;
pub(crate) mod tool_result_artifacts;
// NOTE: deliberately no flat re-export here. `artifact_offload::ArtifactKind`
diff --git a/crates/openhuman-core/src/agent/harness/test_support.rs b/crates/openhuman-core/src/agent/harness/test_support.rs
index 7eeffc8884..000b1dbc7e 100644
--- a/crates/openhuman-core/src/agent/harness/test_support.rs
+++ b/crates/openhuman-core/src/agent/harness/test_support.rs
@@ -139,4 +139,3 @@ pub(crate) fn test_inherit_parallel_worker_def() -> AgentDefinition {
role: None,
}
}
-
diff --git a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs
index f0c4f187da..a0f233fa26 100644
--- a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs
+++ b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs
@@ -32,7 +32,7 @@ use serde_json::Value;
use tinyagents_harness::artifacts::tool_results::{self, ArtifactRead, ToolResultArtifactStore};
use tinystoragedrivers::BlobStore;
-use crate::agent::harness::artifact_offload::{SanitizingRedactor, READ_TOOL};
+use crate::agent::harness::artifact_offload::{READ_TOOL, SanitizingRedactor};
use tinytools_std::filesystem::FileReadTool;
/// Namespace of the artifact index in the run's store registry.
diff --git a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs
index 17d69363ae..ffb5d8c337 100644
--- a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs
@@ -131,12 +131,14 @@ async fn artifacts_are_tenant_scoped() {
fn read_targets_use_openhumans_tool_names() {
let path = "artifacts/tool-results/s/shell/c.txt";
assert!(artifact_read_target(None, "file_read", &json!({"path": path})).is_some());
- assert!(artifact_read_target(
- None,
- "use_skill",
- &json!({"skill": "files", "tool": "file_read", "args": {"path": path, "offset": 3}})
- )
- .is_some_and(|read| read.offset == 3));
+ assert!(
+ artifact_read_target(
+ None,
+ "use_skill",
+ &json!({"skill": "files", "tool": "file_read", "args": {"path": path, "offset": 3}})
+ )
+ .is_some_and(|read| read.offset == 3)
+ );
assert!(artifact_read_target(None, "glob", &json!({"path": path})).is_none());
}
@@ -148,18 +150,22 @@ fn read_targets_recognise_the_stores_blob_keys() {
let store = in_memory_tool_result_store(tmp.path().join("tool-results"), "s");
let pointer = store.path_for_read_tool("shell", Some("c"));
assert!(artifact_read_target(Some(&store), "file_read", &json!({"path": pointer})).is_some());
- assert!(artifact_read_target(
- Some(&store),
- "use_skill",
- &json!({"skill": "files", "tool": "file_read", "args": {"path": pointer, "offset": 3}})
- )
- .is_some_and(|read| read.offset == 3));
- assert!(artifact_read_target(
- Some(&store),
- "file_read",
- &json!({"path": "tool-results-backup/s/x.txt"})
- )
- .is_none());
+ assert!(
+ artifact_read_target(
+ Some(&store),
+ "use_skill",
+ &json!({"skill": "files", "tool": "file_read", "args": {"path": pointer, "offset": 3}})
+ )
+ .is_some_and(|read| read.offset == 3)
+ );
+ assert!(
+ artifact_read_target(
+ Some(&store),
+ "file_read",
+ &json!({"path": "tool-results-backup/s/x.txt"})
+ )
+ .is_none()
+ );
}
/// A continuation names `file_read` and the offset, in the wire format the
diff --git a/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs
index e13a72d926..251c9da071 100644
--- a/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs
@@ -4,7 +4,7 @@
//! (from the sibling `prompt.md`) plus the same section helpers the
//! runtime uses for every other agent.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs
index 33465e4267..f49292881f 100644
--- a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs
@@ -3,7 +3,7 @@
//! Returns the final, fully-assembled system prompt — archetype body (from the
//! sibling `prompt.md`) plus the shared section helpers every agent uses.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/mod.rs b/crates/openhuman-core/src/agent/registry/agents/mod.rs
index a3e76b9207..81ca434c00 100644
--- a/crates/openhuman-core/src/agent/registry/agents/mod.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/mod.rs
@@ -41,4 +41,4 @@ pub mod trigger_triage;
pub mod video_agent;
pub mod vision_agent;
-pub use loader::{load_builtins, BuiltinAgent, BUILTINS};
+pub use loader::{BUILTINS, BuiltinAgent, load_builtins};
diff --git a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs
index 0b426cde48..9e348c3a05 100644
--- a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs
@@ -6,7 +6,7 @@
//! post-processing in the runner.
use crate::agent::prompts::{
- render_ambient_environment, render_tools, render_workspace, PromptContext,
+ PromptContext, render_ambient_environment, render_tools, render_workspace,
};
use anyhow::Result;
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 dcaf64a65f..78ad090e83 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs
@@ -12,8 +12,8 @@
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::prompts::{
- render_datetime, render_identity, render_tools, render_workspace, ConnectedIntegration,
- PromptContext,
+ ConnectedIntegration, PromptContext, render_datetime, render_identity, render_tools,
+ render_workspace,
};
use crate::tools::orchestrator_tools::sanitise_slug;
use crate::tools::toolpacks;
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index aef1458827..e17c0bb27e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -379,8 +379,11 @@ fn connected_integrations_block_is_format_independent() {
#[test]
fn connected_integrations_block_routes_capability_questions_to_search() {
let guide = render_connected_integrations(&gmail_only());
- assert!(guide
- .contains("Its results, not prior knowledge or past answers, say what a toolkit can do."));
+ assert!(
+ guide.contains(
+ "Its results, not prior knowledge or past answers, say what a toolkit can do."
+ )
+ );
assert!(!guide.contains("integrations_agent"));
}
@@ -517,8 +520,11 @@ fn build_carries_the_spec_check_grounding_rules() {
assert!(body.contains("Checks must mirror how the task is specified or graded"));
assert!(body.contains("Never delete state, data or services the solution needs at runtime"));
assert!(body.contains("Verify the final state as a fresh consumer would see it."));
- assert!(body
- .contains("List the request's stated constraints, filters and thresholds as `todo` items"));
+ assert!(
+ body.contains(
+ "List the request's stated constraints, filters and thresholds as `todo` items"
+ )
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs
index 2619e896a6..41189f65a1 100644
--- a/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs
@@ -5,7 +5,7 @@
//! in the order it wants — so the output IS what the LLM sees, no
//! post-processing in the runner.
-use crate::agent::prompts::{render_datetime, render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_datetime, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs
index b38c582fe0..2848b375ea 100644
--- a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs
@@ -1,6 +1,6 @@
//! System prompt builder for the `presentation_agent` built-in agent.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs
index 72af15c1eb..94f0c2da8b 100644
--- a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs
@@ -5,7 +5,7 @@
//! in the order it wants — so the output IS what the LLM sees, no
//! post-processing in the runner.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
/// The summarizer archetype: TinyJuice's extraction contract, verbatim.
diff --git a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs
index d0f8f653ee..5780703fb2 100644
--- a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs
@@ -1,6 +1,6 @@
//! System prompt builder for the `task_manager_agent` built-in agent.
-use crate::agent::prompts::{render_safety, render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_safety, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs
index 220ac357f9..1c2341a57e 100644
--- a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs
@@ -5,7 +5,7 @@
//! in the order it wants — so the output IS what the LLM sees, no
//! post-processing in the runner.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs
index 1b273b99c1..8d5d4d3fcc 100644
--- a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs
@@ -5,7 +5,7 @@
//! in the order it wants — so the output IS what the LLM sees, no
//! post-processing in the runner.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs
index dbdc9a717e..b256b47a00 100644
--- a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs
@@ -3,7 +3,7 @@
//! Returns the final, fully-assembled system prompt — archetype body (from the
//! sibling `prompt.md`) plus the shared section helpers every agent uses.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs
index 0503f89948..173ee56ebc 100644
--- a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs
@@ -4,7 +4,7 @@
//! (from the sibling `prompt.md`) plus the same section helpers the
//! runtime uses for every other agent.
-use crate::agent::prompts::{render_tools, render_workspace, PromptContext};
+use crate::agent::prompts::{PromptContext, render_tools, render_workspace};
use anyhow::Result;
const ARCHETYPE: &str = include_str!("prompt.md");
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
index f5acaaee9e..22dac9ce05 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
@@ -298,7 +298,8 @@ fn wildcard_delegate_visibility_admits_new_connections_and_removes_revoked_ones(
#[tokio::test]
async fn committed_goal_accounting_uses_direct_and_completed_child_usage() {
let workspace = tempfile::tempdir().unwrap();
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(workspace.path()).kv,
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(workspace.path()).kv,
"receipt-goal",
"finish migration",
Some(20),
@@ -325,10 +326,13 @@ async fn committed_goal_accounting_uses_direct_and_completed_child_usage() {
account_committed_turn_against_goal(workspace.path(), Some("receipt-goal"), &sidecar).await;
- let goal = tinyagents_graph::goals::store::get(&crate::agent::session_store::stores_or_ephemeral(workspace.path()).kv, "receipt-goal")
- .await
- .unwrap()
- .unwrap();
+ let goal = tinyagents_graph::goals::store::get(
+ &crate::agent::session_store::stores_or_ephemeral(workspace.path()).kv,
+ "receipt-goal",
+ )
+ .await
+ .unwrap()
+ .unwrap();
assert_eq!(
goal.tokens_used, 21,
"receipt accounts direct + child usage"
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 7b9e908b59..1f229a693c 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
@@ -135,11 +135,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
@@ -301,27 +303,35 @@ fn named_discovery_scope_authorizes_only_registered_deferred_tools() {
"blocked_secret".into(),
]))
.project(&def);
- assert!(projected
- .tools
- .named_tools()
- .contains(&"browser_open".to_string()));
- assert!(projected
- .tools
- .named_tools()
- .contains(&"browser".to_string()));
- assert!(!projected
- .tools
- .named_tools()
- .contains(&"blocked_secret".to_string()));
+ assert!(
+ projected
+ .tools
+ .named_tools()
+ .contains(&"browser_open".to_string())
+ );
+ assert!(
+ projected
+ .tools
+ .named_tools()
+ .contains(&"browser".to_string())
+ );
+ assert!(
+ !projected
+ .tools
+ .named_tools()
+ .contains(&"blocked_secret".to_string())
+ );
def.tools = ToolScope::Named(vec!["file_read".into()]);
let without_discovery = registry_of(vec![def.clone()])
.with_deferred_tools(Arc::new(vec!["browser_open".into()]))
.project(&def);
- assert!(!without_discovery
- .tools
- .named_tools()
- .contains(&"browser_open".to_string()));
+ assert!(
+ !without_discovery
+ .tools
+ .named_tools()
+ .contains(&"browser_open".to_string())
+ );
}
/// A wildcard scope carrying a denylist must be materialised against the
@@ -438,10 +448,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 ───────────────────────────────────────
@@ -537,11 +549,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/middleware_classified_failure_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs
index f27500397f..fcedec0b77 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs
@@ -344,12 +344,13 @@ async fn a_refused_platform_fetch_still_stops_on_first_failure() {
.await
.unwrap();
assert_eq!(drain_pause_count(&handle), 1);
- assert!(slot
- .lock()
- .unwrap()
- .clone()
- .unwrap()
- .contains("authentication"));
+ assert!(
+ slot.lock()
+ .unwrap()
+ .clone()
+ .unwrap()
+ .contains("authentication")
+ );
}
/// A shell success in between clears the ledger, so a later, unrelated timeout
@@ -643,12 +644,14 @@ async fn nudges_for_other_models_stay_tail_system_messages() {
request.messages.last(),
Some(TaMessage::System(_))
));
- assert!(request
- .messages
- .last()
- .unwrap()
- .text()
- .contains("smaller, bounded"));
+ assert!(
+ request
+ .messages
+ .last()
+ .unwrap()
+ .text()
+ .contains("smaller, bounded")
+ );
}
// ── A public site's HTTP status is not OpenHuman's credential (tinytools#47) ──
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs
index 46a0893e48..01c101e788 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs
@@ -125,8 +125,7 @@ async fn an_identical_failing_command_repeated_unchanged_still_halts() {
assert_eq!(drain_pause_count(&handle), 1);
}
-const MODULE_FAULT: &str =
- "Failed to resolve command runtime: module 'sample-runtime' could not be loaded \
+const MODULE_FAULT: &str = "Failed to resolve command runtime: module 'sample-runtime' could not be loaded \
from the installer bundle: module `linux-x64` refused: module directory is owned by \
another user. This is terminal for the running process; restart the app to try again";
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_failure_effect_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_failure_effect_tests.rs
index b92f5a3bf1..42419c415d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_failure_effect_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_failure_effect_tests.rs
@@ -12,7 +12,7 @@ use super::super::repeated_failure::{failure_scope, recovery_policy};
use super::*;
use crate::agent::tinyagents::middleware::repeated_failure::RepeatedToolFailureMiddleware;
use tinyagents_harness::middleware::{
- call_effect, dispatch_target, CallEffect, ToolEffectFacts, ToolFactsLookup,
+ CallEffect, ToolEffectFacts, ToolFactsLookup, call_effect, dispatch_target,
};
/// The harness's own wording for a tool that outlived its budget
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs
index 4740c2ac6f..244d70be5f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs
@@ -15,11 +15,10 @@ use super::super::repeated_failure::recovery_policy;
use super::*;
use crate::agent::tinyagents::middleware::repeated_failure::RepeatedToolFailureMiddleware;
#[cfg(feature = "modules")]
-use tinyagents_harness::middleware::{call_effect, tool_sets_lookup, CallEffect};
+use tinyagents_harness::middleware::{CallEffect, call_effect, tool_sets_lookup};
/// The shape of a production refusal: the gate's marker, then its reason.
-const SHELL_BLOCK: &str =
- "[policy-blocked] Unbounded system scan of '/' is not allowed; scope the command to the \
+const SHELL_BLOCK: &str = "[policy-blocked] Unbounded system scan of '/' is not allowed; scope the command to the \
project directory or a narrower path.";
const FETCH_BLOCK: &str = "[policy-blocked] Command not allowed by security policy: web_fetch";
const FILE_BLOCK: &str = "[policy-blocked] Security policy: forbidden path /etc/shadow";
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs
index 40efb1b792..8ae421f825 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs
@@ -25,7 +25,8 @@ async fn sampling_tool_output_still_hits_the_byte_budget_backstop() {
let mw = truncation_probe_mw();
let payload = large_sample_response_json(400);
assert!(
- payload.len() > tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes,
+ payload.len()
+ > tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes,
"test payload must exceed the shared byte budget: {} bytes",
payload.len()
);
@@ -235,22 +236,26 @@ fn user_actionable_escalation_detects_missing_connection() {
// A plain environment failure is NOT user-actionable → keep crate summary.
assert!(user_actionable_escalation("read_file", "file not found").is_none());
assert!(user_actionable_escalation("shell", "exit code 1: segfault").is_none());
- assert!(user_actionable_escalation(
- "gmail_send",
- "[composio:error:insufficient_scope] `gmail_send` was rejected because the connected \
+ assert!(
+ user_actionable_escalation(
+ "gmail_send",
+ "[composio:error:insufficient_scope] `gmail_send` was rejected because the connected \
gmail account is missing required permissions (insufficient authentication scopes). \
Reconnect the integration in Connections → gmail and grant the scopes \
requested during OAuth."
- )
- .is_none());
- assert!(user_actionable_escalation(
- "gmail_trigger",
- "[composio:error:trigger_permission] Couldn't enable this trigger: the connected \
+ )
+ .is_none()
+ );
+ assert!(
+ user_actionable_escalation(
+ "gmail_trigger",
+ "[composio:error:trigger_permission] Couldn't enable this trigger: the connected \
gmail account doesn't have permission to manage triggers. Reconnect gmail in \
Connections → gmail and grant the permissions requested during OAuth, \
then try again."
- )
- .is_none());
+ )
+ .is_none()
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_memory_budget_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_memory_budget_tests.rs
index 1b1e622296..862dac8a69 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_memory_budget_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_memory_budget_tests.rs
@@ -5,7 +5,7 @@
use super::*;
use crate::agent::tinyagents::middleware::repeated_failure::RepeatedToolFailureMiddleware;
use crate::memory::test_fixtures::{bind_reference, config_in};
-use crate::memory::tools::{is_budget_refusal, MemoryTool};
+use crate::memory::tools::{MemoryTool, is_budget_refusal};
use tinyagents_harness::ids::CallId;
use tinyagents_harness::middleware::is_repeat_call_exempt;
use tinyagents_harness::tool::ToolExecutionContext;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_stop_cause_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_stop_cause_tests.rs
index 472ec18657..fa2ebe0dfa 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_stop_cause_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_stop_cause_tests.rs
@@ -4,13 +4,13 @@
//! left, the way the session driver does.
use super::*;
-use crate::agent::session_host::stop_summary::{render_stop_summary, StopReasonKind};
+use crate::agent::session_host::stop_summary::{StopReasonKind, render_stop_summary};
use crate::agent::session_host::turn_checkpoint::CheckpointToolResult;
use crate::agent::tinyagents::middleware::repeated_failure::RepeatedToolFailureMiddleware;
use tinyagents_harness::middleware::is_repeat_call_exempt;
use tinyagents_harness::middleware::library::{
- RepeatProgressMiddleware, DEFAULT_CLEARED_PLACEHOLDER, REPEAT_GUARD_BLOCKED,
- REPEAT_GUARD_HALTED, REPEAT_GUARD_METADATA_KEY,
+ DEFAULT_CLEARED_PLACEHOLDER, REPEAT_GUARD_BLOCKED, REPEAT_GUARD_HALTED,
+ REPEAT_GUARD_METADATA_KEY, RepeatProgressMiddleware,
};
use tinyinference_llm::message::{AssistantMessage, ContentBlock};
use tinyinference_llm::model::ModelResponse;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
index 96798290e8..465873d5bf 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
@@ -1,9 +1,8 @@
use super::approval::approval_tool_name;
use super::repeated_failure::{is_body_level_failure, user_actionable_escalation};
use super::tool_output::{
- is_compaction_exempt, is_truncation_exempt, COMPACTION_EXEMPT_TOOLS, SAMPLING_TOOLS,
+ COMPACTION_EXEMPT_TOOLS, SAMPLING_TOOLS, is_compaction_exempt, is_truncation_exempt,
};
-use tinyagents_harness::config::ToolRuntimeConfig;
use crate::agent::tinyagents::middleware::embedder_hooks::EmbedderToolHooksMiddleware;
use crate::agent::tinyagents::middleware::repeated_failure::RepeatedToolFailureMiddleware;
use crate::agent::tinyagents::middleware::tool_outcome_capture::ToolOutcomeCaptureMiddleware;
@@ -11,6 +10,7 @@ use crate::agent::tinyagents::middleware::tool_output::ToolOutputMiddleware;
use serde_json::json;
use std::collections::HashMap;
use std::sync::Arc;
+use tinyagents_harness::config::ToolRuntimeConfig;
use async_trait::async_trait;
@@ -20,9 +20,9 @@ use tinyinference_llm::message::Message as TaMessage;
use tinyinference_llm::tool::ToolCall as TaToolCall;
use tinytools::{ToolPolicy as TaToolPolicy, ToolResult as TaToolResult};
-use tinyagents_harness::middleware::library::DEFAULT_CLEARED_PLACEHOLDER;
use crate::agent::tinyagents::payload_summarizer::DynPayloadSummarizer;
use tinyagents_harness::context::{RunConfig, RunContext};
+use tinyagents_harness::middleware::library::DEFAULT_CLEARED_PLACEHOLDER;
use tinyinference_llm::model::ModelRequest;
use tinyjuice_bus::types::AgentTokenjuiceCompression;
use tinytools::Tool;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_compaction_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_compaction_tests.rs
index bbbec00d3f..932db76851 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_compaction_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_compaction_tests.rs
@@ -118,7 +118,8 @@ async fn tool_output_leaves_an_oversized_propose_workflow_byte_for_byte_intact()
let mw = truncation_probe_mw();
let payload = oversized_workflow_proposal_json(30);
assert!(
- payload.len() > tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes,
+ payload.len()
+ > tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes,
"test payload must exceed the shared byte budget to exercise step 4: {} bytes",
payload.len()
);
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs
index 64cbba56c3..2ea92d0424 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_output_tests.rs
@@ -512,7 +512,10 @@ async fn tool_output_honors_a_tools_own_cap() {
/// moving the ladder into the harness must not change it.
#[test]
fn shared_tool_result_byte_budget_stays_16_kib() {
- assert_eq!(tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes, 16 * 1024);
+ assert_eq!(
+ tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes,
+ 16 * 1024
+ );
}
#[path = "middleware_tool_output_compaction_tests.rs"]
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
index ebcc88633e..6f1bbfb697 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
@@ -148,15 +148,21 @@ fn desktop_approval_bypass_skips_only_require_approval_channel_verdict() {
}
let approval_middleware = middleware(ToolPolicyAction::RequireApproval);
let request = call("desktop_goal", json!({"app":"TextEdit","goal":"type"}));
- assert!(approval_middleware
- .channel_permission_block(&request, false)
- .is_some());
- assert!(approval_middleware
- .channel_permission_block(&request, true)
- .is_none());
- assert!(middleware(ToolPolicyAction::Deny)
- .channel_permission_block(&request, true)
- .is_some());
+ assert!(
+ approval_middleware
+ .channel_permission_block(&request, false)
+ .is_some()
+ );
+ assert!(
+ approval_middleware
+ .channel_permission_block(&request, true)
+ .is_none()
+ );
+ assert!(
+ middleware(ToolPolicyAction::Deny)
+ .channel_permission_block(&request, true)
+ .is_some()
+ );
}
fn call(name: &str, args: serde_json::Value) -> TaToolCall {
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
index d5130f9b02..3e3dbd7a99 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
@@ -11,8 +11,8 @@ use std::collections::{BTreeSet, HashSet};
use std::sync::{Arc, LazyLock};
use anyhow::Result;
-use tinyagents_harness::runtime::{AgentInvocation, AgentTurnRequest, InvocationRuntime};
use tinyagents_harness::runtime::AgentHarness;
+use tinyagents_harness::runtime::{AgentInvocation, AgentTurnRequest, InvocationRuntime};
use tinyagents_harness::store::{InMemoryStore as ToolResultArtifactIndexStore, StoreRegistry};
use tinyagents_harness::turn_policy::effective_max_iterations;
use tinyagents_runtime::turn_driver::{
@@ -26,12 +26,12 @@ use crate::agent::tinyagents::middleware::turn_context::TurnContextMiddleware;
use crate::agent::tinyagents::observability::{OpenhumanEventBridge, SubagentScope};
use crate::agent::tinyagents::tool_registration::capability_diagnostics;
use crate::agent::tinyagents::turn_middleware::{
- install_turn_middleware, TurnMiddlewareInputs, TurnWiring,
+ TurnMiddlewareInputs, TurnWiring, install_turn_middleware,
};
use crate::agent::tinyagents::turn_models::TurnModels;
use crate::agent::tinyagents::turn_outcome::TinyagentsTurnOutcome;
use crate::agent::tinyagents::turn_plan::{
- enforce_registry_diagnostics, turn_models_for_plan, turn_run_policy, OpenHumanTurnPlanner,
+ OpenHumanTurnPlanner, enforce_registry_diagnostics, turn_models_for_plan, turn_run_policy,
};
use crate::agent::tinyagents::turn_run_error::map_turn_run_error;
use crate::agent::tinyagents::turn_run_finalize::finalize_turn_outcome;
diff --git a/crates/openhuman-core/src/agent/tools/todo_tests.rs b/crates/openhuman-core/src/agent/tools/todo_tests.rs
index 1aac2494a8..01c27db402 100644
--- a/crates/openhuman-core/src/agent/tools/todo_tests.rs
+++ b/crates/openhuman-core/src/agent/tools/todo_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_graph::todos::{TodoItem, TodoStatus};
/// Serialize tests that share the process-global scratch store. Same lock
@@ -14,7 +14,9 @@ async fn scratch_lock_async() -> tokio::sync::MutexGuard<'static, ()> {
SCRATCH_TEST_LOCK.lock().await
}
-fn todo_store(workspace_dir: &std::path::Path) -> std::sync::Arc<dyn tinyagents_harness::store::Store> {
+fn todo_store(
+ workspace_dir: &std::path::Path,
+) -> std::sync::Arc<dyn tinyagents_harness::store::Store> {
crate::agent::session_store::stores_or_ephemeral(workspace_dir).kv
}
@@ -226,9 +228,13 @@ async fn a_legacy_session_keyed_list_is_migrated_forward_once() {
id: parent.session_id.clone(),
};
let item = TodoItem::with_status("carried over", TodoStatus::InProgress);
- tinyagents_graph::todos::store::replace(&todo_store(&workspace_dir), legacy_scope.key(), vec![item])
- .await
- .unwrap();
+ tinyagents_graph::todos::store::replace(
+ &todo_store(&workspace_dir),
+ legacy_scope.key(),
+ vec![item],
+ )
+ .await
+ .unwrap();
let tool = TodoTool::new(workspace_dir.clone());
let read = tool
@@ -248,9 +254,10 @@ async fn a_legacy_session_keyed_list_is_migrated_forward_once() {
let thread_scope = TodoScope::Session {
id: "thread-legacy".into(),
};
- let migrated = tinyagents_graph::todos::store::list(&todo_store(&workspace_dir), thread_scope.key())
- .await
- .unwrap();
+ let migrated =
+ tinyagents_graph::todos::store::list(&todo_store(&workspace_dir), thread_scope.key())
+ .await
+ .unwrap();
assert_eq!(migrated.items.len(), 1);
}
@@ -284,9 +291,11 @@ async fn sessions_do_not_see_each_other_and_a_list_survives_across_turns() {
"a later turn of the same session reads it back"
);
assert_eq!(a_again.thread_id, "sess-a");
- assert!(tinyagents_graph::todos::store::list(&todo_store(&workspace_dir), b.key())
- .await
- .unwrap()
- .items
- .is_empty());
+ assert!(
+ tinyagents_graph::todos::store::list(&todo_store(&workspace_dir), b.key())
+ .await
+ .unwrap()
+ .items
+ .is_empty()
+ );
}
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs
index 89365fc10b..0378af5759 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs
@@ -1,7 +1,7 @@
//! Env overrides for dictation and the context-management budget.
-use crate::config::schema::load::env::EnvLookup;
use crate::config::schema::Config;
+use crate::config::schema::load::env::EnvLookup;
impl Config {
pub(super) fn apply_dictation_env<E: EnvLookup + ?Sized>(&mut self, env: &E) {
@@ -132,7 +132,8 @@ impl Config {
self.context.summarizer_model = Some(model.to_string());
}
}
- let context_default = tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes;
+ let context_default =
+ tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes;
let context_env_set = env.contains("OPENHUMAN_CONTEXT_TOOL_RESULT_BUDGET_BYTES");
if !context_env_set
&& self.context.tool_result_budget_bytes == context_default
diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs
index 8f5a16d2e9..826c447651 100644
--- a/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs
@@ -6,7 +6,8 @@ fn env_overlay_context_tool_result_budget_env_suppresses_legacy_migration() {
// migration must NOT run — even when the explicit env value equals
// the default. This protects users who explicitly set the env to
// the default.
- let default_budget = tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes;
+ let default_budget =
+ tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes;
let mut cfg = Config::default();
cfg.context.tool_result_budget_bytes = default_budget;
cfg.agent.tool_result_budget_bytes = 999_999;
@@ -56,7 +57,8 @@ fn env_overlay_compaction_default_on_and_switch() {
#[test]
fn env_overlay_context_tool_result_budget_legacy_migration_when_env_absent() {
// Env absent, context at default, agent customised → agent value copies forward.
- let default_budget = tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes;
+ let default_budget =
+ tinyagents_harness::config::ToolRuntimeConfig::default().tool_result_budget_bytes;
let mut cfg = Config::default();
cfg.context.tool_result_budget_bytes = default_budget;
cfg.agent.tool_result_budget_bytes = 777_777;
diff --git a/crates/openhuman-core/src/threads/ops/live_state_tests.rs b/crates/openhuman-core/src/threads/ops/live_state_tests.rs
index 37b45168a6..8cd3077579 100644
--- a/crates/openhuman-core/src/threads/ops/live_state_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/live_state_tests.rs
@@ -63,9 +63,14 @@ async fn goal_get_reads_back_a_stored_goal() {
.await
.unwrap()
.workspace_dir;
- tinyagents_graph::goals::store::set(&crate::agent::session_store::stores_or_ephemeral(&dir).kv, "thread-goal-live", "ship it", Some(1000))
- .await
- .unwrap();
+ tinyagents_graph::goals::store::set(
+ &crate::agent::session_store::stores_or_ephemeral(&dir).kv,
+ "thread-goal-live",
+ "ship it",
+ Some(1000),
+ )
+ .await
+ .unwrap();
let filled = goal_get(ThreadLiveStateRequest {
thread_id: "thread-goal-live".to_string(),
diff --git a/crates/openhuman-core/src/tools/rules/ops_tests.rs b/crates/openhuman-core/src/tools/rules/ops_tests.rs
index 6fcc2c7666..49b398c2f5 100644
--- a/crates/openhuman-core/src/tools/rules/ops_tests.rs
+++ b/crates/openhuman-core/src/tools/rules/ops_tests.rs
@@ -9,7 +9,8 @@ use tinytools::ToolRuleSet;
use tinytools::{Surface, ToolSubject};
fn definition(id: &str) -> AgentDefinition {
- crate::agent::registry::agents::load_builtins().expect("built-ins load")
+ crate::agent::registry::agents::load_builtins()
+ .expect("built-ins load")
.into_iter()
.next()
.map(|mut def| {