Skip to content

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

chore(agent): reorder imports and reformat assertions

Steven Enamakel8b118c5863df
diff --git a/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs b/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
index ed89ebffd2..0a6436c733 100644
--- a/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
+++ b/crates/openhuman-core/src/agent/agent_turn_loop_nudge_tests.rs
@@ -7,8 +7,7 @@ use tinyinference_llm::message::Message;
const NUDGE: &str =
"The last call failed validation. Correct its schema or arguments once before trying again.";
-const FAILED_TOOL_RESULT_WITH_NUDGE: &str =
- "{\"status_code\": 422}\n\n[harness note]\nThe last call failed validation. Correct its schema or arguments once before trying again.";
+const FAILED_TOOL_RESULT_WITH_NUDGE: &str = "{\"status_code\": 422}\n\n[harness note]\nThe last call failed validation. Correct its schema or arguments once before trying again.";
/// A native-tool-calling model that replays scripted responses and records the
/// messages of every request it receives.
diff --git a/crates/openhuman-core/src/agent/attachments/host.rs b/crates/openhuman-core/src/agent/attachments/host.rs
index a6e00d1859..2d90e79c59 100644
--- a/crates/openhuman-core/src/agent/attachments/host.rs
+++ b/crates/openhuman-core/src/agent/attachments/host.rs
@@ -14,7 +14,7 @@ use std::path::Path;
use tinyagents_harness::multimodal::mime::detect_file_mime;
-use super::{save, AttachmentAccessScope};
+use super::{AttachmentAccessScope, save};
use crate::config::Config;
/// One file a host attaches to a turn.
diff --git a/crates/openhuman-core/src/agent/attachments/host_tests.rs b/crates/openhuman-core/src/agent/attachments/host_tests.rs
index c34232ca8d..d90991643c 100644
--- a/crates/openhuman-core/src/agent/attachments/host_tests.rs
+++ b/crates/openhuman-core/src/agent/attachments/host_tests.rs
@@ -75,18 +75,21 @@ async fn references_convert_to_image_and_document_blocks() {
let Message::User(user) = message else {
panic!("not a user message");
};
- assert!(user
- .content
- .iter()
- .any(|block| matches!(block, ContentBlock::Image(_))));
- assert!(user
- .content
- .iter()
- .any(|block| matches!(block, ContentBlock::Document(_))));
- assert!(user
- .content
- .iter()
- .any(|block| matches!(block, ContentBlock::Text(text) if text.contains("what is this?"))));
+ assert!(
+ user.content
+ .iter()
+ .any(|block| matches!(block, ContentBlock::Image(_)))
+ );
+ assert!(
+ user.content
+ .iter()
+ .any(|block| matches!(block, ContentBlock::Document(_)))
+ );
+ assert!(
+ user.content.iter().any(
+ |block| matches!(block, ContentBlock::Text(text) if text.contains("what is this?"))
+ )
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/attachments/mod.rs b/crates/openhuman-core/src/agent/attachments/mod.rs
index 1d086d1564..e5a97588a9 100644
--- a/crates/openhuman-core/src/agent/attachments/mod.rs
+++ b/crates/openhuman-core/src/agent/attachments/mod.rs
@@ -6,7 +6,7 @@ use std::path::{Component, Path, PathBuf};
use serde::{Deserialize, Serialize};
use tinyagents_harness::multimodal::{
- config::FileLimits, markers, resolve::resolve_attachment, UnknownMimePolicy,
+ UnknownMimePolicy, config::FileLimits, markers, resolve::resolve_attachment,
};
use crate::config::Config;
diff --git a/crates/openhuman-core/src/agent/attachments/mod_access_tests.rs b/crates/openhuman-core/src/agent/attachments/mod_access_tests.rs
index 6a775b7fe5..e2c1592300 100644
--- a/crates/openhuman-core/src/agent/attachments/mod_access_tests.rs
+++ b/crates/openhuman-core/src/agent/attachments/mod_access_tests.rs
@@ -54,15 +54,17 @@ async fn direct_upload_requires_runtime_authority_and_external_input_cannot_crea
..Config::default()
};
let workspace = tinytools::WorkspaceDescriptor::new(temp.path().join("agent-acting"));
- assert!(stage_turn(
- UPLOAD,
- Some(&config),
- Some(&workspace),
- Some("thread"),
- Some(&external_origin())
- )
- .await
- .is_err());
+ assert!(
+ stage_turn(
+ UPLOAD,
+ Some(&config),
+ Some(&workspace),
+ Some("thread"),
+ Some(&external_origin())
+ )
+ .await
+ .is_err()
+ );
assert!(!workspace.root.exists());
assert!(!config.action_dir.exists());
assert_eq!(
@@ -94,15 +96,17 @@ async fn delegation_rejects_malformed_explicit_paths_and_external_reads_before_c
serde_json::json!(["picture.png] injected"]),
serde_json::json!(["picture\u{0}.png"]),
] {
- assert!(delegation_prompt(
- &crate::core::runtime::DispatchCtx::ambient(),
- "task",
- &serde_json::json!({"image_paths": image_paths}),
- None,
- None
- )
- .await
- .is_err());
+ assert!(
+ delegation_prompt(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ "task",
+ &serde_json::json!({"image_paths": image_paths}),
+ None,
+ None
+ )
+ .await
+ .is_err()
+ );
}
let error = delegation_prompt(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -179,14 +183,16 @@ async fn thread_folder_upload_is_staged_where_the_turn_reads_it() {
}
// A folder that disappeared is an error, as in `run_task`, not a silent
// fallback to the global dir.
- assert!(thread_action_dir(
- &crate::core::runtime::DispatchCtx::ambient(),
- &config,
- &config.workspace_dir,
- Some("gone")
- )
- .await
- .is_err());
+ assert!(
+ thread_action_dir(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &config.workspace_dir,
+ Some("gone")
+ )
+ .await
+ .is_err()
+ );
// Stage the way `start_chat` does, then read the way the turn does: its
// request scope comes from a run context carrying the thread folder as its
diff --git a/crates/openhuman-core/src/agent/attachments/mod_tests.rs b/crates/openhuman-core/src/agent/attachments/mod_tests.rs
index b14493988b..b76916ba29 100644
--- a/crates/openhuman-core/src/agent/attachments/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/attachments/mod_tests.rs
@@ -14,9 +14,11 @@ async fn legacy_sidecar_rehydrates_into_an_authorized_acting_original() {
let bytes = b"\x89PNG\r\n\x1a\noriginal";
tokio::fs::write(&source, bytes).await.unwrap();
let scope = AttachmentAccessScope::default();
- assert!(resolve_path(&cfg, source.to_str().unwrap(), &scope)
- .await
- .is_err());
+ assert!(
+ resolve_path(&cfg, source.to_str().unwrap(), &scope)
+ .await
+ .is_err()
+ );
let index = std::collections::HashMap::from([("legacy".into(), source.clone())]);
let prompt = markers::rehydrate_placeholders_in_text("[Image: old #att:legacy]", &index);
let paths = markers::parse_image_markers(&prompt).1;
@@ -168,16 +170,18 @@ async fn forbidden_acting_root_is_rejected_before_directory_creation() {
let temp = tempfile::tempdir().unwrap();
let mut config = config(temp.path());
config.action_dir = temp.path().join(".ssh").join("new-workspace");
- assert!(save(
- &config,
- "thread",
- "file",
- "text/plain",
- b"data",
- &AttachmentAccessScope::default()
- )
- .await
- .is_err());
+ assert!(
+ save(
+ &config,
+ "thread",
+ "file",
+ "text/plain",
+ b"data",
+ &AttachmentAccessScope::default()
+ )
+ .await
+ .is_err()
+ );
assert!(!temp.path().join(".ssh").exists());
}
@@ -226,13 +230,15 @@ async fn ready_media_artifact_in_files_folder_can_be_attached() {
tokio::fs::write(&unrelated, b"not a filed media artifact")
.await
.unwrap();
- assert!(resolve_path(
- &config,
- &unrelated.to_string_lossy(),
- &AttachmentAccessScope::default(),
- )
- .await
- .is_err());
+ assert!(
+ resolve_path(
+ &config,
+ &unrelated.to_string_lossy(),
+ &AttachmentAccessScope::default(),
+ )
+ .await
+ .is_err()
+ );
}
#[tokio::test]
@@ -339,22 +345,26 @@ async fn hard_zero_and_count_gate_precede_reads() {
let temp = tempfile::tempdir().unwrap();
let mut config = config(temp.path());
config.multimodal_files.max_files = 0;
- assert!(stage(
- "[FILE:/missing]",
- "thread",
- &config,
- &AttachmentAccessScope::default()
- )
- .await
- .is_err());
- assert!(stage(
- "[IMAGE:/missing]",
- "thread",
- &config,
- &AttachmentAccessScope::default()
- )
- .await
- .is_err());
+ assert!(
+ stage(
+ "[FILE:/missing]",
+ "thread",
+ &config,
+ &AttachmentAccessScope::default()
+ )
+ .await
+ .is_err()
+ );
+ assert!(
+ stage(
+ "[IMAGE:/missing]",
+ "thread",
+ &config,
+ &AttachmentAccessScope::default()
+ )
+ .await
+ .is_err()
+ );
assert!(!config.action_dir.exists());
assert!(!safe_relative_path("../escape"));
assert!(!safe_relative_path("/absolute"));
@@ -363,23 +373,27 @@ async fn hard_zero_and_count_gate_precede_reads() {
#[tokio::test]
async fn vision_without_explicit_references_fails_before_configuration_or_inference() {
- assert!(!has_resolvable_image(
- &crate::core::runtime::DispatchCtx::ambient(),
- "Describe a filename mentioned only in prose: picture.png",
- None,
- None
- )
- .await
- .unwrap());
- assert!(delegation_prompt(
- &crate::core::runtime::DispatchCtx::ambient(),
- "task",
- &serde_json::json!({ "image_paths": [42] }),
- None,
- None
- )
- .await
- .is_err());
+ assert!(
+ !has_resolvable_image(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ "Describe a filename mentioned only in prose: picture.png",
+ None,
+ None
+ )
+ .await
+ .unwrap()
+ );
+ assert!(
+ delegation_prompt(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ "task",
+ &serde_json::json!({ "image_paths": [42] }),
+ None,
+ None
+ )
+ .await
+ .is_err()
+ );
}
#[cfg(unix)]
@@ -391,16 +405,18 @@ async fn upload_symlink_is_rejected_without_writing_outside() {
let outside = temp.path().join("outside");
tokio::fs::create_dir(&outside).await.unwrap();
std::os::unix::fs::symlink(&outside, config.action_dir.join("uploads")).unwrap();
- assert!(save(
- &config,
- "thread",
- "file",
- "application/octet-stream",
- b"original",
- &AttachmentAccessScope::default()
- )
- .await
- .is_err());
+ assert!(
+ save(
+ &config,
+ "thread",
+ "file",
+ "application/octet-stream",
+ b"original",
+ &AttachmentAccessScope::default()
+ )
+ .await
+ .is_err()
+ );
assert_eq!(std::fs::read_dir(outside).unwrap().count(), 0);
}
diff --git a/crates/openhuman-core/src/agent/attachments/provider.rs b/crates/openhuman-core/src/agent/attachments/provider.rs
index 5d6ac8900a..ad271ef555 100644
--- a/crates/openhuman-core/src/agent/attachments/provider.rs
+++ b/crates/openhuman-core/src/agent/attachments/provider.rs
@@ -2,7 +2,7 @@
use super::AttachmentAccessScope;
use crate::config::Config;
use async_trait::async_trait;
-use base64::{engine::general_purpose::STANDARD, Engine};
+use base64::{Engine, engine::general_purpose::STANDARD};
use std::sync::Arc;
use tinyinference_llm::{
message::{ContentBlock, ImageRef, MediaRef, Message},
diff --git a/crates/openhuman-core/src/agent/attachments/provider_history_tests.rs b/crates/openhuman-core/src/agent/attachments/provider_history_tests.rs
index 90b38cc22c..43ae285aea 100644
--- a/crates/openhuman-core/src/agent/attachments/provider_history_tests.rs
+++ b/crates/openhuman-core/src/agent/attachments/provider_history_tests.rs
@@ -57,23 +57,31 @@ async fn missing_historical_media_does_not_block_latest_valid_media() {
let captured = probe.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
let history = &captured[0].messages[0];
- assert!(history
- .text()
- .contains("Earlier attachment omitted by history budget"));
+ assert!(
+ history
+ .text()
+ .contains("Earlier attachment omitted by history budget")
+ );
assert!(history.text().contains("Earlier attachment unavailable"));
assert!(history.text().contains("deleted-prior-upload-0.png"));
assert!(!serde_json::to_string(history).unwrap().contains("base64"));
- assert!(!serde_json::to_string(history)
- .unwrap()
- .contains("private-value"));
- assert!(!serde_json::to_string(history)
- .unwrap()
- .contains("also-private"));
+ assert!(
+ !serde_json::to_string(history)
+ .unwrap()
+ .contains("private-value")
+ );
+ assert!(
+ !serde_json::to_string(history)
+ .unwrap()
+ .contains("also-private")
+ );
let durable_text = serde_json::to_string(&durable).unwrap();
assert!(signed_urls.iter().all(|url| durable_text.contains(url)));
- assert!(serde_json::to_string(&captured[0].messages[1])
- .unwrap()
- .contains("data:image/png;base64,"));
+ assert!(
+ serde_json::to_string(&captured[0].messages[1])
+ .unwrap()
+ .contains("data:image/png;base64,")
+ );
}
#[cfg(unix)]
diff --git a/crates/openhuman-core/src/agent/attachments/provider_open.rs b/crates/openhuman-core/src/agent/attachments/provider_open.rs
index e40654dd1b..bf8a982dae 100644
--- a/crates/openhuman-core/src/agent/attachments/provider_open.rs
+++ b/crates/openhuman-core/src/agent/attachments/provider_open.rs
@@ -100,7 +100,7 @@ pub(crate) fn secure_open(
) -> std::io::Result<std::fs::File> {
use std::os::windows::io::AsRawHandle;
use windows_sys::Win32::Storage::FileSystem::{
- GetFinalPathNameByHandleW, FILE_NAME_NORMALIZED, VOLUME_NAME_DOS,
+ FILE_NAME_NORMALIZED, GetFinalPathNameByHandleW, VOLUME_NAME_DOS,
};
use std::os::windows::ffi::OsStringExt;
diff --git a/crates/openhuman-core/src/agent/attachments/provider_routing_tests.rs b/crates/openhuman-core/src/agent/attachments/provider_routing_tests.rs
index 3cbc38d4fa..d9cbf53330 100644
--- a/crates/openhuman-core/src/agent/attachments/provider_routing_tests.rs
+++ b/crates/openhuman-core/src/agent/attachments/provider_routing_tests.rs
@@ -285,16 +285,19 @@ async fn paid_vision_readout_is_reused_across_recreated_wrappers_and_invalidated
let calls = main.requests.lock().unwrap().clone();
assert_eq!(calls.len(), 3);
for (_, call) in &calls {
- assert!(call.messages[0]
- .text()
- .contains("Image readout:\nmock vision readout"));
+ assert!(
+ call.messages[0]
+ .text()
+ .contains("Image readout:\nmock vision readout")
+ );
let Message::User(user) = &call.messages[0] else {
panic!("expected main user message")
};
- assert!(user
- .content
- .iter()
- .all(|block| matches!(block, ContentBlock::Text(_))));
+ assert!(
+ user.content
+ .iter()
+ .all(|block| matches!(block, ContentBlock::Text(_)))
+ );
}
assert!(
matches!(&request.messages[0], Message::User(user) if matches!(&user.content[0], ContentBlock::Image(image) if image.url == "uploads/thread/image/original.jpg"))
@@ -336,13 +339,15 @@ async fn streaming_prepares_only_the_ephemeral_request_and_preserves_order_and_o
request.temperature = Some(0.37);
request.max_tokens = Some(128);
let durable = serde_json::to_value(&request).unwrap();
- assert!(model
- .stream(&(), request.clone())
- .await
- .unwrap()
- .collect::<Vec<_>>()
- .await
- .is_empty());
+ assert!(
+ model
+ .stream(&(), request.clone())
+ .await
+ .unwrap()
+ .collect::<Vec<_>>()
+ .await
+ .is_empty()
+ );
assert_eq!(serde_json::to_value(&request).unwrap(), durable);
let captured = transport.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
@@ -474,8 +479,10 @@ async fn unsupported_media_urls_and_oversized_inline_sources_fail_before_inferen
media_type: "application/octet-stream".into(),
})]);
let error = model.prepare(oversized).await.unwrap_err();
- assert!(error
- .to_string()
- .contains("inline media exceeds size limit"));
+ assert!(
+ error
+ .to_string()
+ .contains("inline media exceeds size limit")
+ );
assert!(transport.requests.lock().unwrap().is_empty());
}
diff --git a/crates/openhuman-core/src/agent/attachments/provider_source.rs b/crates/openhuman-core/src/agent/attachments/provider_source.rs
index 8445ba7508..588a4209ef 100644
--- a/crates/openhuman-core/src/agent/attachments/provider_source.rs
+++ b/crates/openhuman-core/src/agent/attachments/provider_source.rs
@@ -1,10 +1,10 @@
//! Resolve every admitted media source on a disposable provider request.
-use super::super::{is_missing_local_reference, SOURCE_MISSING_MARKER};
+use super::super::{SOURCE_MISSING_MARKER, is_missing_local_reference};
use super::AttachmentAccessScope;
use super::*;
use sha2::{Digest, Sha256};
use tinyagents_harness::multimodal::{
- config::FileLimits, resolve::resolve_attachment, UnknownMimePolicy,
+ UnknownMimePolicy, config::FileLimits, resolve::resolve_attachment,
};
impl AttachmentModel {
diff --git a/crates/openhuman-core/src/agent/attachments/provider_tests.rs b/crates/openhuman-core/src/agent/attachments/provider_tests.rs
index 52006c9024..4bba2a563a 100644
--- a/crates/openhuman-core/src/agent/attachments/provider_tests.rs
+++ b/crates/openhuman-core/src/agent/attachments/provider_tests.rs
@@ -51,14 +51,18 @@ async fn local_native_resolution_changes_only_ephemeral_request() {
)]);
let durable = request.clone();
assert!(wrapper.invoke(&(), request).await.is_err());
- assert!(serde_json::to_string(&durable)
- .unwrap()
- .contains("sample.png"));
+ assert!(
+ serde_json::to_string(&durable)
+ .unwrap()
+ .contains("sample.png")
+ );
let captured = probe.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
- assert!(serde_json::to_string(&captured[0])
- .unwrap()
- .contains("data:image/png;base64,"));
+ assert!(
+ serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("data:image/png;base64,")
+ );
assert_eq!(
tokio::fs::read(temp.path().join("sample.png"))
.await
@@ -130,9 +134,11 @@ async fn persisted_image_without_mime_uses_magic_over_extension() {
assert!(wrapper.invoke(&(), request).await.is_err());
let captured = probe.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
- assert!(serde_json::to_string(&captured[0])
- .unwrap()
- .contains("data:image/jpeg;base64,"));
+ assert!(
+ serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("data:image/jpeg;base64,")
+ );
}
#[tokio::test]
@@ -226,9 +232,11 @@ async fn unknown_video_retains_path_as_metadata_without_specialist() {
let text = captured[0].messages[0].text();
assert!(text.contains("clip.mp4"));
assert!(text.contains("14 bytes"));
- assert!(!serde_json::to_string(&captured[0])
- .unwrap()
- .contains("base64"));
+ assert!(
+ !serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("base64")
+ );
}
#[tokio::test]
@@ -269,18 +277,22 @@ async fn derivative_cache_survives_model_recreation_and_invalidates_changed_cont
Some("derived readout")
);
let changed = first.fallback_key("uploads/thread/id/original.txt", "text/plain", b"modified");
- assert!(resumed
- .cached_fallback("uploads/thread/id/original.txt", &changed, &scope)
- .await
- .is_none());
+ assert!(
+ resumed
+ .cached_fallback("uploads/thread/id/original.txt", &changed, &scope)
+ .await
+ .is_none()
+ );
assert_eq!(tokio::fs::read(original).await.unwrap(), b"original");
- assert!(tokio::fs::read_dir(temp.path().join("uploads/thread/id"))
- .await
- .unwrap()
- .next_entry()
- .await
- .unwrap()
- .is_some());
+ assert!(
+ tokio::fs::read_dir(temp.path().join("uploads/thread/id"))
+ .await
+ .unwrap()
+ .next_entry()
+ .await
+ .unwrap()
+ .is_some()
+ );
}
#[tokio::test]
@@ -312,7 +324,7 @@ async fn cache_is_not_written_beside_unmanaged_local_files() {
#[test]
fn endpoint_discovery_denial_overrides_offline_vision_facts() {
use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
- use tinyinference_llm::model::discover::{model_limits_cache, LimitSource, ModelLimits};
+ use tinyinference_llm::model::discover::{LimitSource, ModelLimits, model_limits_cache};
let temp = tempfile::tempdir().unwrap();
let mut config = Config::default();
config.config_path = temp.path().join("config.toml");
@@ -408,9 +420,11 @@ async fn disabled_remote_replay_is_rejected_before_inference() {
},
)]);
let error = wrapper.invoke(&(), request).await.unwrap_err();
- assert!(error
- .to_string()
- .contains("remote attachment fetch is disabled"));
+ assert!(
+ error
+ .to_string()
+ .contains("remote attachment fetch is disabled")
+ );
}
assert!(probe.requests.lock().unwrap().is_empty());
}
@@ -563,12 +577,16 @@ async fn unknown_model_legacy_inline_replay_uses_specialist_once_across_model_re
assert!(wrapper.invoke(&(), request.clone()).await.is_err());
let captured = main.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
- assert!(captured[0].messages[0]
- .text()
- .contains("specialist image readout"));
- assert!(!serde_json::to_string(&captured[0])
- .unwrap()
- .contains("base64"));
+ assert!(
+ captured[0].messages[0]
+ .text()
+ .contains("specialist image readout")
+ );
+ assert!(
+ !serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("base64")
+ );
}
assert_eq!(
specialist.calls.load(std::sync::atomic::Ordering::SeqCst),
@@ -603,9 +621,11 @@ async fn legacy_audio_base64_unsupported_transport_becomes_workspace_reference()
let text = captured[0].messages[0].text();
assert!(text.contains("audio/wav"));
assert!(text.contains("workspace path: uploads/legacy-media/"));
- assert!(!serde_json::to_string(&captured[0])
- .unwrap()
- .contains("base64"));
+ assert!(
+ !serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("base64")
+ );
}
#[tokio::test]
@@ -639,9 +659,11 @@ async fn injected_turn_source_uses_bound_workspace_and_explicit_model_facts() {
assert!(models.primary.invoke(&(), request).await.is_err());
let captured = probe.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
- assert!(serde_json::to_string(&captured[0])
- .unwrap()
- .contains("data:image/png;base64,"));
+ assert!(
+ serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("data:image/png;base64,")
+ );
}
#[tokio::test]
@@ -700,9 +722,11 @@ async fn configured_injected_builder_stages_and_resolves_in_explicit_acting_work
assert!(models.primary.invoke(&(), request).await.is_err());
let captured = probe.requests.lock().unwrap().clone();
assert_eq!(captured.len(), 1);
- assert!(serde_json::to_string(&captured[0])
- .unwrap()
- .contains("data:image/png;base64,"));
+ assert!(
+ serde_json::to_string(&captured[0])
+ .unwrap()
+ .contains("data:image/png;base64,")
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/bus.rs b/crates/openhuman-core/src/agent/bus.rs
index 2af6756156..0b68a00957 100644
--- a/crates/openhuman-core/src/agent/bus.rs
+++ b/crates/openhuman-core/src/agent/bus.rs
@@ -25,7 +25,7 @@ use crate::agent::turn_origin::{self, AgentTurnOrigin};
use crate::config::MultimodalConfig;
use crate::core::bus::BUS;
use crate::security::prompt_injection::{
- enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,
+ PromptEnforcementAction, PromptEnforcementContext, enforce_prompt_input,
};
use tinyagents_session::transcript::TranscriptMessage;
use tinytools::Tool;
diff --git a/crates/openhuman-core/src/agent/context/channels_prompt_tests.rs b/crates/openhuman-core/src/agent/context/channels_prompt_tests.rs
index b637d394ab..f263e5b15f 100644
--- a/crates/openhuman-core/src/agent/context/channels_prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/context/channels_prompt_tests.rs
@@ -103,14 +103,16 @@ fn build_system_prompt_uses_workspace_skill_location_fallback() {
);
assert!(prompt.contains("<name>research-helper</name>"));
- assert!(prompt.contains(
- &tmp.path()
- .join("skills")
- .join("research-helper")
- .join("SKILL.md")
- .display()
- .to_string()
- ));
+ assert!(
+ prompt.contains(
+ &tmp.path()
+ .join("skills")
+ .join("research-helper")
+ .join("SKILL.md")
+ .display()
+ .to_string()
+ )
+ );
assert!(prompt.contains("running as a Telegram bot"));
}
diff --git a/crates/openhuman-core/src/agent/debug/mod.rs b/crates/openhuman-core/src/agent/debug/mod.rs
index 2124a800ee..766809fa14 100644
--- a/crates/openhuman-core/src/agent/debug/mod.rs
+++ b/crates/openhuman-core/src/agent/debug/mod.rs
@@ -14,16 +14,16 @@
use std::path::PathBuf;
-use anyhow::{anyhow, Context, Result};
+use anyhow::{Context, Result, anyhow};
pub mod dump_writer;
pub mod prompt_size;
pub mod wire;
-pub use dump_writer::{write_prompt_dumps, DumpWriteSummary};
+pub use dump_writer::{DumpWriteSummary, write_prompt_dumps};
pub use wire::render as render_wire_dump;
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::session_host::OpenHumanSessionHost;
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::config::Config;
use tinytools::ToolCategory;
diff --git a/crates/openhuman-core/src/agent/debug/prompt_size.rs b/crates/openhuman-core/src/agent/debug/prompt_size.rs
index 7637257f37..833db0d5a2 100644
--- a/crates/openhuman-core/src/agent/debug/prompt_size.rs
+++ b/crates/openhuman-core/src/agent/debug/prompt_size.rs
@@ -30,7 +30,7 @@
use anyhow::Result;
-use super::{dump_agent_prompt, DumpPromptOptions, DumpedPrompt};
+use super::{DumpPromptOptions, DumpedPrompt, dump_agent_prompt};
/// Rough bytes-per-token for English prose and JSON on a BPE tokenizer.
///
diff --git a/crates/openhuman-core/src/agent/goals/runtime_tests.rs b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
index 0e47fe9390..dc8929e5f9 100644
--- a/crates/openhuman-core/src/agent/goals/runtime_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/runtime_tests.rs
@@ -132,13 +132,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;
diff --git a/crates/openhuman-core/src/agent/host_agents.rs b/crates/openhuman-core/src/agent/host_agents.rs
index a8bc2ab2f7..fa41286525 100644
--- a/crates/openhuman-core/src/agent/host_agents.rs
+++ b/crates/openhuman-core/src/agent/host_agents.rs
@@ -30,8 +30,8 @@
use crate::core::runtime::DispatchCtx;
use std::sync::{Arc, LazyLock, PoisonError, RwLock};
-use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent::{HostTools, OpenHumanSessionHost};
+use crate::agent_registry::host_definition::AgentDefinition;
use crate::config::Config;
use crate::core::runtime::CoreContext;
diff --git a/crates/openhuman-core/src/agent/host_runtime_tests.rs b/crates/openhuman-core/src/agent/host_runtime_tests.rs
index 9044e4231a..836e842307 100644
--- a/crates/openhuman-core/src/agent/host_runtime_tests.rs
+++ b/crates/openhuman-core/src/agent/host_runtime_tests.rs
@@ -105,12 +105,16 @@ fn create_runtime_supports_native_and_docker_and_rejects_unknown() {
/// adapter, which hands it to TinyBox on the native shell request.
#[test]
fn hide_window_reaches_the_native_runtime_only() {
- assert!(create_runtime(&RuntimeConfig::default(), true)
- .unwrap()
- .hide_window());
- assert!(!create_runtime(&RuntimeConfig::default(), false)
- .unwrap()
- .hide_window());
+ assert!(
+ create_runtime(&RuntimeConfig::default(), true)
+ .unwrap()
+ .hide_window()
+ );
+ assert!(
+ !create_runtime(&RuntimeConfig::default(), false)
+ .unwrap()
+ .hide_window()
+ );
assert!(NativeRuntime::with_hide_window(true).hide_window());
assert!(!NativeRuntime::new().hide_window());
let docker = create_runtime(
diff --git a/crates/openhuman-core/src/agent/message_convert.rs b/crates/openhuman-core/src/agent/message_convert.rs
index b58174eb1b..c502bf4e28 100644
--- a/crates/openhuman-core/src/agent/message_convert.rs
+++ b/crates/openhuman-core/src/agent/message_convert.rs
@@ -26,8 +26,8 @@ use crate::inference::provider::ChatResponse;
use tinyagents_runtime::transcript::reasoning_from_content;
#[cfg(test)]
use tinyagents_runtime::transcript::{
- message_to_display_transcript as message_to_chat_message,
- message_to_native_transcript as message_to_native_chat_message, REASONING_EXT_KEY,
+ REASONING_EXT_KEY, message_to_display_transcript as message_to_chat_message,
+ message_to_native_transcript as message_to_native_chat_message,
};
use tinyagents_session::transcript::TranscriptMessage;
diff --git a/crates/openhuman-core/src/agent/message_convert_tests.rs b/crates/openhuman-core/src/agent/message_convert_tests.rs
index 9d6acf4d5f..3b65b50c94 100644
--- a/crates/openhuman-core/src/agent/message_convert_tests.rs
+++ b/crates/openhuman-core/src/agent/message_convert_tests.rs
@@ -26,18 +26,21 @@ fn durable_upload_parts_survive_message_row_replay_without_inline_payloads() {
let Message::User(user) = replay else {
panic!("user row expected")
};
- assert!(user
- .content
- .iter()
- .any(|part| matches!(part, ContentBlock::Audio(MediaRef::Path { .. }))));
- assert!(user
- .content
- .iter()
- .any(|part| matches!(part, ContentBlock::Video(MediaRef::Path { .. }))));
- assert!(user
- .content
- .iter()
- .any(|part| matches!(part, ContentBlock::Document(MediaRef::Path { .. }))));
+ assert!(
+ user.content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Audio(MediaRef::Path { .. })))
+ );
+ assert!(
+ user.content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Video(MediaRef::Path { .. })))
+ );
+ assert!(
+ user.content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Document(MediaRef::Path { .. })))
+ );
assert!(!serde_json::to_string(&row).unwrap().contains("base64"));
}
use tinyinference_llm::model::ModelRequest;
@@ -304,10 +307,12 @@ fn reasoning_content_uses_typed_thinking_block_and_round_trips_metadata() {
ContentBlock::Thinking { text, signature: None } if text == "private thoughts"
)
}));
- assert!(!assistant
- .content
- .iter()
- .any(|block| matches!(block, ContentBlock::ProviderExtension(_))));
+ assert!(
+ !assistant
+ .content
+ .iter()
+ .any(|block| matches!(block, ContentBlock::ProviderExtension(_)))
+ );
let back = message_to_chat_message(&msg).expect("assistant converts");
assert_eq!(back.content, "visible answer");
diff --git a/crates/openhuman-core/src/agent/mod.rs b/crates/openhuman-core/src/agent/mod.rs
index a9e49d4dbb..75cb276547 100644
--- a/crates/openhuman-core/src/agent/mod.rs
+++ b/crates/openhuman-core/src/agent/mod.rs
@@ -65,6 +65,9 @@ pub mod stop_hooks;
/// Generic lifecycle ordering and task-key coalescing live in TinyAgents;
/// definitions, prompts, tools, policy, checkpoints and progress remain here.
pub mod subagent_host;
+#[cfg(test)]
+#[path = "agent_tests.rs"]
+mod tests;
pub mod tinyagents;
pub mod tools;
pub mod triage;
@@ -76,9 +79,6 @@ pub mod turn_env;
/// origin-aware decisions rather than inferring trust from the absence of
/// a chat approval context.
pub mod turn_origin;
-#[cfg(test)]
-#[path = "agent_tests.rs"]
-mod tests;
#[allow(unused_imports)]
pub use session_host::{
diff --git a/crates/openhuman-core/src/agent/multimodal.rs b/crates/openhuman-core/src/agent/multimodal.rs
index b4dcce42d8..60298cf2cd 100644
--- a/crates/openhuman-core/src/agent/multimodal.rs
+++ b/crates/openhuman-core/src/agent/multimodal.rs
@@ -14,17 +14,16 @@ use async_trait::async_trait;
use reqwest::Client;
use crate::config::{
- build_runtime_proxy_client_with_timeouts, MultimodalConfig, MultimodalFileConfig,
+ MultimodalConfig, MultimodalFileConfig, build_runtime_proxy_client_with_timeouts,
};
use tinyagents_session::transcript::{TranscriptMessage, TranscriptPart};
use tinyagents_harness::multimodal::{
- self as mm,
+ self as mm, BlobAttachmentStash,
config::{FileLimits, ImageLimits},
markers,
payload::sha256_prefix,
- resolve::{resolve_file, resolve_image, TextExtractor},
- BlobAttachmentStash,
+ resolve::{TextExtractor, resolve_file, resolve_image},
};
use tinyagents_harness::multimodal::{FilePayload, MultimodalError};
diff --git a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
index 3f772e6b0d..7822ad1a74 100644
--- a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
+++ b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs
@@ -261,9 +261,11 @@ async fn rehydrate_missing_stash_id_keeps_placeholder_text() {
"see [Image: image #att:deadbeefdeadbeef]".to_string(),
)];
let out = rehydrate_image_placeholders(&messages).await;
- assert!(out[0]
- .content
- .contains("[Image: image #att:deadbeefdeadbeef]"));
+ assert!(
+ out[0]
+ .content
+ .contains("[Image: image #att:deadbeefdeadbeef]")
+ );
assert!(!out[0].content.contains("[IMAGE:data:"));
}
diff --git a/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs b/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs
index da8fd5e366..b194a3cb87 100644
--- a/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs
+++ b/crates/openhuman-core/src/agent/multimodal_marker_extraction_tests.rs
@@ -21,9 +21,11 @@ async fn prepare_messages_rejects_too_many_images() {
.await
.expect_err("should reject image count overflow");
- assert!(error
- .to_string()
- .contains("multimodal image limit exceeded"));
+ assert!(
+ error
+ .to_string()
+ .contains("multimodal image limit exceeded")
+ );
}
#[tokio::test]
@@ -80,7 +82,8 @@ async fn prepare_messages_rejects_oversized_file() {
.await
.expect_err("oversized file must be rejected");
- assert!(err
- .to_string()
- .contains("multimodal file size limit exceeded"));
+ assert!(
+ err.to_string()
+ .contains("multimodal file size limit exceeded")
+ );
}
diff --git a/crates/openhuman-core/src/agent/orchestration/delegation.rs b/crates/openhuman-core/src/agent/orchestration/delegation.rs
index 7e214ab8ce..c1e63dbd30 100644
--- a/crates/openhuman-core/src/agent/orchestration/delegation.rs
+++ b/crates/openhuman-core/src/agent/orchestration/delegation.rs
@@ -17,12 +17,12 @@
use std::sync::Arc;
-use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
+use crate::agent_registry::host_definition::AgentDefinition;
use crate::config::Config;
use tinyagents_graph::checkpoint::Checkpointer;
use tinyagents_graph::delegation::{
diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rs
index 31cbe9d046..760372034b 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs
@@ -26,12 +26,12 @@ use super::types::{
AgentSnapshot, SpawnAgentRequest, SpawnAgentResponse, WaitAgentOptions, WaitAgentResponse,
};
use crate::agent::harness::fork_context::ParentExecutionContext;
-use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent,
};
use crate::agent::tinyagents::host::steering::shared_steering_registry;
+use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
use std::collections::BTreeMap;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
index 90685b62b8..451b3da881 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
@@ -206,12 +206,11 @@ async fn saas_dispatch_exposes_only_the_callers_detached_worker_controls() {
);
assert!(crate::core::all::schema_for_rpc_method("openhuman.config_get_config").is_none());
let unreviewed =
- crate::agent_runs::command_center::all_command_center_registered_controllers(
- )
- .into_iter()
- .find(|controller| controller.schema.function == "list")
- .expect("existing Agent controller")
- .schema;
+ crate::agent_runs::command_center::all_command_center_registered_controllers()
+ .into_iter()
+ .find(|controller| controller.schema.function == "list")
+ .expect("existing Agent controller")
+ .schema;
let method = crate::core::all::rpc_method_name(&unreviewed);
assert!(crate::core::all::schema_for_rpc_method(&method).is_none());
assert!(
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
index 0cfbc09def..19d7900119 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
@@ -12,9 +12,9 @@ use tinytools::WorkspaceDescriptor;
use tokio::sync::mpsc::Sender;
use crate::agent::harness::fork_context::ParentExecutionContext;
-use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent::orchestration::worktree;
use crate::agent::progress::AgentProgress;
+use crate::agent_registry::host_definition::AgentDefinition;
use tinyagents_definition::SandboxMode;
use super::staging::{
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 a5e9ffbd1d..cb2e09dae1 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -8,13 +8,13 @@
//! resume the same sub-agent from its checkpoint with the user's response
//! appended to the conversation history.
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
SubagentRunOptions, SubagentRunStatus, continue_subagent, continue_subagent_with_parent,
load_subagent_checkpoint,
};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
index 4d6cb6eac6..61a88862e7 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
@@ -10,8 +10,8 @@
//! Use it for non-trivial sub-tasks that benefit from a self-review/revision
//! loop; use `spawn_subagent` for a single focused hand-off.
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::delegation::run_subagent_delegation_with_parent_context;
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
index 11a722bf32..20f6a23b95 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
@@ -1,10 +1,10 @@
//! Subagent dispatch logic shared by all agent delegation tools.
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
use std::sync::Arc;
use tinyagents_harness::context::{RunConfig, RunContext};
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 e9d50aafae..09af0ab2f0 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
@@ -5,7 +5,6 @@
//! events and, when possible, persisted in the child worker thread.
use super::subagent_abort_report::AbortReport;
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::fleet_tools::FleetToolSet;
use crate::agent::orchestration::running_subagents;
use crate::agent::orchestration::subagent_sessions::{
@@ -17,6 +16,7 @@ use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::core::runtime::DispatchCtx;
use crate::threads::store::{self as conversations, ConversationMessage};
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
index 1335e7c41b..e0aa14c8c5 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
@@ -1,6 +1,5 @@
//! Tool: `spawn_parallel_agents` — fan out independent sub-agent tasks.
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
#[cfg(test)]
use crate::agent::orchestration::spawn_parallel::ParallelAgentLineage;
#[cfg(test)]
@@ -10,6 +9,7 @@ use crate::agent::orchestration::spawn_parallel::{
SpawnParallelGraphOutcome, format_spawn_parallel_success,
run_spawn_parallel_tasks_with_cancellation_and_workspace,
};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
index 2477c97237..79e687c7ca 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
@@ -1,12 +1,12 @@
use super::*;
use crate::agent::OpenHumanSessionHost;
use crate::agent::harness::fork_context::ParentExecutionContext;
-use crate::agent_registry::host_definition::AgentDefinition;
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::spawn_parallel::{
ParallelTaskRejectionKind, SpawnParallelTaskPreflight, prepare_spawn_parallel_tasks_from_defs,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
+use crate::agent_registry::host_definition::AgentDefinition;
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::config::AgentConfig;
use async_trait::async_trait;
use parking_lot::Mutex;
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 408afc750f..505d4df7f8 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
@@ -12,12 +12,12 @@
//! Sub-agents always run in "typed" mode: a narrow archetype-specific
//! prompt with a filtered tool list, on a cheaper model where applicable.
//!
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent_with_parent,
};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::core::runtime::DispatchCtx;
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_worker_thread.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
index 837da9f790..a8be93f2f8 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
@@ -9,8 +9,8 @@
//! Worker threads carry a hard cap on depth: a worker thread cannot spawn
//! another worker thread.
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::subagent_host::{SubagentRunOptions, run_subagent_with_parent};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::threads::store as conversations;
use async_trait::async_trait;
use serde_json::json;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
index 4c6bb3a9f6..bdd5ed8a1e 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
@@ -1,7 +1,7 @@
use super::{ArchetypeDelegationTool, DelegationTarget, SpawnSubagentTool, SpawnWorkerThreadTool};
use crate::agent::harness::ParentExecutionContext;
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::prompts::ConnectedIntegration;
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::threads::store as conversations;
use async_trait::async_trait;
use parking_lot::Mutex;
diff --git a/crates/openhuman-core/src/agent/plan_review/schemas.rs b/crates/openhuman-core/src/agent/plan_review/schemas.rs
index f871a03b9f..8200379101 100644
--- a/crates/openhuman-core/src/agent/plan_review/schemas.rs
+++ b/crates/openhuman-core/src/agent/plan_review/schemas.rs
@@ -2,8 +2,8 @@
//! resolves a parked interactive turn (approve / reject / revise-with-feedback).
use crate::core::runtime::DispatchCtx;
-use serde::de::DeserializeOwned;
use serde::Deserialize;
+use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
@@ -54,8 +54,7 @@ pub fn schemas(function: &str) -> ControllerSchema {
outputs: vec![FieldSchema {
name: "resolved",
ty: TypeSchema::Bool,
- comment:
- "true if a parked turn was woken; false if the request was unknown/expired.",
+ comment: "true if a parked turn was woken; false if the request was unknown/expired.",
required: true,
}],
},
@@ -98,7 +97,7 @@ fn handle_decide(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFut
other => {
return Err(format!(
"invalid decision '{other}' (expected approve|reject|revise)"
- ))
+ ));
}
};
tracing::debug!(
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs
index 44d4b74c83..e8d5ccc1a9 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs
@@ -4,11 +4,11 @@
use std::collections::BTreeMap;
use crate::agent::progress::AgentProgress;
+use tinyagents_harness::observability::trace_export::SpanKind;
use tinyagents_harness::observability::trace_export::serialize::{
- json_f64, json_str, json_u32, json_u64, json_usize, status_of, truncate_chars,
- MAX_ERROR_MESSAGE_CHARS, MAX_MODEL_CONTENT_CHARS,
+ MAX_ERROR_MESSAGE_CHARS, MAX_MODEL_CONTENT_CHARS, json_f64, json_str, json_u32, json_u64,
+ json_usize, status_of, truncate_chars,
};
-use tinyagents_harness::observability::trace_export::SpanKind;
use super::state::{SpanCollector, SubagentState};
use tinyagents_harness::observability::trace_export::SpanStatus;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs
index fc0f3bd5a4..76cf63997c 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs
@@ -5,7 +5,7 @@
use std::collections::BTreeMap;
use tinyagents_harness::observability::trace_export::serialize::{
- json_str, truncate_chars, MAX_ERROR_MESSAGE_CHARS,
+ MAX_ERROR_MESSAGE_CHARS, json_str, truncate_chars,
};
use tinyagents_harness::observability::trace_export::{SpanKind, SpanStatus};
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
index df18f750ec..e0f77f1a06 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
@@ -3,10 +3,10 @@
use std::collections::BTreeMap;
+use tinyagents_harness::observability::trace_export::SpanKind;
use tinyagents_harness::observability::trace_export::serialize::{
- truncate_capture_text, MAX_TOOL_CONTENT_CHARS,
+ MAX_TOOL_CONTENT_CHARS, truncate_capture_text,
};
-use tinyagents_harness::observability::trace_export::SpanKind;
use super::state::SpanCollector;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/export.rs b/crates/openhuman-core/src/agent/progress_tracing/export.rs
index 08de1d9924..cb8618f4f3 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/export.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/export.rs
@@ -1,13 +1,13 @@
//! Handing finished spans to their sink(s): the local NDJSON/log exporter and
//! the remote Langfuse usage-data push.
-use crate::config::schema::AgentTracingConfig;
use crate::config::Config;
+use crate::config::schema::AgentTracingConfig;
use super::langfuse;
use super::otlp;
use crate::config::schema::AgentTracingBackend;
-use tinyagents_harness::observability::trace_export::serialize::{spans_to_ndjson, SpanEnvelope};
+use tinyagents_harness::observability::trace_export::serialize::{SpanEnvelope, spans_to_ndjson};
use tinyagents_harness::observability::trace_export::{RunType, TraceContext, TraceSpan};
/// Map the configured backend onto the upstream NDJSON envelope.
diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
index 725adade1e..7ea5595d6d 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
@@ -60,7 +60,7 @@ use tinyagents_harness::observability::AgentObservation;
use super::SpanCollector;
use crate::agent::progress::AgentProgress;
-use replay::{json_content_text, turn_outcome_for_failure, user_message_text, Replay};
+use replay::{Replay, json_content_text, turn_outcome_for_failure, user_message_text};
#[path = "journal_replay.rs"]
mod replay;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs
index 86ba9eeb36..50908d0ccb 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs
@@ -262,8 +262,7 @@ fn cache_creation_tokens_reach_the_projected_generation_span() {
}
/// The answer the crate injects for an unknown tool (`unknown_tool_message`).
-const UNKNOWN_TOOL_ANSWER: &str =
- "unknown tool `send_fax` (arguments: {\"to\":\"1234\"}): no tool \
+const UNKNOWN_TOOL_ANSWER: &str = "unknown tool `send_fax` (arguments: {\"to\":\"1234\"}): no tool \
with that name is available to you, and calling it again will fail the same way.";
/// The crate's recovered pair for an unknown tool (TOOL-11 `recover_tool_call`):
diff --git a/crates/openhuman-core/src/agent/progress_tracing/langfuse_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/langfuse_tests.rs
index fdb287f841..88544ab65e 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/langfuse_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/langfuse_tests.rs
@@ -2,8 +2,8 @@ use super::*;
use serde_json::json;
use std::collections::BTreeMap;
use tinyagents_harness::events::AgentEvent;
-use tinyagents_harness::observability::trace_export::{SpanStatus, TraceSpan};
use tinyagents_harness::observability::AgentObservation;
+use tinyagents_harness::observability::trace_export::{SpanStatus, TraceSpan};
use tinyagents_harness::ids::{EventId, RunId};
use tinyagents_harness::observability::trace_export::SpanKind;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/otlp.rs b/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
index a850ec2dae..77ef09d10a 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
@@ -5,8 +5,8 @@
//! resolves the backend URL and credential and posts the requests.
use serde_json::Value;
-use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use tinyagents_harness::observability::trace_export::TraceSpan;
+use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use super::langfuse::{environment_for_base, ingestion_url, skip_push};
use crate::config::Config;
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 834c7022f8..76f74aa483 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)
@@ -307,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]
@@ -332,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]
@@ -465,9 +471,10 @@ fn unpriced_model_unknown_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 6b6bab88b4..323b8dbf4d 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 7a370d27d7..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]
@@ -431,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 927787ad67..867d87cd8c 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
@@ -5,8 +5,8 @@
use super::*;
-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;
use tinyagents_harness::turn_stop::TurnStop;
const BREAKER_NOTE: &str = "Stopping after 2 attempt(s): failure class \
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 b85faccd5b..ffa8682685 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_db/schemas.rs b/crates/openhuman-core/src/agent/session_db/schemas.rs
index 47a6faf348..281a65a7cd 100644
--- a/crates/openhuman-core/src/agent/session_db/schemas.rs
+++ b/crates/openhuman-core/src/agent/session_db/schemas.rs
@@ -3,8 +3,8 @@
use crate::core::runtime::DispatchCtx;
use serde_json::{Map, Value};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_session::run_ledger::{AgentRunListRequest, RunEventListRequest};
@@ -39,8 +39,7 @@ fn schema_for(function: &str) -> ControllerSchema {
"run_ledger_list" => ControllerSchema {
namespace: "run_ledger",
function: "list",
- description:
- "List durable agent/workflow run ledger rows with optional filters and pagination.",
+ description: "List durable agent/workflow run ledger rows with optional filters and pagination.",
inputs: vec![
optional_str("status", "Filter by run status."),
optional_str("kind", "Filter by run kind."),
diff --git a/crates/openhuman-core/src/agent/session_db/schemas_tests.rs b/crates/openhuman-core/src/agent/session_db/schemas_tests.rs
index 6204a3ed35..5cdf45175f 100644
--- a/crates/openhuman-core/src/agent/session_db/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/session_db/schemas_tests.rs
@@ -7,9 +7,11 @@ fn all_controller_schemas_lists_registered_functions() {
assert_eq!(schemas.len(), 3);
// The six read-only `session_db` controllers were removed in #6082; only the
// durable run-ledger read surface remains here.
- assert!(schemas
- .iter()
- .all(|schema| schema.namespace == "run_ledger"));
+ assert!(
+ schemas
+ .iter()
+ .all(|schema| schema.namespace == "run_ledger")
+ );
}
/// The removed `session_db` surface must stay removed: none of the six read
@@ -63,10 +65,11 @@ fn schema_for_run_ledger_events_requires_run_id() {
let s = schema_for("run_ledger_events");
assert_eq!(s.namespace, "run_ledger");
assert_eq!(s.function, "events");
- assert!(s
- .inputs
- .iter()
- .any(|input| input.name == "runId" && input.required));
+ assert!(
+ s.inputs
+ .iter()
+ .any(|input| input.name == "runId" && input.required)
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
index 238712fcd6..b4732d44c9 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
@@ -396,7 +396,7 @@ fn the_no_tools_sentinel_can_never_name_a_real_tool() {
#[test]
fn is_empty_tool_scope_distinguishes_the_three_states() {
- use crate::agent_registry::host_definition::{is_empty_tool_scope, NO_TOOLS_SENTINEL};
+ use crate::agent_registry::host_definition::{NO_TOOLS_SENTINEL, is_empty_tool_scope};
use std::collections::HashSet;
// Unset — the historical "everything" sentinel.
@@ -468,15 +468,19 @@ fn the_repl_tools_join_a_belt_only_while_handle_mode_is_active() {
let mut inactive = belt();
super::ensure_repl_tools_visible(&mut inactive, false);
- assert!(tinyjuice_bus::tools::REPL_TOOLS
- .iter()
- .all(|n| !inactive.contains(*n)));
+ assert!(
+ tinyjuice_bus::tools::REPL_TOOLS
+ .iter()
+ .all(|n| !inactive.contains(*n))
+ );
let mut active = belt();
super::ensure_repl_tools_visible(&mut active, true);
- assert!(tinyjuice_bus::tools::REPL_TOOLS
- .iter()
- .all(|n| active.contains(*n)));
+ assert!(
+ tinyjuice_bus::tools::REPL_TOOLS
+ .iter()
+ .all(|n| active.contains(*n))
+ );
// "No filter" and "deliberately no tools" both stay as they were.
let mut unfiltered = std::collections::HashSet::new();
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
index 36d9adc52e..2503c55d2d 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
@@ -6,8 +6,8 @@
//! real tool: it is on the belt, and it is advertised.
use super::*;
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
/// A tool that does nothing but be present under a name nothing else uses.
#[derive(Debug)]
@@ -461,9 +461,11 @@ fn permanent_metadata_without_a_source_is_rejected_before_build() {
)
.err()
.expect("inconsistent permanent metadata must be rejected");
- assert!(error
- .to_string()
- .contains("permanent tool must have exactly one source: missing_source"));
+ assert!(
+ error
+ .to_string()
+ .contains("permanent tool must have exactly one source: missing_source")
+ );
}
/// The factory is told the context the session is built under, not the
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs
index edd3cd3d0c..9df1feb257 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs
@@ -214,9 +214,11 @@ async fn a_padded_name_is_stored_as_the_definitions_own_id() {
.expect("a name that differs only by padding is not a contradiction");
assert_eq!(agent.agent_definition_name(), SEAT);
- assert!(catalogue(&agent)
- .resolve(agent.agent_definition_name())
- .await
- .expect("resolution never errors")
- .is_some());
+ assert!(
+ catalogue(&agent)
+ .resolve(agent.agent_definition_name())
+ .await
+ .expect("resolution never errors")
+ .is_some()
+ );
}
diff --git a/crates/openhuman-core/src/agent/session_host/builder/host_only.rs b/crates/openhuman-core/src/agent/session_host/builder/host_only.rs
index 198c4ca82b..4dbafa2fdb 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/host_only.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/host_only.rs
@@ -29,8 +29,8 @@ use tinyagents_harness::context::RunContext;
use tinyagents_harness::middleware::{PolicyDecision, ToolCallPolicy};
use tinyinference_llm::tool::ToolCall;
-use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent::OpenHumanSessionHost;
+use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::config::Config;
use anyhow::Result;
use tinyagents_definition::{SandboxMode, ToolScope};
@@ -45,8 +45,8 @@ pub struct HostOnlyToolPolicy {
host: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
}
@@ -59,8 +59,8 @@ impl HostOnlyToolPolicy {
host: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
) -> Self {
@@ -112,15 +112,15 @@ pub(super) fn session_policy(
host: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
) -> Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
> {
if !host_only {
diff --git a/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs b/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
index 583c1eb887..e544c03186 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
@@ -64,8 +64,8 @@ pub struct HostTurnTools {
pub policy: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
}
@@ -180,8 +180,8 @@ impl HostTurnTools {
mut self,
policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
) -> Self {
self.policy = Some(policy);
@@ -205,8 +205,8 @@ pub(super) struct MergedHostTurnTools {
pub policy: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
pub withheld: HashSet<String>,
diff --git a/crates/openhuman-core/src/agent/session_host/builder/setters.rs b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
index 301a98859d..6a8089972e 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/setters.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
@@ -378,8 +378,8 @@ impl SessionHostBuilder {
mut self,
policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
) -> Self {
self.tool_policy = Some(policy);
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rs
index c08f041458..81469fa52c 100644
--- a/crates/openhuman-core/src/agent/session_host/driver.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver.rs
@@ -18,7 +18,7 @@ use tinytools_agent::dialect::ToolDialect;
use crate::agent::{
session_host::turn::graph::{self, ChatTurnGraph},
- tinyagents::{host::OpenHumanHostBase, host::OpenHumanRunContext, TurnModelSource},
+ tinyagents::{TurnModelSource, host::OpenHumanHostBase, host::OpenHumanRunContext},
};
/// Immutable host composition consumed by [`OpenHumanSessionDriver`].
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
index b49b402d7a..e1b848003c 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
@@ -17,14 +17,14 @@ use tinyagents_harness::middleware::wrap_harness_instruction;
use crate::agent::{
message_convert::dialect_response_from_provider,
session_host::turn_checkpoint::{
- self, build_deterministic_checkpoint, build_deterministic_final_summary,
- close_repair_instruction, close_verification_prompt, final_answer_instruction,
- parse_close_verdict, quotes_harness_instruction, render_tool_results,
- results_from_tool_outcomes, CloseVerdict, CloseViolation,
+ self, CloseVerdict, CloseViolation, build_deterministic_checkpoint,
+ build_deterministic_final_summary, close_repair_instruction, close_verification_prompt,
+ final_answer_instruction, parse_close_verdict, quotes_harness_instruction,
+ render_tool_results, results_from_tool_outcomes,
},
tinyagents::{TinyagentsTurnOutcome, TurnModelSource},
};
-use crate::inference::provider::{BilledUsage, ChatResponse, AGENT_TURN_MAX_OUTPUT_TOKENS};
+use crate::inference::provider::{AGENT_TURN_MAX_OUTPUT_TOKENS, BilledUsage, ChatResponse};
/// Accounting from model calls performed after the harness loop has ended.
#[derive(Default)]
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
index 1b4c474420..02c42de7c5 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
@@ -311,12 +311,14 @@ async fn timed_out_repair_keeps_the_usage_of_its_answered_call() {
};
// A full channel whose receiver is alive: the correction's send blocks.
let (progress, _receiver) = tokio::sync::mpsc::channel(1);
- assert!(progress
- .try_send(AgentProgress::TextDelta {
- delta: "earlier".into(),
- iteration: 1,
- })
- .is_ok());
+ assert!(
+ progress
+ .try_send(AgentProgress::TextDelta {
+ delta: "earlier".into(),
+ iteration: 1,
+ })
+ .is_ok()
+ );
let mut usage = RepairUsage::for_model("test-model");
let repaired = tokio::time::timeout(
diff --git a/crates/openhuman-core/src/agent/session_host/driver_tests.rs b/crates/openhuman-core/src/agent/session_host/driver_tests.rs
index f73ebc09ce..03b7151aa9 100644
--- a/crates/openhuman-core/src/agent/session_host/driver_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver_tests.rs
@@ -1,7 +1,7 @@
use super::*;
-fn sidecar(
-) -> std::sync::Arc<std::sync::Mutex<crate::agent::tinyagents::host::run_context::SessionTurnSidecar>>
+fn sidecar()
+-> std::sync::Arc<std::sync::Mutex<crate::agent::tinyagents::host::run_context::SessionTurnSidecar>>
{
crate::agent::tinyagents::host::OpenHumanRunContext::new()
.session_sidecar
@@ -32,11 +32,13 @@ fn graph_failure_persists_only_accepted_snapshot_history() {
assert_eq!(partial.history.len(), 2);
assert_eq!(partial.history[0].text(), "stable prefix");
assert_eq!(partial.history[1].text(), "request");
- assert!(partial
- .partial
- .expect("display partial")
- .content
- .contains("provider rejected follow-up"));
+ assert!(
+ partial
+ .partial
+ .expect("display partial")
+ .content
+ .contains("provider rejected follow-up")
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/session_host/hooks.rs b/crates/openhuman-core/src/agent/session_host/hooks.rs
index ffa7d2bf97..ca38c0be01 100644
--- a/crates/openhuman-core/src/agent/session_host/hooks.rs
+++ b/crates/openhuman-core/src/agent/session_host/hooks.rs
@@ -56,32 +56,32 @@ impl OpenHumanSessionHooks {
/// it cannot relabel an already durable turn.
pub fn new(
before_resume: impl for<'a> Fn(
- &'a mut SessionTurnRequest,
- &'a mut TurnOptions<OpenHumanRunContext>,
- SessionStateView<'a>,
- ) -> HookFuture<'a, ResumePreparation>
- + Send
- + Sync
- + 'static,
+ &'a mut SessionTurnRequest,
+ &'a mut TurnOptions<OpenHumanRunContext>,
+ SessionStateView<'a>,
+ ) -> HookFuture<'a, ResumePreparation>
+ + Send
+ + Sync
+ + 'static,
before: impl for<'a> Fn(
- &'a mut SessionTurnRequest,
- &'a mut TurnOptions<OpenHumanRunContext>,
- SessionStateView<'a>,
- ) -> HookFuture<'a, TurnPreparation>
- + Send
- + Sync
- + 'static,
+ &'a mut SessionTurnRequest,
+ &'a mut TurnOptions<OpenHumanRunContext>,
+ SessionStateView<'a>,
+ ) -> HookFuture<'a, TurnPreparation>
+ + Send
+ + Sync
+ + 'static,
before_commit: impl for<'a> Fn(
- &'a SessionTurnOutcome,
- &'a TranscriptTurnOptions<OpenHumanRunContext>,
- ) -> HookFuture<'a, ()>
- + Send
- + Sync
- + 'static,
+ &'a SessionTurnOutcome,
+ &'a TranscriptTurnOptions<OpenHumanRunContext>,
+ ) -> HookFuture<'a, ()>
+ + Send
+ + Sync
+ + 'static,
committed: impl Fn(CommitReceipt<OpenHumanRunContext>) -> HookFuture<'static, ()>
- + Send
- + Sync
- + 'static,
+ + Send
+ + Sync
+ + 'static,
terminal: impl Fn(SessionTerminal) -> HookFuture<'static, ()> + Send + Sync + 'static,
) -> Self {
Self {
diff --git a/crates/openhuman-core/src/agent/session_host/live_tools.rs b/crates/openhuman-core/src/agent/session_host/live_tools.rs
index 16f51e511d..4fdcb5c298 100644
--- a/crates/openhuman-core/src/agent/session_host/live_tools.rs
+++ b/crates/openhuman-core/src/agent/session_host/live_tools.rs
@@ -8,8 +8,8 @@
use std::sync::Arc;
use crate::agent::session_host::types::OpenHumanSessionHost;
-use crate::agent::tinyagents::live_harness::LiveToolSurface;
use crate::agent::tinyagents::ToolPolicyEnforcement;
+use crate::agent::tinyagents::live_harness::LiveToolSurface;
impl OpenHumanSessionHost {
/// The durable tools, the visible names and the tool policy of this
diff --git a/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs b/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs
index 9e8754c50c..97b42fde37 100644
--- a/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs
@@ -176,7 +176,9 @@ async fn resumed_orphaned_tool_head_is_repaired_before_the_request() {
!matches!(first_non_system, Message::Tool(_)),
"the request must not open on an orphaned tool result, got {first_non_system:?}"
);
- assert!(!sent
- .iter()
- .any(|m| matches!(m, Message::Tool(t) if t.tool_call_id.starts_with("call_orphan"))));
+ assert!(
+ !sent
+ .iter()
+ .any(|m| matches!(m, Message::Tool(t) if t.tool_call_id.starts_with("call_orphan")))
+ );
}
diff --git a/crates/openhuman-core/src/agent/session_host/response_shape_turn_tests.rs b/crates/openhuman-core/src/agent/session_host/response_shape_turn_tests.rs
index d4f8cc2ebd..d55c86bfd3 100644
--- a/crates/openhuman-core/src/agent/session_host/response_shape_turn_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/response_shape_turn_tests.rs
@@ -9,9 +9,11 @@ fn a_response_shape_applies_to_exactly_the_next_turn() {
state.pending_response_shape = Some(Arc::clone(&scope));
let first = state.take_turn_inputs();
- assert!(first
- .response_shape
- .as_ref()
- .is_some_and(|taken| Arc::ptr_eq(taken, &scope)));
+ assert!(
+ first
+ .response_shape
+ .as_ref()
+ .is_some_and(|taken| Arc::ptr_eq(taken, &scope))
+ );
assert!(state.take_turn_inputs().response_shape.is_none());
}
diff --git a/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs b/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs
index 5b0a20e592..cd1b990c2c 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime/run_loop.rs
@@ -6,7 +6,7 @@ use super::super::types::OpenHumanSessionHost;
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
use crate::security::prompt_injection::{
- enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,
+ PromptEnforcementAction, PromptEnforcementContext, enforce_prompt_input,
};
use anyhow::Result;
use tinyagents_harness::agent_error::AgentError;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_adapter_session_state_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_adapter_session_state_tests.rs
index 7381a734b4..305aeec07f 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_adapter_session_state_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_adapter_session_state_tests.rs
@@ -1,5 +1,5 @@
-use super::runtime_session::{begin_turn_resume, OpenHumanSessionState};
use super::TurnOverrides;
+use super::runtime_session::{OpenHumanSessionState, begin_turn_resume};
use tinyagents_runtime::ResumeMode;
#[test]
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 e6f7e4e8cd..b7dc87e15e 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
@@ -69,10 +69,12 @@ fn codec_marks_failed_tool_rows_from_the_explicit_turn_sidecar() {
},
)
.unwrap();
- assert!(rows[0]
- .tool_failure
- .as_ref()
- .is_some_and(|failure| failure.failed));
+ assert!(
+ rows[0]
+ .tool_failure
+ .as_ref()
+ .is_some_and(|failure| failure.failed)
+ );
}
/// The durable record is the parent's OWN spend.
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index 44aadbe0c4..e3a47ebeab 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -32,7 +32,7 @@ use super::types::OpenHumanSessionHost;
use crate::agent::{
message_convert::{user_message_from_text, user_text_with_markers},
session_host::{
- driver::OpenHumanSessionDriver, OpenHumanSessionHooks, OpenHumanTranscriptCodec,
+ OpenHumanSessionHooks, OpenHumanTranscriptCodec, driver::OpenHumanSessionDriver,
},
tinyagents::{host::OpenHumanRunContext, middleware::turn_context::TurnContextMiddleware},
};
@@ -75,8 +75,8 @@ struct OpenHumanTurnPrelude {
context_config: crate::config::ContextConfig,
tool_policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
tool_dispatcher: Arc<dyn tinytools_agent::dialect::ToolDialect>,
workspace_dir: std::path::PathBuf,
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs
index b0cb9e3e6c..5ded847bfa 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/memory_ingest_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use tinyagents_harness::summarization::{checkpoint_message, SummaryPlacement};
+use tinyagents_harness::summarization::{SummaryPlacement, checkpoint_message};
use tinyinference_llm::ToolCall;
fn assistant_with_call(id: &str, name: &str) -> Message {
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
index 2137af49b0..54fe438700 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use std::{collections::HashSet, sync::Arc};
-use tinyagents_session::transcript::{session_stem, SessionRef};
+use tinyagents_session::transcript::{SessionRef, session_stem};
use tinyinference_llm::message::Message;
use tinytools::ToolSpec;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
index 47a0ce7450..4fa74e3d08 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
@@ -265,12 +265,14 @@ fn connected_mcp_actions_enter_search_and_leave_on_disconnect() {
.clear();
prelude.refresh_delegation_tool_surface().unwrap();
assert!(!synthesized_tool_names(&prelude).contains(&action));
- assert!(!prelude
- .tool_surface
- .lock()
- .expect("tool surface")
- .deferred_tool_names
- .contains(&action));
+ assert!(
+ !prelude
+ .tool_surface
+ .lock()
+ .expect("tool surface")
+ .deferred_tool_names
+ .contains(&action)
+ );
}
#[cfg(feature = "mcp")]
@@ -396,10 +398,12 @@ async fn desktop_browser_setting_keeps_deferred_tools_in_fresh_and_resumed_surfa
.expect("desktop orchestrator");
for name in ["browser", "browser_open"] {
assert!(host.deferred_tool_names.contains(name), "{name}");
- assert!(!host
- .visible_tool_specs_arc()
- .iter()
- .any(|spec| spec.name == name));
+ assert!(
+ !host
+ .visible_tool_specs_arc()
+ .iter()
+ .any(|spec| spec.name == name)
+ );
}
host.ensure_runtime_session().expect("runtime session");
let prelude = host
@@ -708,14 +712,18 @@ async fn newly_connected_action_cannot_shadow_a_permanent_source() {
mutable.connected_integrations_authoritative = true;
}
let error = prelude.refresh_delegation_tool_surface().unwrap_err();
- assert!(error
- .to_string()
- .contains("collision with synthesized tool"));
+ assert!(
+ error
+ .to_string()
+ .contains("collision with synthesized tool")
+ );
let surface = prelude.tool_surface.lock().unwrap();
assert!(Arc::ptr_eq(&surface.visible_tool_specs, &before));
assert_eq!(surface.tools[0].description(), "host-owned action");
- assert!(!surface
- .synthesized_tools
- .iter()
- .any(|tool| tool.name() == "GMAIL_SEND_EMAIL"));
+ assert!(
+ !surface
+ .synthesized_tools
+ .iter()
+ .any(|tool| tool.name() == "GMAIL_SEND_EMAIL")
+ );
}
diff --git a/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs b/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs
index 874b40ca9f..4587673232 100644
--- a/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::agent::session_host::turn_checkpoint::{
- build_deterministic_final_summary, CheckpointToolResult,
+ CheckpointToolResult, build_deterministic_final_summary,
};
fn result(name: &str, success: bool, content: &str) -> CheckpointToolResult {
diff --git a/crates/openhuman-core/src/agent/session_host/transcript_compat_tests.rs b/crates/openhuman-core/src/agent/session_host/transcript_compat_tests.rs
index 68150cb200..0dc7b76a26 100644
--- a/crates/openhuman-core/src/agent/session_host/transcript_compat_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/transcript_compat_tests.rs
@@ -22,7 +22,7 @@ use std::collections::{BTreeMap, HashMap};
use std::path::{Path, PathBuf};
use std::sync::{Arc, LazyLock, Mutex};
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_harness::testkit::ScriptedModel;
use tinyagents_session::transcript::{SessionRef, TranscriptLocator};
use tinyinference_llm::message::{AssistantMessage, ContentBlock};
@@ -479,14 +479,16 @@ fn assert_retired_tool_replay(identity_bound: bool) {
&store_locator(root.path()),
"retired-audio-thread",
);
- assert!(archived
- .tools
- .as_ref()
- .expect("recorded declarations")
- .as_array()
- .expect("declarations array")
- .iter()
- .any(|spec| spec["name"] == RETIRED));
+ assert!(
+ archived
+ .tools
+ .as_ref()
+ .expect("recorded declarations")
+ .as_array()
+ .expect("declarations array")
+ .iter()
+ .any(|spec| spec["name"] == RETIRED)
+ );
let archived_rows = to_json(&archived.messages);
drop(first);
@@ -512,10 +514,12 @@ fn assert_retired_tool_replay(identity_bound: bool) {
.expect("unthreaded session build")
};
if identity_bound {
- assert!(resumed
- .resume_bound_session()
- .await
- .expect("resume archive"));
+ assert!(
+ resumed
+ .resume_bound_session()
+ .await
+ .expect("resume archive")
+ );
} else {
resumed
.ensure_runtime_session()
diff --git a/crates/openhuman-core/src/agent/session_host/transcript_resume_stable_tests.rs b/crates/openhuman-core/src/agent/session_host/transcript_resume_stable_tests.rs
index f22e5913d6..74b228e49d 100644
--- a/crates/openhuman-core/src/agent/session_host/transcript_resume_stable_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/transcript_resume_stable_tests.rs
@@ -9,8 +9,8 @@ use serde_json::Value;
use tinyinference_llm::model::ModelResponse;
use super::transcript_compat_tests::{
- build_host, model, place_fixture, run_async, store_locator, store_tree, thread_id, Layout,
- SCENARIOS,
+ Layout, SCENARIOS, build_host, model, place_fixture, run_async, store_locator, store_tree,
+ thread_id,
};
fn tree(
@@ -83,9 +83,11 @@ fn a_legacy_workspace_is_adopted_once_and_the_next_process_resumes_in_place() {
let stem = host.session_id().expect("bound session id");
place_fixture(root.path(), scenario, &stem, "");
imported = legacy_rows(root.path());
- assert!(imported
- .iter()
- .all(|rows| !rows.as_array().unwrap().is_empty()));
+ assert!(
+ imported
+ .iter()
+ .all(|rows| !rows.as_array().unwrap().is_empty())
+ );
assert!(host.resume_bound_session().await.expect("first resume"));
after_first = tree(root.path(), &thread, &host);
}
diff --git a/crates/openhuman-core/src/agent/session_host/turn_backstop_tests.rs b/crates/openhuman-core/src/agent/session_host/turn_backstop_tests.rs
index ec76bd6a6a..522119c17e 100644
--- a/crates/openhuman-core/src/agent/session_host/turn_backstop_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/turn_backstop_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use tinyagents_harness::turn_deadline::{parse_backstop, TurnDeadline};
+use tinyagents_harness::turn_deadline::{TurnDeadline, parse_backstop};
#[test]
fn parse_backstop_defaults_and_disables() {
diff --git a/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs b/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs
index 3e4c58fba5..168aa721fa 100644
--- a/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs
@@ -17,13 +17,13 @@
//! committed corpus now.
use crate::agent::session_store::splice_fixture_tests::head_of;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyinference_llm::message::ContentBlock;
use tinyinference_llm::model::ModelResponse;
use super::transcript_compat_tests::{
- build_host, call, classic_path, fixture, golden, import_placed, model, response, run_async,
- snapshot_with, store_locator, thread_id, Scenario, SCENARIOS,
+ SCENARIOS, Scenario, build_host, call, classic_path, fixture, golden, import_placed, model,
+ response, run_async, snapshot_with, store_locator, thread_id,
};
/// Head fixtures that have a typed re-write (the chain and legacy layouts are
@@ -224,10 +224,12 @@ fn an_old_session_continued_by_this_binary_reloads_identically() {
continued_history
);
let transcript = head_of(&locator, &thread);
- assert!(transcript
- .messages
- .iter()
- .any(|row| row.tool_calls.iter().any(|call| call.id == "call_new")));
+ assert!(
+ transcript
+ .messages
+ .iter()
+ .any(|row| row.tool_calls.iter().any(|call| call.id == "call_new"))
+ );
});
}
@@ -286,9 +288,11 @@ fn a_live_image_turn_persists_typed_image_parts_and_resumes_identically() {
);
assert!(!raw.contains("[IMAGE:"), "no text marker is persisted");
- assert!(serde_json::to_string(&vision.0.requests())
- .unwrap()
- .contains(png));
+ assert!(
+ serde_json::to_string(&vision.0.requests())
+ .unwrap()
+ .contains(png)
+ );
let mut second = build_live_image_host(root.path(), live_image_model("unused"), &thread);
assert!(second.resume_bound_session().await.expect("resume"));
diff --git a/crates/openhuman-core/src/agent/session_host/types.rs b/crates/openhuman-core/src/agent/session_host/types.rs
index a1a71393a2..589ee430a0 100644
--- a/crates/openhuman-core/src/agent/session_host/types.rs
+++ b/crates/openhuman-core/src/agent/session_host/types.rs
@@ -442,8 +442,8 @@ pub struct OpenHumanSessionHost {
/// behaviour unless a caller opts into stricter policy.
pub(super) tool_policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
/// Hash of the Composio connection set this OpenHumanSessionHost last reconciled
/// against. Compared at top-of-turn to a fresh hash computed from
@@ -632,8 +632,8 @@ pub struct SessionHostBuilder {
pub(super) tool_policy: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
}
diff --git a/crates/openhuman-core/src/agent/session_import/schemas.rs b/crates/openhuman-core/src/agent/session_import/schemas.rs
index f6b22cb66e..3b0da2ee8e 100644
--- a/crates/openhuman-core/src/agent/session_import/schemas.rs
+++ b/crates/openhuman-core/src/agent/session_import/schemas.rs
@@ -3,10 +3,10 @@
use crate::core::runtime::DispatchCtx;
use serde::Deserialize;
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
#[derive(Debug, Deserialize, Default)]
@@ -34,14 +34,16 @@ pub fn session_import_schemas(function: &str) -> ControllerSchema {
"session_import_run" => ControllerSchema {
namespace: "session_import",
function: "run",
- description:
- "Import the workspace's legacy session files (session_db/sessions.db, \
+ description: "Import the workspace's legacy session files (session_db/sessions.db, \
session_raw transcripts, turn-state JSON) into the storage backend. Runs \
once per workspace (the boot-time import already did, so this is for \
retrying a failed one); sources are never modified and records already in \
the backend are never overwritten.",
inputs: vec![
- optional_bool("dry_run", "Report which legacy sources exist and write nothing."),
+ optional_bool(
+ "dry_run",
+ "Report which legacy sources exist and write nothing.",
+ ),
FieldSchema {
name: "workspace",
ty: TypeSchema::Option(Box::new(TypeSchema::String)),
diff --git a/crates/openhuman-core/src/agent/session_store/mod.rs b/crates/openhuman-core/src/agent/session_store/mod.rs
index 3dc8d79a4a..000b24e281 100644
--- a/crates/openhuman-core/src/agent/session_store/mod.rs
+++ b/crates/openhuman-core/src/agent/session_store/mod.rs
@@ -22,12 +22,12 @@ use tinyagents_session::port::{AgentStores, SessionStoreProvider};
mod rebound;
mod workspace;
-pub use rebound::{rebind_all, ReboundSessionStores, StoreRegistry};
+pub use rebound::{ReboundSessionStores, StoreRegistry, rebind_all};
pub use workspace::{
- artifact_blobs_for, attachment_stash_for, current_documents_for, default_turn_states_for,
- ledger_for, provider_for_workspace, release_workspace, release_workspace_defaults,
- require_ledger, status_store_for, stores_for, stores_or_ephemeral, turn_states_for,
- with_ledger, with_ledger_async, WorkspaceSessionStores,
+ WorkspaceSessionStores, artifact_blobs_for, attachment_stash_for, current_documents_for,
+ default_turn_states_for, ledger_for, provider_for_workspace, release_workspace,
+ release_workspace_defaults, require_ledger, status_store_for, stores_for, stores_or_ephemeral,
+ turn_states_for, with_ledger, with_ledger_async,
};
static PROVIDER: LazyLock<RwLock<Option<Arc<dyn SessionStoreProvider>>>> =
diff --git a/crates/openhuman-core/src/agent/session_store/mod_tests.rs b/crates/openhuman-core/src/agent/session_store/mod_tests.rs
index 549e277dd4..2fbd5afda7 100644
--- a/crates/openhuman-core/src/agent/session_store/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/session_store/mod_tests.rs
@@ -318,11 +318,13 @@ async fn a_stashed_attachment_survives_a_restart_of_the_workspace_store() {
resumed.read_data_uri("att-1").await.unwrap().as_deref(),
Some(data_uri)
);
- assert!(resumed
- .read_data_uri("never-stashed")
- .await
- .unwrap()
- .is_none());
+ assert!(
+ resumed
+ .read_data_uri("never-stashed")
+ .await
+ .unwrap()
+ .is_none()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/session_store/rebound.rs b/crates/openhuman-core/src/agent/session_store/rebound.rs
index 30b77019bf..e5582b8fd9 100644
--- a/crates/openhuman-core/src/agent/session_store/rebound.rs
+++ b/crates/openhuman-core/src/agent/session_store/rebound.rs
@@ -13,8 +13,8 @@
use std::sync::{Arc, LazyLock, Mutex, PoisonError, RwLock, Weak};
-use tinyagents_session::port::{AgentStores, SessionStoreProvider};
use tinyagents_session::DriverSessionStores;
+use tinyagents_session::port::{AgentStores, SessionStoreProvider};
use tinystoragedrivers::{Blocking, StorageBackend, StorageError};
/// The live [`ReboundSessionStores`] of one owner, so a rebind reaches the one
diff --git a/crates/openhuman-core/src/agent/session_store/workspace.rs b/crates/openhuman-core/src/agent/session_store/workspace.rs
index 1af57b2d8f..f2a9d1e543 100644
--- a/crates/openhuman-core/src/agent/session_store/workspace.rs
+++ b/crates/openhuman-core/src/agent/session_store/workspace.rs
@@ -18,9 +18,9 @@ use std::path::{Path, PathBuf};
use std::sync::{Arc, LazyLock, Mutex, PoisonError};
use tinyagents_harness::multimodal::BlobAttachmentStash;
+use tinyagents_session::DriverSessionStores;
use tinyagents_session::port::{AgentStores, SessionStoreProvider, TurnStates};
use tinyagents_session::run_ledger::{LedgerError, LedgerResult, RunLedgerStore};
-use tinyagents_session::DriverSessionStores;
use tinystoragedrivers::{BlobStore, DocumentStore, MemoryStorage, StorageBackend};
/// One fallback provider and the backend it was built over.
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
index 2c8efc165c..d3f058d4d6 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
@@ -1126,7 +1126,7 @@ impl tinyagents_orchestration::subagent::SubagentPersistence for OpenHumanPersis
#[path = "lifecycle_outcome.rs"]
mod outcome;
-use outcome::{host_outcome_to_neutral, HostInFlightMap};
+use outcome::{HostInFlightMap, host_outcome_to_neutral};
fn outcome_to_host(
result: SubagentRunResult,
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
index e4f900d978..9167a68148 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle_tests.rs
@@ -4,8 +4,8 @@ use tinyagents_orchestration::subagent::{
};
use super::lifecycle::{
- host_in_flight, load_subagent_checkpoint, merged_resume_history, HostInFlight,
- OpenHumanPersistence,
+ HostInFlight, OpenHumanPersistence, host_in_flight, load_subagent_checkpoint,
+ merged_resume_history,
};
use super::{SubagentMode, SubagentRunOutcome, SubagentRunStatus, SubagentUsage};
@@ -324,7 +324,7 @@ async fn host_coalescer_keeps_the_leader_winner_and_cancels_only_the_observer()
#[tokio::test]
async fn each_agent_dedupes_its_own_in_flight_sub_agents() {
use crate::core::runtime::agent_scope::test_agent_context;
- use crate::core::runtime::{context::CoreContext, DomainSet};
+ use crate::core::runtime::{DomainSet, context::CoreContext};
use std::sync::Arc;
let root = CoreContext::for_test(DomainSet::full(), None);
diff --git a/crates/openhuman-core/src/agent/subagent_host/mod.rs b/crates/openhuman-core/src/agent/subagent_host/mod.rs
index 4c3f3ea2ac..bccf75af5f 100644
--- a/crates/openhuman-core/src/agent/subagent_host/mod.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/mod.rs
@@ -58,8 +58,8 @@ mod persisted_compat_tests;
pub use autonomous::{definition_iter_cap, subagent_iter_cap_with_autonomous_lift};
pub(crate) use lifecycle::load_subagent_checkpoint;
pub use lifecycle::{
- continue_subagent, continue_subagent_with_parent, run_subagent, run_subagent_with_parent,
- OpenHumanSubagentHost,
+ OpenHumanSubagentHost, continue_subagent, continue_subagent_with_parent, run_subagent,
+ run_subagent_with_parent,
};
pub(crate) use ops::is_safe_task_id;
pub use types::{
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs b/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs
index a053562b89..fce8882f3b 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs
@@ -61,10 +61,10 @@ pub(super) use super::types::{SubagentMode, SubagentRunError, SubagentRunOptions
#[cfg(test)]
pub(super) use crate::agent::harness::fork_context::ParentExecutionContext;
#[cfg(test)]
-pub(super) use crate::agent_registry::host_definition::AgentDefinition;
-#[cfg(test)]
pub(super) use crate::agent::tinyagents::budget::MAX_SPAWN_DEPTH;
#[cfg(test)]
+pub(super) use crate::agent_registry::host_definition::AgentDefinition;
+#[cfg(test)]
use tinyagents_definition::PromptSource;
#[cfg(test)]
use tinytools::ToolSpec;
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 741f6bd855..b2f5e03489 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -11,7 +11,6 @@ use std::time::Instant;
use crate::agent::harness::artifact_offload::offload_run_result;
use crate::agent::harness::fork_context::ParentExecutionContext;
-use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::agent::prompts::{
PromptContext, SubagentRenderOptions, render_subagent_system_prompt_with_format,
};
@@ -23,6 +22,7 @@ use crate::agent::subagent_host::types::{
SubagentMode, SubagentRunError, SubagentRunOptions, SubagentRunOutcome,
};
use crate::agent::tinyagents::budget::MAX_SPAWN_DEPTH;
+use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::inference::provider::AGENT_TURN_MAX_OUTPUT_TOKENS;
use tinyagents_definition::{
AgentTier, IterationPolicy, PromptSource, SandboxMode as AgentSandboxMode,
diff --git a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
index d790529128..dc2f77e5ee 100644
--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
@@ -5,8 +5,8 @@
//! actually see?).
use super::types::SubagentRunError;
-use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent::prompts::PromptContext;
+use crate::agent_registry::host_definition::AgentDefinition;
use tinyagents_definition::{PromptSource, ToolScope};
use tinytools::Tool;
diff --git a/crates/openhuman-core/src/agent/subagent_host/tool_ranking_tests.rs b/crates/openhuman-core/src/agent/subagent_host/tool_ranking_tests.rs
index 615c76aa5b..9c6ed69736 100644
--- a/crates/openhuman-core/src/agent/subagent_host/tool_ranking_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/tool_ranking_tests.rs
@@ -10,7 +10,7 @@
//! moving up with the algorithm.
use crate::agent::prompts::ConnectedIntegrationTool;
-use tinyagents_harness::tool::{rank_tools_by_prompt, SelectableTool, MIN_CONFIDENT_HITS};
+use tinyagents_harness::tool::{MIN_CONFIDENT_HITS, SelectableTool, rank_tools_by_prompt};
fn rank_actions_by_prompt(
prompt: &str,
diff --git a/crates/openhuman-core/src/agent/tinyagents/budget.rs b/crates/openhuman-core/src/agent/tinyagents/budget.rs
index d9039891f1..e648efaf82 100644
--- a/crates/openhuman-core/src/agent/tinyagents/budget.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/budget.rs
@@ -4,10 +4,10 @@ use std::sync::Arc;
/// Product recursion ceiling shared by native and MCP delegation.
pub(crate) const MAX_SPAWN_DEPTH: usize = 3;
+use tinyinference_llm::model::ChatModel;
pub use tinyinference_llm::model::budget::{
Budget, BudgetExceeded, BudgetSnapshot, CallBudget, Spend, SpendLimits,
};
-use tinyinference_llm::model::ChatModel;
/// A shared ledger and conservative reservation bounds for every physical call.
#[derive(Debug, Clone)]
diff --git a/crates/openhuman-core/src/agent/tinyagents/config.rs b/crates/openhuman-core/src/agent/tinyagents/config.rs
index bf1d330f42..1689aa29e2 100644
--- a/crates/openhuman-core/src/agent/tinyagents/config.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/config.rs
@@ -20,7 +20,7 @@ use tinyagents_harness::config::{
};
use crate::config::{
- AgentConfig, Config, DelegateAgentConfig, RequiredOutputContract, DEFAULT_MODEL,
+ AgentConfig, Config, DEFAULT_MODEL, DelegateAgentConfig, RequiredOutputContract,
};
/// Translates OpenHuman's free-form `agent.tool_dispatcher` string into the
diff --git a/crates/openhuman-core/src/agent/tinyagents/context_wiring.rs b/crates/openhuman-core/src/agent/tinyagents/context_wiring.rs
index e720053492..e0691aed13 100644
--- a/crates/openhuman-core/src/agent/tinyagents/context_wiring.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/context_wiring.rs
@@ -7,14 +7,14 @@
use std::sync::Arc;
use tinyagents_harness::middleware::{
- compression_policy, legacy_max_input_tokens, microcompact_for_window, split_input_allowance,
ArtifactIndexTocMiddleware, CapturedOutcomes, ContextCompressionMiddleware, ContextLadder,
FinalCallWrapUpMiddleware, ImageAwareMessageTrimMiddleware, OutcomesUnavailable,
+ compression_policy, legacy_max_input_tokens, microcompact_for_window, split_input_allowance,
};
use tinyagents_harness::runtime::AgentHarness;
use tinyagents_harness::summarization::{
- FaultTolerantCachingSummarizer, ModelSummarizer, SummarizationPolicy, TaskStateSummarizer,
- DEFAULT_TASK_STATE_CHUNK_TOKENS,
+ DEFAULT_TASK_STATE_CHUNK_TOKENS, FaultTolerantCachingSummarizer, ModelSummarizer,
+ SummarizationPolicy, TaskStateSummarizer,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
@@ -92,7 +92,9 @@ pub(super) fn install_context_ladder(
restore_allowance,
)
.with_deliverable_tools(["file_write", "apply_patch"])
- .with_cleared_placeholder(tinyagents_harness::middleware::library::DEFAULT_CLEARED_PLACEHOLDER)
+ .with_cleared_placeholder(
+ tinyagents_harness::middleware::library::DEFAULT_CLEARED_PLACEHOLDER,
+ )
.with_budget_notice(BUDGET_NOTICE_THRESHOLDS),
)
});
diff --git a/crates/openhuman-core/src/agent/tinyagents/deadline_wind_down.rs b/crates/openhuman-core/src/agent/tinyagents/deadline_wind_down.rs
index 324e9198e5..e6550a56d9 100644
--- a/crates/openhuman-core/src/agent/tinyagents/deadline_wind_down.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/deadline_wind_down.rs
@@ -8,7 +8,7 @@
use std::sync::Arc;
-use tinyagents_harness::middleware::library::{install_wind_down, WindDownMiddleware};
+use tinyagents_harness::middleware::library::{WindDownMiddleware, install_wind_down};
use tinyagents_harness::runtime::AgentHarness;
use tinyagents_harness::steering::SteeringHandle;
diff --git a/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs b/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs
index 628316eed6..0fac59f2f1 100644
--- a/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/discovery/discovery_tests.rs
@@ -77,10 +77,12 @@ async fn overlap_ranker_ranks_by_token_overlap_and_names_its_kind() {
hits.first().map(|h| h.key.as_str()),
Some("SLACK_SEND_MESSAGE")
);
- assert!(ranker
- .rank(" ", &tinytools::RankContext::empty(), &candidates, 3)
- .await
- .is_err());
+ assert!(
+ ranker
+ .rank(" ", &tinytools::RankContext::empty(), &candidates, 3)
+ .await
+ .is_err()
+ );
}
/// A text dialect renders the prompt catalogue and the harness clears
diff --git a/crates/openhuman-core/src/agent/tinyagents/discovery/embedding_ranker_tests.rs b/crates/openhuman-core/src/agent/tinyagents/discovery/embedding_ranker_tests.rs
index 4856cccfc0..19517dd40a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/discovery/embedding_ranker_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/discovery/embedding_ranker_tests.rs
@@ -1,5 +1,5 @@
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
use tinytools::{RankCandidate, RankContext, ToolRanker};
diff --git a/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs b/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs
index 1554910acf..11db8d9032 100644
--- a/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/discovery/mod.rs
@@ -170,7 +170,7 @@ pub(crate) fn bridge_prompt_tools(
if deferred == 0 {
return Vec::new();
}
- use tinyagents_harness::tool::discover::{bridge_schemas, DeferredCatalog};
+ use tinyagents_harness::tool::discover::{DeferredCatalog, bridge_schemas};
// `discovery_policy` zeroes the manifest budget, so the manifest renders
// as a bare count: the prompt advertises that a search exists, not what
// it would find.
@@ -213,7 +213,7 @@ impl ToolRanker for OverlapRanker {
candidates: &[tinytools::RankCandidate],
limit: usize,
) -> Result<Vec<tinytools::RankHit>, tinytools::RankError> {
- use tinyagents_harness::tool::{rank_tools_by_prompt, SelectableTool};
+ use tinyagents_harness::tool::{SelectableTool, rank_tools_by_prompt};
if intent.trim().is_empty() {
return Err(tinytools::RankError::InvalidInput {
reason: "intent is empty".to_owned(),
diff --git a/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs b/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs
index cda08f21b9..a3e122b392 100644
--- a/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs
@@ -8,8 +8,8 @@
//! the hosted path. The user-facing class is untouched: the text still reads as
//! `run timed out: ...`, which `web_errors` classifies as `turn_timeout`.
-use tinyagents_harness::runtime::{HostedError, HostedErrorKind, TimeoutBound};
use tinyagents_harness::TinyAgentsError;
+use tinyagents_harness::runtime::{HostedError, HostedErrorKind, TimeoutBound};
use tinyagents_harness::agent_error::TurnTimeoutBound;
diff --git a/crates/openhuman-core/src/agent/tinyagents/journal.rs b/crates/openhuman-core/src/agent/tinyagents/journal.rs
index e836d74ef3..0f7ff998f9 100644
--- a/crates/openhuman-core/src/agent/tinyagents/journal.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/journal.rs
@@ -51,8 +51,8 @@ use std::sync::{Arc, Mutex};
use tinyagents_harness::events::{EventSink, HarnessRunStatus};
use tinyagents_harness::ids::{ComponentId, HarnessPhase, RunId, ThreadId};
use tinyagents_harness::observability::{
- process_env_secrets, AgentObservation, DriverStatusStore, FanOutSink, HarnessEventJournal,
- HarnessStatusStore, JournalSink, RedactingSink, StoreEventJournal,
+ AgentObservation, DriverStatusStore, FanOutSink, HarnessEventJournal, HarnessStatusStore,
+ JournalSink, RedactingSink, StoreEventJournal, process_env_secrets,
};
use tinyagents_harness::store::AppendStore;
diff --git a/crates/openhuman-core/src/agent/tinyagents/journal_tests.rs b/crates/openhuman-core/src/agent/tinyagents/journal_tests.rs
index 67247ddfad..0d708ead93 100644
--- a/crates/openhuman-core/src/agent/tinyagents/journal_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/journal_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::core::runtime::agent_scope::test_agent_context;
-use crate::core::runtime::{context::CoreContext, DomainSet};
+use crate::core::runtime::{DomainSet, context::CoreContext};
#[tokio::test]
async fn request_journal_runs_stay_with_the_agent_that_registered_them() {
diff --git a/crates/openhuman-core/src/agent/tinyagents/live_harness.rs b/crates/openhuman-core/src/agent/tinyagents/live_harness.rs
index 974df27bfb..3074684ca4 100644
--- a/crates/openhuman-core/src/agent/tinyagents/live_harness.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/live_harness.rs
@@ -28,11 +28,11 @@ use tinyagents_harness::middleware::{
};
use tinyagents_harness::runtime::AgentHarness;
+use super::ToolPolicyEnforcement;
use super::host::OpenHumanRunContext;
use super::middleware;
use super::tool_registration::{capability_diagnostics, host_tool_set_builder};
use super::turn_policy::run_policy_for;
-use super::ToolPolicyEnforcement;
/// Generous tool-call budget for one live conversation; the harness's
/// per-call admission still counts against it.
diff --git a/crates/openhuman-core/src/agent/tinyagents/memory_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/memory_summarizer.rs
index 4e2be39d70..5ea246df6d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/memory_summarizer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/memory_summarizer.rs
@@ -16,7 +16,7 @@ use std::sync::Arc;
use async_trait::async_trait;
use tinyagents_harness::error::Result;
-use tinyagents_harness::summarization::{is_checkpoint, Summarizer, SummaryRecord, SummaryRequest};
+use tinyagents_harness::summarization::{Summarizer, SummaryRecord, SummaryRequest, is_checkpoint};
use tinyinference_llm::message::{ContentBlock, Message};
use tinymemory_api::{Role, Turn};
diff --git a/crates/openhuman-core/src/agent/tinyagents/memory_summarizer_tests.rs b/crates/openhuman-core/src/agent/tinyagents/memory_summarizer_tests.rs
index 1c4f7be095..d6946774e5 100644
--- a/crates/openhuman-core/src/agent/tinyagents/memory_summarizer_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/memory_summarizer_tests.rs
@@ -3,7 +3,7 @@ use super::*;
use chrono::Utc;
use tinyagents_harness::summarization::ConcatSummarizer;
-use crate::memory::lifecycle::hooks::{post_turn, pre_turn, PostTurnInput, PreTurnInput};
+use crate::memory::lifecycle::hooks::{PostTurnInput, PreTurnInput, post_turn, pre_turn};
use crate::memory::scope::MemoryIdentity;
use crate::memory::test_fixtures::{bind_reference, config_in};
@@ -113,13 +113,14 @@ async fn without_recall_the_summarizer_is_unchanged_and_its_failure_is_its_own()
let mut quiet = (*turn).clone();
quiet.identity.recall = false;
let off = MemoryRecallSummarizer::wrap(Box::new(ConcatSummarizer), Some(Arc::new(quiet)));
- assert!(!off
- .summarize(&dropped())
- .await
- .unwrap()
- .summary
- .text()
- .contains(RECALLED_HEADING));
+ assert!(
+ !off.summarize(&dropped())
+ .await
+ .unwrap()
+ .summary
+ .text()
+ .contains(RECALLED_HEADING)
+ );
let failing = MemoryRecallSummarizer::wrap(Box::new(Failing), Some(turn));
assert!(failing.summarize(&dropped()).await.is_err());
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs
index 1ffaadf3e6..df3c01e374 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs
@@ -12,7 +12,7 @@ use tinyinference_llm::tool::ToolCall as TaToolCall;
use tinytools::ToolResult as TaToolResult;
use crate::security::approval::{
- redact_args, summarize_action, ApprovalGate, ExecutionOutcome, GateOutcome,
+ ApprovalGate, ExecutionOutcome, GateOutcome, redact_args, summarize_action,
};
use tinytools::Tool;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs
index 18d026f6b0..83f2a47f79 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs
@@ -3,8 +3,8 @@
//! token, which is minted by the host and must survive the scrubber.
use tinyagents_harness::middleware::{
- redaction_notice, scrub_with_notice, CredentialScrubMiddleware, ToolScrubber,
- REDACTION_PLACEHOLDER,
+ CredentialScrubMiddleware, REDACTION_PLACEHOLDER, ToolScrubber, redaction_notice,
+ scrub_with_notice,
};
/// The browser task's `pending.token` is a host-minted, one-time confirmation
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs
index 06c2cb5f12..7a6b95c99c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs
@@ -3,10 +3,10 @@
//! stays readable: the ladder driver lives there, the classification here.
use super::fetched_site::fetched_site_policy;
-use tinyagents_harness::middleware::{call_effect, CallEffect};
+use tinyagents_harness::middleware::{CallEffect, call_effect};
use tinyagents_harness::no_progress::{
- is_argument_rejection, is_command_exit_report, is_pre_execution_failure, json_error_recovery,
- ARGUMENT_SCHEMA_RECOVERY,
+ ARGUMENT_SCHEMA_RECOVERY, is_argument_rejection, is_command_exit_report,
+ is_pre_execution_failure, json_error_recovery,
};
use tinyinference_llm::failure::is_recoverable_failure_text as is_recoverable_tool_failure;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack.rs
index dc3fba6382..ee4dced83e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack.rs
@@ -27,8 +27,8 @@ impl MemoryPackSource<OpenHumanRunContext> for TurnMemoryPack {
}
/// The harness middleware over [`TurnMemoryPack`].
-pub(crate) fn memory_pack_middleware(
-) -> tinyagents_hooks::lifecycle::MemoryPackMiddleware<OpenHumanRunContext, TurnMemoryPack> {
+pub(crate) fn memory_pack_middleware()
+-> tinyagents_hooks::lifecycle::MemoryPackMiddleware<OpenHumanRunContext, TurnMemoryPack> {
tinyagents_hooks::lifecycle::MemoryPackMiddleware::new(TurnMemoryPack)
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack_tests.rs
index 5e6295d4f9..2f346bddb8 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/memory_pack_tests.rs
@@ -8,7 +8,7 @@ use std::sync::Arc;
use tinyagents_harness::context::RunConfig;
use tinyinference_llm::message::Message;
-use crate::memory::lifecycle::hooks::{MemoryTurn, TurnPack, OPEN_TAG};
+use crate::memory::lifecycle::hooks::{MemoryTurn, OPEN_TAG, TurnPack};
use crate::memory::scope::MemoryIdentity;
fn context(pack: Option<TurnPack>) -> RunContext<OpenHumanRunContext> {
@@ -171,12 +171,14 @@ async fn on_a_hoisting_model_only_the_previous_tail_message_falls_out_of_the_cac
&second.messages[..turn_two.len() - 1],
&turn_two[..turn_two.len() - 1]
);
- assert!(second
- .messages
- .last()
- .unwrap()
- .text()
- .contains("travels by rail"));
+ assert!(
+ second
+ .messages
+ .last()
+ .unwrap()
+ .text()
+ .contains("travels by rail")
+ );
// Turn one's tail carried turn one's pack, so the shared prefix stops just
// before it: one user message, never the whole history.
assert_eq!(
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs
index 8d09df2f46..f96933701a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs
@@ -2,7 +2,7 @@ use super::*;
use std::collections::{HashMap, HashSet};
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_harness::context::{RunConfig, RunContext};
use tinyagents_harness::middleware::Middleware;
use tinyinference_llm::tool::ToolCall as TaToolCall;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
index b0ff5b9dbb..af9b87f872 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
@@ -9,12 +9,12 @@ use async_trait::async_trait;
use tinyagents_harness::context::RunContext;
use tinyagents_harness::error::Result as TaResult;
use tinyagents_harness::middleware::{
- call_effect, dispatch_target, is_repeat_call_exempt, repeat_guard_marker, CallEffect,
- Middleware, ToolFactsLookup, ToolInvocationIdentity,
+ CallEffect, Middleware, ToolFactsLookup, ToolInvocationIdentity, call_effect, dispatch_target,
+ is_repeat_call_exempt, repeat_guard_marker,
};
use tinyagents_harness::no_progress::{
- classified_step, clear_recovered, ClassifiedFailureTracker, ClassifiedStep, FailurePolicy,
- NoProgress, NoProgressTracker, RecoverableFailureLadder, ToolAttempt,
+ ClassifiedFailureTracker, ClassifiedStep, FailurePolicy, NoProgress, NoProgressTracker,
+ RecoverableFailureLadder, ToolAttempt, classified_step, clear_recovered,
};
use tinyagents_harness::steering::SteeringHandle;
use tinyagents_hooks::stop::StopLatch;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
index 024e4bd1cb..a555278609 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
@@ -16,15 +16,15 @@ use tinyinference_llm::tool::ToolCall as TaToolCall;
use tinytools::{ToolPolicy as TaToolPolicy, ToolResult as TaToolResult};
use crate::agent::harness::tool_result_artifacts::{
- artifact_read_target, page_artifact_read, HostArtifactStore,
- TINYAGENTS_TOOL_RESULT_ARTIFACT_STORE,
+ HostArtifactStore, TINYAGENTS_TOOL_RESULT_ARTIFACT_STORE, artifact_read_target,
+ page_artifact_read,
};
use crate::agent::tinyagents::payload_summarizer::DynPayloadSummarizer;
use crate::inference::tokenjuice::generate::GenerateTicket;
use tinyagents_harness::artifacts::tool_results::{ArtifactRead, ToolResultArtifactOutcome};
use tinyagents_harness::middleware::library::{
- plan_output_stages, run_output_ladder, CompactedOutput, OutputCapPolicy, OutputLadderInput,
- OutputProcessor,
+ CompactedOutput, OutputCapPolicy, OutputLadderInput, OutputProcessor, plan_output_stages,
+ run_output_ladder,
};
use tinyjuice_bus::types::AgentTokenjuiceCompression;
diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rs
index b3a3c1f052..bf677332ff 100644
--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs
@@ -79,8 +79,8 @@ pub(crate) use turn_outcome::TinyagentsTurnOutcome;
#[cfg(test)]
pub(crate) use turn_policy::is_subagent_spawn_or_delegate_tool;
pub(crate) use turn_policy::{
- agent_turn_wall_clock_ms_for, chat_provider_is_local, local_web_turn_backstop_secs,
- ToolPolicyEnforcement,
+ ToolPolicyEnforcement, agent_turn_wall_clock_ms_for, chat_provider_is_local,
+ local_web_turn_backstop_secs,
};
// Test-only glue so `tinyagents_tests.rs`'s `use super::*;` sees the
diff --git a/crates/openhuman-core/src/agent/tinyagents/model.rs b/crates/openhuman-core/src/agent/tinyagents/model.rs
index 15cada8431..19de9cda11 100644
--- a/crates/openhuman-core/src/agent/tinyagents/model.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/model.rs
@@ -5,7 +5,7 @@ use std::sync::Arc;
use tinyinference_llm::message::{AssistantMessage, ContentBlock};
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
use tinyinference_llm::tool::ToolCall as TaToolCall;
-use tinyinference_llm::usage::{recover_usage, ProviderUsageReport};
+use tinyinference_llm::usage::{ProviderUsageReport, recover_usage};
use crate::inference::provider::{BilledUsage, ChatResponse};
diff --git a/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs b/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs
index 4974e34023..5239db5315 100644
--- a/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs
@@ -12,7 +12,7 @@
use std::sync::{Arc, Mutex};
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_definition::{AgentDefinition, InMemoryDefinitionRegistry};
use tinyagents_harness::context::{RunConfig, RunContext};
use tinyagents_harness::host::{
@@ -224,10 +224,9 @@ async fn the_security_gate_refuses_a_nested_call_on_the_hosted_path() {
));
let host = HostCapabilities::new(
Arc::new(StaticContextComposer::empty()),
- Arc::new(InMemoryDefinitionRegistry::new(vec![AgentDefinition::new(
- "helper", "Helper", "test",
- )
- .with_tools(["caller", "read_file"])])),
+ Arc::new(InMemoryDefinitionRegistry::new(vec![
+ AgentDefinition::new("helper", "Helper", "test").with_tools(["caller", "read_file"]),
+ ])),
gate,
Arc::new(FixedModelResolver::new(model())),
);
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
index 918069ff7f..634fd05fde 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
@@ -259,8 +259,7 @@ async fn tool_completed_projects_output_arguments_and_elapsed() {
}
/// The answer the crate injects for an unknown tool (`unknown_tool_message`).
-const UNKNOWN_TOOL_ANSWER: &str =
- "unknown tool `search_files` (arguments: {\"query\":\"config\"}): \
+const UNKNOWN_TOOL_ANSWER: &str = "unknown tool `search_files` (arguments: {\"query\":\"config\"}): \
no tool with that name is available to you, and calling it again will fail the same way.";
/// Emit what the crate emits for an unknown-tool call since TOOL-11: the typed
diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
index 00769aea44..5218bcab43 100644
--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
@@ -22,16 +22,16 @@
use std::sync::Arc;
-use anyhow::{anyhow, Result};
+use anyhow::{Result, anyhow};
use tinyagents_harness::context::RunContext;
use tinyagents_harness::summarization::payload_summarizer::{
- run_unary_summary, summary_child_config, PayloadSummarizer as HarnessPayloadSummarizer,
+ PayloadSummarizer as HarnessPayloadSummarizer, run_unary_summary, summary_child_config,
};
use tracing::debug;
-use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent::subagent_host;
use crate::agent::tinyagents::host::OpenHumanRunContext;
+use crate::agent_registry::host_definition::AgentDefinition;
use {
crate::inference::tokenjuice::generate::PreparedGenerate, tinyjuice_bus::wire::GenerateRequest,
};
@@ -45,10 +45,10 @@ use {
/// way supplies its own. The prompt is not part of this — TinyJuice writes it
/// and sends it in the [`GenerateRequest`].
pub type DynPayloadSummarizer = dyn HarnessPayloadSummarizer<
- OpenHumanRunContext,
- Prepared = PreparedGenerate,
- Error = anyhow::Error,
->;
+ OpenHumanRunContext,
+ Prepared = PreparedGenerate,
+ Error = anyhow::Error,
+ >;
/// Runs the `summarizer` agent definition's model as a unary child of the turn.
pub struct SubagentPayloadSummarizer {
diff --git a/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs b/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs
index eb9d936d0c..3b2736b14e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs
@@ -19,8 +19,8 @@
//! It is a mitigation, not a guarantee — detecting fabrication needs the
//! tool-call record carried out to the caller.
-use tinytools::status::POLICY_BLOCKED_MARKER;
use tinytools::PermissionLevel;
+use tinytools::status::POLICY_BLOCKED_MARKER;
/// Generic workaround for a raw security-policy / autonomy block. These denials
/// originate deep in the tools / `SecurityPolicy` layer (autonomy tier, command
diff --git a/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs b/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs
index 7f8365587b..87f16a5b6f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs
@@ -17,7 +17,7 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_harness::context::RunConfig;
use tinyagents_harness::middleware::PromptCacheGuardMiddleware;
use tinyagents_harness::runtime::AgentHarness;
diff --git a/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs b/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs
index 2f7b42458c..cc463491dd 100644
--- a/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/reaper_tests.rs
@@ -3,7 +3,7 @@ use super::*;
use tinyagents_harness::events::HarnessRunStatus;
use tinyagents_harness::ids::{ComponentId, ExecutionStatus, HarnessPhase};
use tinyagents_harness::observability::{
- mint_run_id, DriverStatusStore, HarnessStatusStore, ORPHAN_REAP_REASON,
+ DriverStatusStore, HarnessStatusStore, ORPHAN_REAP_REASON, mint_run_id,
};
/// Build a fresh status in a non-terminal state and persist it.
diff --git a/crates/openhuman-core/src/agent/tinyagents/reasoning_tests.rs b/crates/openhuman-core/src/agent/tinyagents/reasoning_tests.rs
index 7efffd319b..4093f16d86 100644
--- a/crates/openhuman-core/src/agent/tinyagents/reasoning_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/reasoning_tests.rs
@@ -135,12 +135,14 @@ fn unknown_requested_effort_is_rejected_and_keeps_the_prior_choice() {
Some("off"),
)
.expect("valid effort");
- assert!(apply_requested_effort(
- &crate::core::runtime::DispatchCtx::ambient(),
- thread,
- Some("turbo")
- )
- .is_err());
+ assert!(
+ apply_requested_effort(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ thread,
+ Some("turbo")
+ )
+ .is_err()
+ );
assert_eq!(
thread_effort(&crate::core::runtime::DispatchCtx::ambient(), thread),
Some(ReasoningEffort::None)
@@ -285,7 +287,7 @@ fn a_cap_too_small_for_a_provider_minimum_budget_keeps_the_effort_only() {
#[tokio::test]
async fn reasoning_effort_stays_with_the_agent_that_chose_it() {
use crate::core::runtime::agent_scope::test_agent_context;
- use crate::core::runtime::{context::CoreContext, DomainSet};
+ use crate::core::runtime::{DomainSet, context::CoreContext};
let root = CoreContext::for_test(DomainSet::full(), None);
let alpha = test_agent_context(&root, "alpha");
let beta = test_agent_context(&root, "beta");
diff --git a/crates/openhuman-core/src/agent/tinyagents/run_mode.rs b/crates/openhuman-core/src/agent/tinyagents/run_mode.rs
index 467c38c614..d1deda68ab 100644
--- a/crates/openhuman-core/src/agent/tinyagents/run_mode.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/run_mode.rs
@@ -100,8 +100,8 @@ pub fn parse_mode_label(label: &str) -> Option<RunMode> {
// `schemas.rs` because this module IS the domain's entire surface (registry
// + RPC), not a multi-file domain directory.
-use serde::de::DeserializeOwned;
use serde::Deserialize;
+use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
diff --git a/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs b/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs
index d0586b0d24..51e09615f4 100644
--- a/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs
@@ -56,7 +56,7 @@ fn mode_label_round_trips() {
#[tokio::test]
async fn plan_mode_stays_with_the_agent_that_set_it() {
use crate::core::runtime::agent_scope::test_agent_context;
- use crate::core::runtime::{context::CoreContext, DomainSet};
+ use crate::core::runtime::{DomainSet, context::CoreContext};
let root = CoreContext::for_test(DomainSet::full(), None);
let alpha = test_agent_context(&root, "alpha");
let beta = test_agent_context(&root, "beta");
diff --git a/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs b/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs
index 5148bb761e..10d4462083 100644
--- a/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs
@@ -22,7 +22,7 @@ use tinyagents_harness::run_queue::{ForwardEvent, ForwardEventSink, QueuedMessag
use tinyagents_harness::steering::SteeringHandle;
use tinyagents_runtime::turn_driver::{RunQueueFeed, SteeringFeed, SteeringRegistrar};
-use crate::agent::queued_turn::{text_preview, QueuedTurn};
+use crate::agent::queued_turn::{QueuedTurn, text_preview};
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
diff --git a/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs b/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs
index f11d96cc02..20ea335348 100644
--- a/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs
@@ -5,12 +5,14 @@ fn a_poisoned_halt_summary_does_not_abort_stop_reporting() {
let slot: tinyagents_harness::turn_outcome::HaltSummarySlot =
Arc::new(std::sync::Mutex::new(None));
let poisoned = Arc::clone(&slot);
- assert!(std::thread::spawn(move || {
- let _guard = poisoned.lock().unwrap();
- panic!("synthetic prior writer failure");
- })
- .join()
- .is_err());
+ assert!(
+ std::thread::spawn(move || {
+ let _guard = poisoned.lock().unwrap();
+ panic!("synthetic prior writer failure");
+ })
+ .join()
+ .is_err()
+ );
record_halt_summary(
&slot,
&tinyagents_hooks::stop::StopReport {
diff --git a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
index 9cbd04df59..50592dde35 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
@@ -13,7 +13,7 @@ use tinyagents_harness::tool::{
};
use tinyagents_registry::{CapabilityRegistry, ComponentKind, RegistryDiagnostic};
use tinyagents_runtime::turn_driver::{SharedToolSet, ToolSetBuilder};
-use tinyagents_runtime::{project_descriptors, ToolAdmission};
+use tinyagents_runtime::{ToolAdmission, project_descriptors};
use tinyinference_llm::model::ChatModel;
use tinytools::ToolRunContext;
@@ -22,8 +22,8 @@ use crate::agent::orchestration::tools::{
ListSubagentsDispatch, SpawnAsyncSubagentDispatch, SpawnParallelAgentsDispatch,
SpawnSubagentDispatch, SpawnWorkerThreadDispatch, SteerSubagentDispatch, WaitSubagentDispatch,
};
-use crate::agent::tinyagents::host::run_context::HostOperationContext;
use crate::agent::tinyagents::host::OpenHumanRunContext;
+use crate::agent::tinyagents::host::run_context::HostOperationContext;
use crate::agent::tinyagents::turn_policy::is_subagent_spawn_or_delegate_tool;
use crate::agent::tinyagents::use_skill_dispatch::UseSkillDispatch;
use crate::agent::tools::{DelegateToolDispatch, TodoToolDispatch};
@@ -68,7 +68,7 @@ pub(crate) fn typed_dispatch_for(
_ => {
return DelegationDispatch::for_tool(adapter).map(|dispatch| {
Arc::new(dispatch) as Arc<dyn ToolDispatch<(), OpenHumanRunContext>>
- })
+ });
}
};
Some(dispatch)
diff --git a/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs b/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
index f86a4490ae..bf8a2ea9b2 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
@@ -46,7 +46,7 @@ fn threaded_turn_keeps_goal_tools_as_exposure_candidates() {
#[tokio::test]
async fn registered_memory_dispatch_enforces_one_budget_across_distinct_calls() {
use crate::memory::test_fixtures::{bind_reference, config_in};
- use tinyagents_harness::{context::RunConfig, CallId};
+ use tinyagents_harness::{CallId, context::RunConfig};
use tinytools::ToolCallOptions;
let workspace = tempfile::tempdir().unwrap();
let config = config_in(&workspace);
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
index 8833c57c57..ed2155d504 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
@@ -15,13 +15,13 @@ use std::sync::Arc;
use tinyagents_harness::cache::InMemoryResponseCache;
use tinyagents_harness::middleware::{
- install_unmet_deliverable, is_repeat_call_exempt, tool_sets_lookup, ResearchBudgetMiddleware,
- ShellTurnBudget, TurnClockMiddleware, DIRECT_WEB_READ_LIMIT,
+ ApprovalGateMiddleware, ArgRecoveryMiddleware, BudgetLimits, BudgetMiddleware,
+ ContextCompressionMiddleware, PromptCacheGuardMiddleware, RepeatProgressMiddleware,
+ RunModeHandle, ToolPolicyMiddleware as TaToolPolicyMiddleware, plan_mode_middleware,
};
use tinyagents_harness::middleware::{
- plan_mode_middleware, ApprovalGateMiddleware, ArgRecoveryMiddleware, BudgetLimits,
- BudgetMiddleware, ContextCompressionMiddleware, PromptCacheGuardMiddleware,
- RepeatProgressMiddleware, RunModeHandle, ToolPolicyMiddleware as TaToolPolicyMiddleware,
+ DIRECT_WEB_READ_LIMIT, ResearchBudgetMiddleware, ShellTurnBudget, TurnClockMiddleware,
+ install_unmet_deliverable, is_repeat_call_exempt, tool_sets_lookup,
};
use tinyagents_harness::runtime::AgentHarness;
use tinyagents_harness::steering::SteeringHandle;
@@ -244,7 +244,9 @@ pub(super) fn install_turn_middleware(
Arc::new(is_repeat_call_exempt),
)
.with_read_only(Arc::new(move |name: &str| read_only_tools.contains(name)))
- .with_cleared_placeholder(tinyagents_harness::middleware::library::DEFAULT_CLEARED_PLACEHOLDER),
+ .with_cleared_placeholder(
+ tinyagents_harness::middleware::library::DEFAULT_CLEARED_PLACEHOLDER,
+ ),
)
});
// Time awareness (#6953); before the repeat guard so its notes land last.
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs b/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
index 1b74b304e3..009b343a17 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
@@ -2,8 +2,8 @@
//! run policy a turn gets, and the model-call ceilings.
use super::*;
-use crate::agent::tinyagents::turn_models::TurnModels;
use crate::agent::tinyagents::TurnModelSource;
+use crate::agent::tinyagents::turn_models::TurnModels;
use async_trait::async_trait;
use tinyagents_harness::turn_policy::{
DEFAULT_MODEL_CALL_TIMEOUT_SECS, LOCAL_MODEL_CALL_TIMEOUT_SECS,
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index c6b5fc0566..d14a9b4055 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@ -8,8 +8,8 @@
use tinyagents_harness::runtime::RunPolicy;
use tinyagents_harness::turn_policy::{
- local_turn_backstop_secs, run_policy, turn_wall_clock_ms, TurnPolicyOptions,
- TurnPolicyOverrides,
+ TurnPolicyOptions, TurnPolicyOverrides, local_turn_backstop_secs, run_policy,
+ turn_wall_clock_ms,
};
use crate::agent::tinyagents::budget::MAX_SPAWN_DEPTH;
@@ -23,8 +23,8 @@ use crate::agent::tinyagents::budget::MAX_SPAWN_DEPTH;
pub(crate) struct ToolPolicyEnforcement {
pub policy: std::sync::Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
/// The session's channel-permission snapshot — enforces the per-channel
/// permission ceiling (deny + per-call permission-level gate) the in-house
@@ -49,7 +49,7 @@ pub(crate) struct ToolPolicyEnforcement {
/// endpoint host is loopback or on a private network.
/// - `openai:<model>` and every other cloud provider are never local.
pub(crate) fn provider_is_self_hosted(provider: &str, endpoint: Option<&str>) -> bool {
- use tinyinference_local::profile::{kind_from_provider_string, LocalProviderKind};
+ use tinyinference_local::profile::{LocalProviderKind, kind_from_provider_string};
let p = provider.trim().to_ascii_lowercase();
let Some(kind) = kind_from_provider_string(&p) else {
return false;
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_run_error.rs b/crates/openhuman-core/src/agent/tinyagents/turn_run_error.rs
index 04435a05d6..9f54400885 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_run_error.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_run_error.rs
@@ -2,7 +2,7 @@
//! caller expects, for [`TurnSpec::run`](TurnSpec::run).
use crate::agent::tinyagents::journal::TurnJournal;
-use tinyagents_harness::turn_run_error::{classify_run_failure, RunFailureKind};
+use tinyagents_harness::turn_run_error::{RunFailureKind, classify_run_failure};
use tinyinference_llm::model::ModelErrorSlot;
/// Map the harness's run failure `e` onto the typed error the turn caller
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs b/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
index 37babd04d5..32a2427711 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
@@ -18,8 +18,8 @@ use crate::agent::tinyagents::observability::{self, OpenhumanEventBridge, Subage
use crate::agent::tinyagents::turn_outcome::TinyagentsTurnOutcome;
use tinyagents_harness::turn_outcome::{HaltSummarySlot, ToolOutcomeSink};
use tinyagents_harness::turn_run_finalize::{
- classify_turn_end, log_compaction_provenance, select_turn_text, system_segment_bytes, TurnEnd,
- TurnEndInputs,
+ TurnEnd, TurnEndInputs, classify_turn_end, log_compaction_provenance, select_turn_text,
+ system_segment_bytes,
};
/// Assemble the [`TinyagentsTurnOutcome`] for a run that returned
@@ -163,8 +163,11 @@ pub(super) async fn finalize_turn_outcome(
// A run the harness stopped (breaker / cap) is traced as stopped, not as a
// clean completion. No deadline wind-down on this path: only the session
// turn carries one, and it records the stop through its sidecar.
- let stop =
- crate::agent::session_host::stop_summary::classify_stop(breaker_halt.as_deref(), false, hit_cap);
+ let stop = crate::agent::session_host::stop_summary::classify_stop(
+ breaker_halt.as_deref(),
+ false,
+ hit_cap,
+ );
if let Some(stop) = stop.as_ref().filter(|_| turn_completed_sink.is_some()) {
tracing::debug!(
model,
diff --git a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
index 2680a01bec..078f93e3a4 100644
--- a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
@@ -34,7 +34,7 @@ use tinytools::{Tool, ToolCallOptions, ToolResult};
use super::host::OpenHumanRunContext;
use super::tool_registration::typed_dispatch_for;
use crate::tools::toolpacks::registry::CATALOG;
-use tinyagents_harness::tool::packs::{named_tool, PackRegistryHandle};
+use tinyagents_harness::tool::packs::{PackRegistryHandle, named_tool};
/// Live-parent dispatch for the `use_skill` proxy tool.
///
diff --git a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs
index ba3102cf76..0d2131ff69 100644
--- a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch_tests.rs
@@ -14,16 +14,16 @@
//! that failure and is the fastest way to see these tests fail red.
use super::*;
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::harness::ParentExecutionContext;
use crate::agent::tinyagents::tool_registration::shared_tool_adapter;
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
use serde_json::json;
use std::path::Path;
use std::sync::Arc;
+use tinyagents_harness::CallId;
use tinyagents_harness::context::RunConfig;
use tinyagents_harness::tool::packs::{PackRegistryHandle, UseSkillTool};
-use tinyagents_harness::CallId;
use tinyinference_llm::message::Message;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
use tinytools::{Tool, ToolCallOptions, ToolResult};
diff --git a/crates/openhuman-core/src/agent/tools.rs b/crates/openhuman-core/src/agent/tools.rs
index 496b605e04..b28093683e 100644
--- a/crates/openhuman-core/src/agent/tools.rs
+++ b/crates/openhuman-core/src/agent/tools.rs
@@ -31,10 +31,10 @@ mod todo;
pub use delegate::DelegateTool;
pub(crate) use delegate::DelegateToolDispatch;
-pub use plan_exit::{PlanExitTool, PLAN_EXIT_MARKER};
+pub use plan_exit::{PLAN_EXIT_MARKER, PlanExitTool};
#[cfg(feature = "skills")]
pub use run_workflow::{
- AwaitWorkflowTool, RunWorkflowTool, AWAIT_WORKFLOW_TOOL_NAME, RUN_WORKFLOW_TOOL_NAME,
+ AWAIT_WORKFLOW_TOOL_NAME, AwaitWorkflowTool, RUN_WORKFLOW_TOOL_NAME, RunWorkflowTool,
};
pub use todo::TodoTool;
pub(crate) use todo::TodoToolDispatch;
diff --git a/crates/openhuman-core/src/agent/tools/delegate.rs b/crates/openhuman-core/src/agent/tools/delegate.rs
index 54a2a70a55..23c1fbbb7d 100644
--- a/crates/openhuman-core/src/agent/tools/delegate.rs
+++ b/crates/openhuman-core/src/agent/tools/delegate.rs
@@ -1,9 +1,9 @@
use crate::config::DelegateAgentConfig;
use crate::inference::provider::{
- OpenHumanBackendModel, ProviderRuntimeOptions, INFERENCE_BACKEND_ID,
+ INFERENCE_BACKEND_ID, OpenHumanBackendModel, ProviderRuntimeOptions,
};
-use crate::security::policy::ToolOperation;
use crate::security::SecurityPolicy;
+use crate::security::policy::ToolOperation;
use crate::tools::timeout::tool_execution_timeout_secs;
use async_trait::async_trait;
use serde_json::json;
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
index 03a63ed3f2..6facac3922 100644
--- a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
+++ b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
@@ -57,8 +57,10 @@ async fn plan_exit_does_not_flip_while_a_review_is_parked() {
// Resolve the parked review so the spawned task and the gate's
// bookkeeping don't leak past this test.
- assert!(crate::agent::plan_review::gate::global()
- .decide_by_thread(thread_id, PlanReviewResolution::Approve));
+ assert!(
+ crate::agent::plan_review::gate::global()
+ .decide_by_thread(thread_id, PlanReviewResolution::Approve)
+ );
let resolution = parked.await.unwrap();
assert_eq!(resolution, PlanReviewResolution::Approve);
diff --git a/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs b/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs
index 86f4899d05..728611aba4 100644
--- a/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs
+++ b/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs
@@ -183,7 +183,7 @@ fn account_spawn_trips_the_process_backstop() {
#[tokio::test]
async fn each_agent_owns_its_workflow_await_guard() {
use crate::core::runtime::agent_scope::test_agent_context;
- use crate::core::runtime::{context::CoreContext, DomainSet};
+ use crate::core::runtime::{DomainSet, context::CoreContext};
let root = CoreContext::for_test(DomainSet::full(), None);
let alpha = test_agent_context(&root, "alpha");
let beta = test_agent_context(&root, "beta");
diff --git a/crates/openhuman-core/src/agent/triage/escalation.rs b/crates/openhuman-core/src/agent/triage/escalation.rs
index 8cd9dcffe9..e3f2c71872 100644
--- a/crates/openhuman-core/src/agent/triage/escalation.rs
+++ b/crates/openhuman-core/src/agent/triage/escalation.rs
@@ -17,12 +17,12 @@
//! and tools.
use crate::core::runtime::DispatchCtx;
-use anyhow::{anyhow, Context};
+use anyhow::{Context, anyhow};
use crate::agent::harness::fork_context::ParentExecutionContext;
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::parent_context::build_root_parent;
use crate::agent::subagent_host::{self, SubagentRunOptions};
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::config::Config;
use super::decision::TriageAction;
diff --git a/crates/openhuman-core/src/agent/triage/escalation_tests.rs b/crates/openhuman-core/src/agent/triage/escalation_tests.rs
index 047c27ac91..2646be9529 100644
--- a/crates/openhuman-core/src/agent/triage/escalation_tests.rs
+++ b/crates/openhuman-core/src/agent/triage/escalation_tests.rs
@@ -2,7 +2,7 @@ use super::*;
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::core::events::DomainEvent;
use serde_json::json;
-use tokio::time::{sleep, timeout, Duration};
+use tokio::time::{Duration, sleep, timeout};
/// The triage parent is the shared root context with one override: nested
/// spawns scoped to the dispatched target. Guards the #4369 collapse against
diff --git a/crates/openhuman-core/src/agent/triage/evaluator.rs b/crates/openhuman-core/src/agent/triage/evaluator.rs
index da7e858490..8f9acd6f89 100644
--- a/crates/openhuman-core/src/agent/triage/evaluator.rs
+++ b/crates/openhuman-core/src/agent/triage/evaluator.rs
@@ -50,7 +50,7 @@ use super::routing::ResolvedProvider;
#[cfg(test)]
use crate::agent_registry::host_definition::AgentDefinition;
#[cfg(test)]
-pub(crate) use arm::{classify_error, ArmError};
+pub(crate) use arm::{ArmError, classify_error};
#[cfg(test)]
pub(crate) use chain::run_triage_with_arms_for_test;
#[cfg(test)]
diff --git a/crates/openhuman-core/src/agent/triage/evaluator/arm.rs b/crates/openhuman-core/src/agent/triage/evaluator/arm.rs
index af061401f9..0cc6d20252 100644
--- a/crates/openhuman-core/src/agent/triage/evaluator/arm.rs
+++ b/crates/openhuman-core/src/agent/triage/evaluator/arm.rs
@@ -7,7 +7,7 @@ use std::time::Instant;
use anyhow::anyhow;
-use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, AGENT_RUN_TURN_METHOD};
+use crate::agent::bus::{AGENT_RUN_TURN_METHOD, AgentTurnRequest, AgentTurnResponse};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::config::MultimodalConfig;
use crate::core::bus::BUS;
@@ -16,7 +16,7 @@ use crate::inference::provider::error_classify::{
};
use tinyagents_session::transcript::TranscriptMessage;
use tinybus::NativeRequestError;
-use tinyinference_providers::{is_budget_message, BudgetMatch};
+use tinyinference_providers::{BudgetMatch, is_budget_message};
use super::super::decision::parse_triage_decision;
use super::super::envelope::TriggerEnvelope;
diff --git a/crates/openhuman-core/src/agent/triage/evaluator/chain.rs b/crates/openhuman-core/src/agent/triage/evaluator/chain.rs
index eaddf49189..fbdce280ac 100644
--- a/crates/openhuman-core/src/agent/triage/evaluator/chain.rs
+++ b/crates/openhuman-core/src/agent/triage/evaluator/chain.rs
@@ -13,9 +13,9 @@ use crate::cron::scheduler_gate::LlmPermit;
use super::super::envelope::TriggerEnvelope;
use super::super::events;
use super::super::routing::{
- build_local_provider_with_config, resolve_provider_with_config, ResolvedProvider,
+ ResolvedProvider, build_local_provider_with_config, resolve_provider_with_config,
};
-use super::arm::{try_arm, ArmError};
+use super::arm::{ArmError, try_arm};
use super::outcome::{TriageOutcome, TriageResolutionPath};
/// Cap on how long to wait for a server-supplied `Retry-After` before
diff --git a/crates/openhuman-core/src/agent/triage/evaluator_tests.rs b/crates/openhuman-core/src/agent/triage/evaluator_tests.rs
index 73362786e3..4d7f531044 100644
--- a/crates/openhuman-core/src/agent/triage/evaluator_tests.rs
+++ b/crates/openhuman-core/src/agent/triage/evaluator_tests.rs
@@ -1,10 +1,10 @@
use super::*;
-use crate::agent::bus::{mock_agent_run_turn, AgentTurnResponse};
-use crate::agent_registry::host_definition::AgentDefinitionRegistry;
+use crate::agent::bus::{AgentTurnResponse, mock_agent_run_turn};
use crate::agent_registry::agents::BUILTINS;
+use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use serde_json::json;
-use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc as StdArc;
+use std::sync::atomic::{AtomicUsize, Ordering};
fn arm_error_label(err: &ArmError) -> &'static str {
match err {
diff --git a/crates/openhuman-core/src/agent/triage/events_tests.rs b/crates/openhuman-core/src/agent/triage/events_tests.rs
index 73710decca..3a80105b82 100644
--- a/crates/openhuman-core/src/agent/triage/events_tests.rs
+++ b/crates/openhuman-core/src/agent/triage/events_tests.rs
@@ -4,7 +4,7 @@ use crate::core::events::DomainEvent;
use serde_json::json;
use std::sync::Arc;
use tokio::sync::Mutex;
-use tokio::time::{sleep, Duration};
+use tokio::time::{Duration, sleep};
#[tokio::test]
async fn publish_helpers_emit_expected_trigger_events() {
diff --git a/crates/openhuman-core/src/agent/triage/mod.rs b/crates/openhuman-core/src/agent/triage/mod.rs
index 4ca6526f46..8182919e3b 100644
--- a/crates/openhuman-core/src/agent/triage/mod.rs
+++ b/crates/openhuman-core/src/agent/triage/mod.rs
@@ -39,9 +39,9 @@ pub mod events;
pub mod origin;
pub mod routing;
-pub use decision::{parse_triage_decision, ParseError, TriageAction, TriageDecision};
+pub use decision::{ParseError, TriageAction, TriageDecision, parse_triage_decision};
pub use envelope::{TriggerEnvelope, TriggerSource};
pub use escalation::apply_decision;
-pub use evaluator::{run_triage, TriageOutcome, TriageResolutionPath, TriageRun};
+pub use evaluator::{TriageOutcome, TriageResolutionPath, TriageRun, run_triage};
pub use origin::{local_trigger_origin, remote_trigger_origin};
-pub use routing::{build_local_provider_with_config, ResolvedProvider};
+pub use routing::{ResolvedProvider, build_local_provider_with_config};
diff --git a/crates/openhuman-core/src/agent/triage/routing.rs b/crates/openhuman-core/src/agent/triage/routing.rs
index 0af967f254..993405bf93 100644
--- a/crates/openhuman-core/src/agent/triage/routing.rs
+++ b/crates/openhuman-core/src/agent/triage/routing.rs
@@ -141,7 +141,7 @@ fn build_remote_provider(
config: &Config,
) -> anyhow::Result<ResolvedProvider> {
use crate::inference::provider::factory::{
- create_chat_model_from_string_with_model_id, PROVIDER_OPENHUMAN,
+ PROVIDER_OPENHUMAN, create_chat_model_from_string_with_model_id,
};
use tinyinference_local::profile::is_local_provider_string;
diff --git a/crates/openhuman-core/src/agent/turn_origin_tests.rs b/crates/openhuman-core/src/agent/turn_origin_tests.rs
index dae8a7724f..985d2e3825 100644
--- a/crates/openhuman-core/src/agent/turn_origin_tests.rs
+++ b/crates/openhuman-core/src/agent/turn_origin_tests.rs
@@ -353,7 +353,7 @@ struct StateProbe;
/// `scoped` answer as they do when nothing is scoped.
#[tokio::test]
async fn a_bare_origin_scope_is_invisible_to_every_other_reader() {
- use crate::core::runtime::{slot_for, CoreContext, DispatchCtx};
+ use crate::core::runtime::{CoreContext, DispatchCtx, slot_for};
let outside_slot = slot_for::<StateProbe>(&DispatchCtx::ambient());
let outside_current = CoreContext::current();
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index 25db29de75..18334eca01 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -12,8 +12,8 @@ use std::{
use serde_json::{Map, Value};
-use crate::core::runtime::DispatchCtx;
use crate::core::ControllerSchema;
+use crate::core::runtime::DispatchCtx;
/// A pinned, boxed future returned by a controller handler.
pub type ControllerFuture = Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'static>>;
@@ -804,12 +804,14 @@ pub fn namespace_description(namespace: &str) -> Option<&'static str> {
"agent" => Some("Per-thread agent run-mode control (Plan vs Build)."),
"ai" => Some("Agent-generated artifact storage, retrieval, and lifecycle management."),
"app_state" => Some("Expose core-owned app shell state for frontend polling."),
- "profiles" => Some("SaaS operator plane: provision and inspect the profile serving each user."),
+ "profiles" => {
+ Some("SaaS operator plane: provision and inspect the profile serving each user.")
+ }
"auth" => Some("Manage app session and provider credentials."),
"agent_experience" => Some("Local procedural experience capture and retrieval for agents."),
"channels" => Some("Channel definitions, connections, and lifecycle management."),
"composio" => Some(
- "Composio OAuth integrations proxied via the backend — toolkits, connections, tools, and actions."
+ "Composio OAuth integrations proxied via the backend — toolkits, connections, tools, and actions.",
),
"config" => Some("Read and update persisted runtime configuration."),
"connectivity" => Some(
@@ -817,9 +819,9 @@ pub fn namespace_description(namespace: &str) -> Option<&'static str> {
),
"cron" => Some("Manage scheduled jobs and run history."),
"flows" => Some("Create, store, and run automation workflows."),
- "dashboard" => Some(
- "Operator-facing dashboard aggregations: per-model health comparison rows.",
- ),
+ "dashboard" => {
+ Some("Operator-facing dashboard aggregations: per-model health comparison rows.")
+ }
"mcp_clients" => Some(
"Browse the MCP registries, declare the user's servers in one mcp.json document, manage their connections and credentials, and expose their tools to the agent.",
),
@@ -831,16 +833,26 @@ pub fn namespace_description(namespace: &str) -> Option<&'static str> {
),
"encrypt" => Some("Encrypt secure values managed by secret storage."),
"health" => Some("Process and component health snapshots."),
- "inference" => Some("Connect to configured text, vision, and embedding inference runtimes."),
- "javascript" => Some("First-class JavaScript runtime bridge for listing and dispatching tools."),
+ "inference" => {
+ Some("Connect to configured text, vision, and embedding inference runtimes.")
+ }
+ "javascript" => {
+ Some("First-class JavaScript runtime bridge for listing and dispatching tools.")
+ }
"security" => Some("Security policy and autonomy guardrail metadata."),
"service" => Some("Desktop service lifecycle management."),
"session_import" => {
Some("One-time import of legacy session transcripts into TinyAgents stores.")
}
- "skill_registry" => Some("Browse, search, install, and uninstall skills from remote registries (OpenHuman, Hermes, OpenClaw)."),
- "skill_runtime" => Some("Run installed skills, inspect run logs, and resolve Node/Python skill runtimes."),
- "skills" => Some("Discovered SKILL.md skills (discovery, parse, install, run) and their resources."),
+ "skill_registry" => Some(
+ "Browse, search, install, and uninstall skills from remote registries (OpenHuman, Hermes, OpenClaw).",
+ ),
+ "skill_runtime" => {
+ Some("Run installed skills, inspect run logs, and resolve Node/Python skill runtimes.")
+ }
+ "skills" => {
+ Some("Discovered SKILL.md skills (discovery, parse, install, run) and their resources.")
+ }
"socket" => Some("Backend Socket.IO bridge controls."),
"memory" => Some(
"Memory v2: engine selection, recall, fetch, learn, forget, conversations, document sources, context.md and v1 import.",
@@ -860,16 +872,18 @@ pub fn namespace_description(namespace: &str) -> Option<&'static str> {
"tool_registry" => Some(
"Read-only discovery for MCP stdio tools and controller-backed tools, including routes, schemas, version, allowed agents, and health.",
),
- "test" => Some(
- "E2E test support — wipe sidecar state in-place between specs.",
- ),
- "wallet" => Some("Local wallet onboarding status and derived multi-chain account metadata."),
+ "test" => Some("E2E test support — wipe sidecar state in-place between specs."),
+ "wallet" => {
+ Some("Local wallet onboarding status and derived multi-chain account metadata.")
+ }
"web3_swap" => Some("Single-chain crypto swaps via deBridge, built on the local wallet."),
- "web3_bridge" => Some("Cross-chain crypto bridges via deBridge DLN, built on the local wallet."),
+ "web3_bridge" => {
+ Some("Cross-chain crypto bridges via deBridge DLN, built on the local wallet.")
+ }
"web3_dapp" => Some("Generic EVM dapp contract calls signed by the local wallet."),
- "provider_surfaces" => Some(
- "Local-first assistive surfaces for provider events, respond queues, and drafts.",
- ),
+ "provider_surfaces" => {
+ Some("Local-first assistive surfaces for provider events, respond queues, and drafts.")
+ }
"voice" => Some("Speech-to-text and text-to-speech using local models."),
"webhooks" => {
Some("Webhook tunnel registrations and captured request/response debug logs.")
diff --git a/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs b/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs
index 16c958cdcb..981bc9cb19 100644
--- a/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs
+++ b/crates/openhuman-core/src/core/all_dispatch_ctx_tests.rs
@@ -1,6 +1,6 @@
//! The dispatch context reaches the handler as an argument, per call.
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
use super::*;
use crate::core::runtime::{CoreContext, DispatchCtx, DomainSet};
diff --git a/crates/openhuman-core/src/core/all_extensions_tests.rs b/crates/openhuman-core/src/core/all_extensions_tests.rs
index b77961284f..7626dfc05b 100644
--- a/crates/openhuman-core/src/core/all_extensions_tests.rs
+++ b/crates/openhuman-core/src/core/all_extensions_tests.rs
@@ -31,9 +31,11 @@ async fn registry_extension_is_visible_to_every_lookup_and_dispatches() {
Some("openhuman.ext_probe_ping")
);
assert!(schema_for_rpc_method("openhuman.ext_probe_ping").is_some());
- assert!(all_controller_schemas()
- .iter()
- .any(|s| s.namespace == "ext_probe" && s.function == "ping"));
+ assert!(
+ all_controller_schemas()
+ .iter()
+ .any(|s| s.namespace == "ext_probe" && s.function == "ping")
+ );
assert_eq!(
namespace_description("ext_probe"),
Some("Registry extension probe.")
diff --git a/crates/openhuman-core/src/core/all_invoke.rs b/crates/openhuman-core/src/core/all_invoke.rs
index e4ac7f3f12..53ebd1815e 100644
--- a/crates/openhuman-core/src/core/all_invoke.rs
+++ b/crates/openhuman-core/src/core/all_invoke.rs
@@ -5,7 +5,7 @@ use std::pin::Pin;
use serde_json::{Map, Value};
-use super::{internal_registry, registry_view, visible, ControllerFuture};
+use super::{ControllerFuture, internal_registry, registry_view, visible};
use crate::core::runtime::{CoreContext, DispatchCtx};
type Dispatched = Pin<Box<dyn Future<Output = Option<Result<Value, String>>> + Send + 'static>>;
diff --git a/crates/openhuman-core/src/core/all_tests.rs b/crates/openhuman-core/src/core/all_tests.rs
index 4d2de52e23..b5c819e546 100644
--- a/crates/openhuman-core/src/core/all_tests.rs
+++ b/crates/openhuman-core/src/core/all_tests.rs
@@ -856,8 +856,8 @@ fn every_registered_controller_has_matching_declared_schema() {
// --- DomainSet registration filter (#4796) ------------------------------
-use crate::core::runtime::context::CoreContext;
use crate::core::runtime::DomainSet;
+use crate::core::runtime::context::CoreContext;
/// The [`DomainGroup`] a registered controller (agent-facing OR internal) is
/// tagged with, looked up by its namespace. Test-only helper over the private
diff --git a/crates/openhuman-core/src/inference/host_runtime/schemas.rs b/crates/openhuman-core/src/inference/host_runtime/schemas.rs
index 8c91880ca9..0c493deb5c 100644
--- a/crates/openhuman-core/src/inference/host_runtime/schemas.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/schemas.rs
@@ -1,6 +1,6 @@
use crate::core::runtime::DispatchCtx;
-use serde::de::DeserializeOwned;
use serde::Deserialize;
+use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
#[derive(Debug, Deserialize)]
@@ -8,8 +8,8 @@ struct LocalAiTestConnectionParams {
url: String,
}
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Params for `inference.agent_chat` and `inference.agent_chat_simple`.