Skip to content

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

chore: apply rustfmt import ordering and line wrapping

Steven Enamakelea9dd450ea99
diff --git a/crates/openhuman-core/src/agent/orchestration/delegation.rs b/crates/openhuman-core/src/agent/orchestration/delegation.rs
index 6792108ff5..45da5d8675 100644
--- a/crates/openhuman-core/src/agent/orchestration/delegation.rs
+++ b/crates/openhuman-core/src/agent/orchestration/delegation.rs
@@ -12,7 +12,7 @@
use std::sync::Arc;
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunStatus, run_subagent_via_driver_tool,
+ run_subagent_via_driver_tool, SubagentRunOptions, SubagentRunStatus,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent_registry::host_definition::AgentDefinition;
diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rs
index 3bae647345..4a2ddcccaf 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs
@@ -27,7 +27,7 @@ use super::types::{
};
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::subagent_host::{
- SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent,
+ run_subagent, SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
};
use crate::agent::tinyagents::host::steering::shared_steering_registry;
use crate::agent_registry::host_definition::{AgentDefinition, AgentDefinitionRegistry};
@@ -37,8 +37,8 @@ use crate::progress::AgentProgress;
use std::collections::BTreeMap;
use std::sync::Arc;
use thiserror::Error;
-use tinyagents_harness::CancellationToken;
use tinyagents_harness::ids::TaskId;
+use tinyagents_harness::CancellationToken;
use tinyagents_tasks::{
DetachedTaskRegistry, DetachedTaskRegistryError, DetachedTaskWaitOutcome,
OrchestrationTaskStatus,
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
index bd0a6fdb84..29938a8b79 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
@@ -65,14 +65,14 @@ mod tests;
#[cfg(test)]
pub(crate) use cancel::prune;
#[cfg(test)]
-pub(crate) use cancel::{CallerWorkspace, caller_workspace_in};
+pub(crate) use cancel::{caller_workspace_in, CallerWorkspace};
pub(crate) use cancel::{
- CancelledSubagent, cancel_all, cancel_by_session_in_workspace, cancel_by_task,
- cancel_for_thread, stop_for_thread,
+ cancel_all, cancel_by_session_in_workspace, cancel_by_task, cancel_for_thread, stop_for_thread,
+ CancelledSubagent,
};
pub(crate) use registry::admit_spawn;
#[cfg(test)]
-pub(crate) use registry::{RegistrationError, register, status_channel};
+pub(crate) use registry::{register, status_channel, RegistrationError};
pub(crate) use roster::active_subagents_context_block;
#[cfg(test)]
pub(crate) use steering::steer;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
index c0d2a4c25f..edbb8e5326 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs
@@ -28,14 +28,14 @@ use tokio::sync::watch;
use tokio::task::AbortHandle;
use crate::agent::tinyagents::host::steering::shared_steering_registry;
-use tinyagents_harness::CancellationToken;
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::run_queue::RunQueue;
+use tinyagents_harness::CancellationToken;
use tinyagents_tasks::DetachedTaskRegistry;
use super::task_ledger::{record_spawned, task_store_for_workspace};
use tinyagents_orchestration::subagent::{
- DetachedSubagentStatus, SubagentIdentity, WaitError, spawn_status_watcher,
+ spawn_status_watcher, DetachedSubagentStatus, SubagentIdentity, WaitError,
};
#[derive(Clone)]
@@ -138,8 +138,8 @@ const REGISTRY_SOFT_CAP: usize = 256;
static REGISTRY: OnceLock<DetachedTaskRegistry<RunningSubagentMetadata, DetachedSubagentStatus>> =
OnceLock::new();
-pub(crate) fn registry()
--> &'static DetachedTaskRegistry<RunningSubagentMetadata, DetachedSubagentStatus> {
+pub(crate) fn registry(
+) -> &'static DetachedTaskRegistry<RunningSubagentMetadata, DetachedSubagentStatus> {
REGISTRY.get_or_init(|| {
DetachedTaskRegistry::new(
shared_steering_registry().clone(),
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
index 04608bd842..6f9264bd0e 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
@@ -6,8 +6,9 @@
use std::path::Path;
use tinyagents_orchestration::subagent::{
- SubagentResumeRef, WaitError, resume_ref_for_task as live_resume_ref, resume_ref_from_record,
- task_id_for_session as live_task_id, task_id_for_session_in_records,
+ resume_ref_for_task as live_resume_ref, resume_ref_from_record,
+ task_id_for_session as live_task_id, task_id_for_session_in_records, SubagentResumeRef,
+ WaitError,
};
use super::registry::{admit_workspace, owner_key, registry};
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs
index 65a69b7f4f..6d3ad37e94 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/roster.rs
@@ -1,7 +1,7 @@
//! Read-only rosters over the sub-agent registry: the durable+live merge used to render the
//! `[active_subagents]` context block.
-use tinyagents_orchestration::subagent::{SubagentSnapshot, snapshot_for_owner};
+use tinyagents_orchestration::subagent::{snapshot_for_owner, SubagentSnapshot};
use super::registry::{admit_workspace, owner_key, registry};
use crate::agent::orchestration::fleet_tools::FleetToolSet;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
index 83b615775d..a696ed18d8 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
@@ -2,7 +2,7 @@
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::run_queue::QueueLane;
-use tinyagents_orchestration::subagent::{SteerAccess, SteerError, steer_detached};
+use tinyagents_orchestration::subagent::{steer_detached, SteerAccess, SteerError};
use super::cancel::now_ms;
use super::registry::{control_admits, owner_key, registry};
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs
index 72446611f9..ffec82d723 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs
@@ -11,13 +11,13 @@ use std::path::{Path, PathBuf};
use std::sync::{Arc, OnceLock};
use tinyagents_orchestration::subagent::{
- SpawnedSubagent, WaitError, list_subagent_records, orphaned_subagent_reason, record_agent_id,
+ list_subagent_records, orphaned_subagent_reason, record_agent_id,
record_cancelled as ledger_cancelled, record_parent_session, record_spawned as ledger_spawned,
- subagent_record_for_task, task_status_label,
+ subagent_record_for_task, task_status_label, SpawnedSubagent, WaitError,
};
use tinyagents_tasks::{
- DriverTaskStore, InMemoryTaskStore, OrchestrationTaskFilter, OrchestrationTaskRecord,
- TaskStore, TaskStoreRegistry, reconcile_orphaned_tasks,
+ reconcile_orphaned_tasks, DriverTaskStore, InMemoryTaskStore, OrchestrationTaskFilter,
+ OrchestrationTaskRecord, TaskStore, TaskStoreRegistry,
};
#[cfg(test)]
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs
index 15e8f92e3d..c1c4a74133 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs
@@ -6,7 +6,7 @@ use std::path::Path;
use std::time::Duration;
use tinyagents_orchestration::subagent::{
- WaitError, WaitOutcome, record_to_wait_outcome, task_status_label, wait_detached,
+ record_to_wait_outcome, task_status_label, wait_detached, WaitError, WaitOutcome,
};
use super::registry::{admit_workspace, owner_key, registry};
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 2a6ca43fa8..40716203c6 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
@@ -584,11 +584,9 @@ async fn saas_controls_follow_the_explicit_context_not_the_tasks_scope() {
Err(SteerError::NotOwned)
);
assert_eq!(pair.a.queue.status().await.steers, 0);
- assert!(
- snapshot_for_parent(&bob, PARENT)
- .iter()
- .all(|worker| worker.task_id != a_task)
- );
+ assert!(snapshot_for_parent(&bob, PARENT)
+ .iter()
+ .all(|worker| worker.task_id != a_task));
assert!(
cancel_by_task(&alice, &b_task).is_none(),
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
index 443acd3940..3b3b14b550 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -21,7 +21,7 @@ use tinyagents_harness::run_queue::{QueueLane, RunQueue};
use tinyagents_harness::steering::{SteeringCommand, SteeringHandle};
use tinyagents_orchestration::subagent::FinishedOutcome;
use tinyagents_orchestration::subagent::{
- DETACHED_LEDGER_TIMEOUT_MS, DetachedSubagentStatus, WaitError, WaitOutcome,
+ DetachedSubagentStatus, WaitError, WaitOutcome, DETACHED_LEDGER_TIMEOUT_MS,
};
use tinyagents_tasks::OrchestrationTaskStatus;
use tokio::sync::watch;
@@ -281,15 +281,13 @@ async fn snapshot_and_block_scope_to_parent_and_reflect_live_status() {
assert!(block.ends_with("[/active_subagents]\n\n"));
// A parent with no registered workers gets no block (no perturbation).
- assert!(
- active_subagents_context_block(
- &cx(),
- "nobody-here",
- &test_workspace(),
- &FleetToolSet::all()
- )
- .is_none()
- );
+ assert!(active_subagents_context_block(
+ &cx(),
+ "nobody-here",
+ &test_workspace(),
+ &FleetToolSet::all()
+ )
+ .is_none());
// The shipped orchestrator has no wait/steer/close tools (#5701): the
// guidance must not name them and must say results arrive on their own.
@@ -371,15 +369,13 @@ async fn snapshot_and_block_scope_to_parent_and_reflect_live_status() {
assert!(block.contains("status=idle"));
assert!(block.contains("about: Daily X trending email workflow"));
// Other parents' durable sessions must not leak in.
- assert!(
- active_subagents_context_block(
- &cx(),
- "unrelated-parent",
- durable_ws.path(),
- &FleetToolSet::all()
- )
- .is_none()
- );
+ assert!(active_subagents_context_block(
+ &cx(),
+ "unrelated-parent",
+ durable_ws.path(),
+ &FleetToolSet::all()
+ )
+ .is_none());
}
let _ = tx_a.send(DetachedSubagentStatus::Completed {
@@ -528,17 +524,15 @@ async fn wait_times_out_and_leaves_entry_intact() {
));
// still steerable after a timed-out wait
- assert!(
- steer(
- &cx(),
- "task-slow",
- "session-A",
- "still here".into(),
- QueueLane::Steer
- )
- .await
- .is_ok()
- );
+ assert!(steer(
+ &cx(),
+ "task-slow",
+ "session-A",
+ "still here".into(),
+ QueueLane::Steer
+ )
+ .await
+ .is_ok());
prune("task-slow");
}
@@ -586,17 +580,15 @@ async fn cancel_for_thread_aborts_only_matching_entries() {
.await
.is_ok()
);
- assert!(
- steer(
- &cx(),
- "task-headless",
- "session-A",
- "x".into(),
- QueueLane::Steer
- )
- .await
- .is_ok()
- );
+ assert!(steer(
+ &cx(),
+ "task-headless",
+ "session-A",
+ "x".into(),
+ QueueLane::Steer
+ )
+ .await
+ .is_ok());
// Idempotent: a second pass cancels nothing.
assert_eq!(cancel_for_thread(&cx(), "thread-X"), 0);
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
index 8575b30140..a37b01d582 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
@@ -6,10 +6,10 @@
use std::path::PathBuf;
use tinyagents_harness::CancellationToken;
-use tinyagents_orchestration::parallel::{Worker, resolve_concurrency, run};
+use tinyagents_orchestration::parallel::{resolve_concurrency, run, Worker};
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
+ run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
};
use super::types::{ParallelAgentResult, ParallelAgentStatus, SpawnParallelWorker};
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
index ed9c81e07f..eea15c284e 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
@@ -106,51 +106,43 @@ fn stale_completion_cannot_overwrite_reused_or_closed_session() {
.unwrap();
assert_eq!(first.subagent_session_id, second.subagent_session_id);
- assert!(
- mark_finished(
- &store,
- &second.subagent_session_id,
- "first-task",
- &SubagentRunStatus::Completed,
- vec![TranscriptMessage::user("stale")],
- )
- .is_err()
- );
+ assert!(mark_finished(
+ &store,
+ &second.subagent_session_id,
+ "first-task",
+ &SubagentRunStatus::Completed,
+ vec![TranscriptMessage::user("stale")],
+ )
+ .is_err());
let current = store.load().unwrap().remove(0);
assert_eq!(current.current_task_id.as_deref(), Some("second-task"));
assert_eq!(current.status, DurableSubagentStatus::Running);
assert!(current.latest_history.is_none());
- assert!(
- mark_failed(
- &store,
- &second.subagent_session_id,
- "first-task",
- "stale failure".into(),
- )
- .is_err()
- );
+ assert!(mark_failed(
+ &store,
+ &second.subagent_session_id,
+ "first-task",
+ "stale failure".into(),
+ )
+ .is_err());
assert!(store.load().unwrap()[0].latest_error.is_none());
close(&store, &second.subagent_session_id).unwrap();
- assert!(
- mark_finished(
- &store,
- &second.subagent_session_id,
- "second-task",
- &SubagentRunStatus::Completed,
- vec![TranscriptMessage::user("late after close")],
- )
- .is_err()
- );
- assert!(
- mark_failed(
- &store,
- &second.subagent_session_id,
- "second-task",
- "late failure".into(),
- )
- .is_err()
- );
+ assert!(mark_finished(
+ &store,
+ &second.subagent_session_id,
+ "second-task",
+ &SubagentRunStatus::Completed,
+ vec![TranscriptMessage::user("late after close")],
+ )
+ .is_err());
+ assert!(mark_failed(
+ &store,
+ &second.subagent_session_id,
+ "second-task",
+ "late failure".into(),
+ )
+ .is_err());
let closed = store.load().unwrap().remove(0);
assert_eq!(closed.status, DurableSubagentStatus::Closed);
assert!(closed.latest_history.is_none());
@@ -295,16 +287,14 @@ fn upsert_persists_the_full_lifecycle_key_without_collapsing_to_task_id() {
)
.unwrap();
assert_eq!(resolved, key);
- assert!(
- resolve_lifecycle_key(
- &store,
- &session.subagent_session_id,
- "another-parent",
- Some("thread-a"),
- dir.path(),
- )
- .is_err()
- );
+ assert!(resolve_lifecycle_key(
+ &store,
+ &session.subagent_session_id,
+ "another-parent",
+ Some("thread-a"),
+ dir.path(),
+ )
+ .is_err());
}
#[test]
@@ -365,14 +355,12 @@ fn list_for_parent_without_thread_id_does_not_filter_by_thread() {
let all = list_for_parent(&store, "parent-a", None).unwrap();
assert_eq!(all.len(), 2);
- assert!(
- all.iter()
- .any(|session| session.subagent_session_id == first.subagent_session_id)
- );
- assert!(
- all.iter()
- .any(|session| session.subagent_session_id == second.subagent_session_id)
- );
+ assert!(all
+ .iter()
+ .any(|session| session.subagent_session_id == first.subagent_session_id));
+ assert!(all
+ .iter()
+ .any(|session| session.subagent_session_id == second.subagent_session_id));
let thread_a = list_for_parent(&store, "parent-a", Some("thread-a")).unwrap();
assert_eq!(thread_a.len(), 1);
@@ -383,16 +371,14 @@ fn list_for_parent_without_thread_id_does_not_filter_by_thread() {
fn missing_session_updates_return_errors() {
let dir = tempfile::tempdir().unwrap();
let store = SubagentSessionStore::new(dir.path().to_path_buf());
- assert!(
- mark_finished(
- &store,
- "missing",
- "sub-1",
- &SubagentRunStatus::Completed,
- vec![]
- )
- .is_err()
- );
+ assert!(mark_finished(
+ &store,
+ "missing",
+ "sub-1",
+ &SubagentRunStatus::Completed,
+ vec![]
+ )
+ .is_err());
assert!(mark_failed(&store, "missing", "sub-1", "boom".into()).is_err());
assert!(!close(&store, "missing").unwrap());
}
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
index 0cf5de3a91..445c93f1b8 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
@@ -24,8 +24,8 @@ use serde_json::Value;
use tinystoragedrivers::{CollectionSpec, Precondition, Query, Sort};
use super::types::DurableSubagentSession;
-use crate::storage::DocumentStoreExt;
use crate::storage::documents::Repo;
+use crate::storage::DocumentStoreExt;
const SESSIONS: &str = "subagent_sessions";
/// Holds the marker document that records the one-time legacy file import, in
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
index dcd62a85ba..6998431619 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
@@ -35,12 +35,10 @@ fn session(id: &str) -> DurableSubagentSession {
#[test]
fn a_missing_list_loads_empty() {
- assert!(
- docs_in(&MemoryStorage::new(), "local")
- .load()
- .unwrap()
- .is_empty()
- );
+ assert!(docs_in(&MemoryStorage::new(), "local")
+ .load()
+ .unwrap()
+ .is_empty());
}
#[test]
@@ -83,11 +81,10 @@ fn the_store_uses_the_workspace_default_with_no_backend_installed() {
store.save(&[session("a")]).unwrap();
assert_eq!(store.load().unwrap().len(), 1);
// No JSON file store: the records are in the workspace's own database.
- assert!(
- !dir.path()
- .join(".openhuman/subagent_sessions.json")
- .exists()
- );
+ assert!(!dir
+ .path()
+ .join(".openhuman/subagent_sessions.json")
+ .exists());
assert!(dir.path().join("storage").exists());
}
@@ -120,11 +117,10 @@ fn the_store_dispatches_to_documents_when_a_backend_is_pinned() {
assert_eq!(store.load().unwrap().len(), 1);
});
assert_eq!(docs.load().unwrap().len(), 1);
- assert!(
- !dir.path()
- .join(".openhuman/subagent_sessions.json")
- .exists()
- );
+ assert!(!dir
+ .path()
+ .join(".openhuman/subagent_sessions.json")
+ .exists());
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
index e1f0e3ecd6..2ff2a91bf5 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/tiny_port_tests.rs
@@ -39,18 +39,16 @@ async fn old_rows_without_checkpoint_identity_remain_readable_without_fabricated
assert_eq!(sessions[0].subagent_session_id, "legacy-session");
assert_eq!(sessions[0].current_task_id.as_deref(), Some("legacy-task"));
assert!(sessions[0].lifecycle_key.is_none());
- assert!(
- port.list_for_parent("foreign-owner", Some("thread"))
- .await
- .unwrap()
- .is_empty()
- );
- assert!(
- port.list_for_parent("owner", Some("other-thread"))
- .await
- .unwrap()
- .is_empty()
- );
+ assert!(port
+ .list_for_parent("foreign-owner", Some("thread"))
+ .await
+ .unwrap()
+ .is_empty());
+ assert!(port
+ .list_for_parent("owner", Some("other-thread"))
+ .await
+ .unwrap()
+ .is_empty());
assert_eq!(port.list_for_parent("owner", None).await.unwrap().len(), 1);
assert!(port.get("legacy-session").await.unwrap().is_some());
let other_thread = OpenHumanTinySubagentSessionStore::new(
@@ -97,12 +95,11 @@ async fn unthreaded_port_lists_only_unthreaded_rows() {
let sessions = port.list_for_parent("owner", None).await.unwrap();
assert_eq!(sessions.len(), 1);
assert_eq!(sessions[0].subagent_session_id, "unthreaded-session");
- assert!(
- port.list_for_parent("owner", Some("thread-a"))
- .await
- .unwrap()
- .is_empty()
- );
+ assert!(port
+ .list_for_parent("owner", Some("thread-a"))
+ .await
+ .unwrap()
+ .is_empty());
}
#[tokio::test]
@@ -207,41 +204,37 @@ async fn upsert_rejects_a_selector_or_lifecycle_key_outside_bound_scope() {
}
};
- assert!(
- port.upsert_running(upsert(
+ assert!(port
+ .upsert_running(upsert(
"foreign",
Some("thread-a"),
key(Some("thread-a"), "task-1")
))
.await
- .is_err()
- );
- assert!(
- port.upsert_running(upsert(
+ .is_err());
+ assert!(port
+ .upsert_running(upsert(
"owner",
Some("thread-b"),
key(Some("thread-b"), "task-1")
))
.await
- .is_err()
- );
- assert!(
- port.upsert_running(upsert(
+ .is_err());
+ assert!(port
+ .upsert_running(upsert(
"owner",
Some("thread-a"),
key(Some("thread-b"), "task-1")
))
.await
- .is_err()
- );
- assert!(
- port.upsert_running(upsert(
+ .is_err());
+ assert!(port
+ .upsert_running(upsert(
"owner",
Some("thread-a"),
key(Some("thread-a"), "other-task")
))
.await
- .is_err()
- );
+ .is_err());
assert!(store.load().unwrap().is_empty());
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools.rs b/crates/openhuman-core/src/agent/orchestration/tools.rs
index d71ddd104d..67b81f2222 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools.rs
@@ -45,10 +45,10 @@ mod tools_e2e_tests;
pub(crate) use dispatch::DelegationDispatch;
pub(crate) use subagent_control_surfaces::overlay_task_store_status;
pub(crate) use subagent_control_surfaces::{
- CloseSubagentTool, ListSubagentsTool, SteerSubagentTool, WaitSubagentTool,
+ format_running_wait_message, requested_timeout_secs, wait_status_payload,
};
pub(crate) use subagent_control_surfaces::{
- format_running_wait_message, requested_timeout_secs, wait_status_payload,
+ CloseSubagentTool, ListSubagentsTool, SteerSubagentTool, WaitSubagentTool,
};
/// A minimal live TinyAgents carrier over `parent`, for tests that drive a
@@ -67,13 +67,13 @@ pub(crate) fn live_parent_run_context(
}
pub use archetype_delegation::{ArchetypeDelegationTool, DelegationTarget};
-pub use collapsed_delegation::{CollapsedDelegationTool, DELEGATE_TO_TOOL_NAME, DelegateTarget};
+pub use collapsed_delegation::{CollapsedDelegationTool, DelegateTarget, DELEGATE_TO_TOOL_NAME};
pub(crate) use continue_subagent::ContinueSubagentDispatch;
pub use continue_subagent::ContinueSubagentTool;
pub(crate) use delegate_graph::DelegateGraphDispatch;
pub use delegate_graph::DelegateGraphTool;
pub(crate) use spawn_async_subagent::SpawnAsyncSubagentDispatch;
-pub use spawn_async_subagent::{SpawnAsyncSubagentTool, scope_spawn_async_subagent_spec};
+pub use spawn_async_subagent::{scope_spawn_async_subagent_spec, SpawnAsyncSubagentTool};
pub(crate) use spawn_parallel_agents::SpawnParallelAgentsDispatch;
pub use spawn_parallel_agents::SpawnParallelAgentsTool;
pub(crate) use spawn_subagent::SpawnSubagentDispatch;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs
index a132d13a71..8428d8682d 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation_host.rs
@@ -1,6 +1,6 @@
use async_trait::async_trait;
-use serde_json::Value;
use serde_json::json;
+use serde_json::Value;
use tinytools::ToolRunContext;
use tinytools::{
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs
index 10789e7083..c67772951f 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_host.rs
@@ -56,7 +56,7 @@
//! [`ToolExposure::Hidden`]: tinytools::ToolExposure::Hidden
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use super::archetype_delegation::{delegation_envelope_properties, render_structured_handoff};
use tinytools::ToolRunContext;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs
index a90d881ea6..82f43e6c34 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent_host.rs
@@ -10,8 +10,8 @@
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunStatus, continue_subagent, continue_subagent_via_driver_tool,
- load_subagent_checkpoint,
+ continue_subagent, continue_subagent_via_driver_tool, load_subagent_checkpoint,
+ SubagentRunOptions, SubagentRunStatus,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::progress::AgentProgress;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs
index f6f29f7715..7cfadc95eb 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs
@@ -4,7 +4,7 @@ use std::sync::Arc;
use tinytools::Tool;
use super::super::collapsed_delegation::{
- CollapsedDelegationTool, DelegateTarget, dispatch_targets_from_schema,
+ dispatch_targets_from_schema, CollapsedDelegationTool, DelegateTarget,
};
use super::super::delegate_graph::DelegateGraphDispatch;
use crate::tools::delegate::DelegateToolDispatch;
@@ -247,11 +247,9 @@ async fn config_delegate_dispatch_preserves_tool_failure_in_shared_jobs() {
.expect("the host returns the configured tool result");
assert!(result.is_error);
- assert!(
- result
- .output()
- .contains("configured policy rejected the request")
- );
+ assert!(result
+ .output()
+ .contains("configured policy rejected the request"));
assert!(
jobs.list().iter().any(|job| {
job.agent == "configured-error"
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs
index fc66dccc8b..876c86d286 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/list_subagents_tests.rs
@@ -4,13 +4,11 @@ use crate::agent::orchestration::subagent_sessions;
#[test]
fn schema_has_no_required_fields() {
let schema = ListSubagentsTool::new().parameters_schema();
- assert!(
- schema
- .get("required")
- .and_then(|v| v.as_array())
- .expect("required")
- .is_empty()
- );
+ assert!(schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .expect("required")
+ .is_empty());
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
index e94a3b94e4..32a0d5affb 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
@@ -27,9 +27,9 @@ pub(super) fn make_completion(
Result<SubagentRunOutcome, String>,
bool,
) -> std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>>
-+ Send
-+ Sync
-+ 'static {
+ + Send
+ + Sync
+ + 'static {
move |_target: String,
result: Result<SubagentRunOutcome, String>,
emit_lifecycle_effects: bool|
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
index 6aac1c51fd..8186eb6882 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs
@@ -301,10 +301,9 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
.iter()
.filter_map(|v| v.as_str())
.collect();
- assert!(
- next.iter()
- .any(|a| a.contains("delivered to you automatically"))
- );
+ assert!(next
+ .iter()
+ .any(|a| a.contains("delivered to you automatically")));
let message = format_async_subagent_accepted("task_manager_agent", &serialized, &fleet);
let prose = message.split("[async_subagent_ref]").next().unwrap();
@@ -616,10 +615,8 @@ fn scoped_instance_advertises_exactly_the_allowlist() {
schema["properties"]["agent_id"]["enum"],
serde_json::json!(["agent_memory", "workflow_builder"])
);
- assert!(
- schema["properties"]["agent_id"]["description"]
- .as_str()
- .unwrap_or_default()
- .contains("only these are dispatchable")
- );
+ assert!(schema["properties"]["agent_id"]["description"]
+ .as_str()
+ .unwrap_or_default()
+ .contains("only these are dispatchable"));
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
index e0aa14c8c5..3c8d6bfff9 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
@@ -6,8 +6,8 @@ use crate::agent::orchestration::spawn_parallel::ParallelAgentLineage;
use crate::agent::orchestration::spawn_parallel::ParallelAgentResult;
use crate::agent::orchestration::spawn_parallel::ParallelAgentTask;
use crate::agent::orchestration::spawn_parallel::{
- SpawnParallelGraphOutcome, format_spawn_parallel_success,
- run_spawn_parallel_tasks_with_cancellation_and_workspace,
+ format_spawn_parallel_success, run_spawn_parallel_tasks_with_cancellation_and_workspace,
+ SpawnParallelGraphOutcome,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
index a8f0bb1e03..449c958c51 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
@@ -210,16 +210,12 @@ async fn collects_immediate_task_validation_failures() {
.iter()
.map(|result| result["error"].as_str().unwrap_or_default())
.collect::<Vec<_>>();
- assert!(
- errors
- .iter()
- .any(|error| error.contains("agent_id and prompt"))
- );
- assert!(
- errors
- .iter()
- .any(|error| error.contains("unknown agent_id"))
- );
+ assert!(errors
+ .iter()
+ .any(|error| error.contains("agent_id and prompt")));
+ assert!(errors
+ .iter()
+ .any(|error| error.contains("unknown agent_id")));
}
#[test]
@@ -307,11 +303,9 @@ fn shared_workspace_allows_readonly_or_explicitly_isolated_workers() {
&parent,
);
- assert!(
- preflight
- .into_iter()
- .all(|item| matches!(item, SpawnParallelTaskPreflight::Prepared(_)))
- );
+ assert!(preflight
+ .into_iter()
+ .all(|item| matches!(item, SpawnParallelTaskPreflight::Prepared(_))));
}
// This exercises the full parallel-subagent path (parent turn → spawn N
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 79e687c7ca..c688170a0f 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,10 +1,10 @@
use super::*;
-use crate::agent::OpenHumanSessionHost;
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::orchestration::spawn_parallel::{
- ParallelTaskRejectionKind, SpawnParallelTaskPreflight, prepare_spawn_parallel_tasks_from_defs,
+ prepare_spawn_parallel_tasks_from_defs, ParallelTaskRejectionKind, SpawnParallelTaskPreflight,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
+use crate::agent::OpenHumanSessionHost;
use crate::agent_registry::host_definition::AgentDefinition;
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::config::AgentConfig;
@@ -13,8 +13,8 @@ use parking_lot::Mutex;
use serde_json::json;
use std::collections::HashMap;
use std::sync::{
- Arc,
atomic::{AtomicUsize, Ordering},
+ Arc,
};
use tinyagents_definition::{
AgentTier, DefinitionSource, ModelSpec, PromptSource, SandboxMode, ToolScope,
@@ -29,7 +29,7 @@ use tinytools::{PermissionLevel, Tool, ToolResult};
use tinytools_agent::dialect::NativeDialect;
use tinytools_agent::dialect::ToolCallFormat;
use tinytools_agent::dialect::TranscriptEntry;
-use tokio::time::{Duration, sleep, timeout};
+use tokio::time::{sleep, timeout, Duration};
const PARENT_PROMPT_CANARY: &str = "parallel-fanout-e2e-canary";
const RESEARCH_PROMPT_CANARY: &str = "research-branch-canary";
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
index ce200aad57..a8bcbd8253 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
@@ -14,7 +14,7 @@
//!
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent_via_driver_tool,
+ run_subagent_via_driver_tool, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::core::runtime::DispatchCtx;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
index fbd7fcc4dd..50d10575ff 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
@@ -51,13 +51,11 @@ fn parameters_schema_advertises_dedicated_thread_flag() {
assert_eq!(flag.get("type").and_then(|v| v.as_str()), Some("boolean"));
// Must be off by default — workers are an opt-in escape hatch, not
// a free upgrade for every spawn.
- assert!(
- schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
- .unwrap_or(true)
- );
+ assert!(schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
+ .unwrap_or(true));
}
#[test]
@@ -67,13 +65,11 @@ fn parameters_schema_advertises_optional_model_override() {
let props = schema.get("properties").expect("schema has properties");
let model = props.get("model").expect("model override advertised");
assert_eq!(model.get("type").and_then(|v| v.as_str()), Some("string"));
- assert!(
- schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
- .unwrap_or(true)
- );
+ assert!(schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
+ .unwrap_or(true));
}
#[test]
@@ -236,11 +232,9 @@ async fn legacy_archetype_alias_is_accepted_for_lookup() {
.await
.unwrap();
assert!(result.is_error);
- assert!(
- result
- .output()
- .contains("unknown agent_id 'totally_made_up'")
- );
+ assert!(result
+ .output()
+ .contains("unknown agent_id 'totally_made_up'"));
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs
index 42aaf8bf5a..fab6ef3dcf 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_abort_report.rs
@@ -24,8 +24,8 @@
//! only thing that settles the card. A closed channel has no reader left to
//! settle anything, so that case is logged and dropped.
-use tokio::sync::mpsc::Sender;
use tokio::sync::mpsc::error::TrySendError;
+use tokio::sync::mpsc::Sender;
use crate::progress::AgentProgress;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
index 9e85144460..6ff5e2878b 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
@@ -7,7 +7,7 @@
//! envelopes only.
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinyagents_orchestration::subagent::SubagentResumeRef;
use tinytools::{PermissionLevel, Tool, ToolResult, ToolTimeout};
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs
index cdcfb7ad8c..87479d06ee 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_dispatch_host.rs
@@ -1,7 +1,7 @@
//! Subagent dispatch logic shared by all agent delegation tools.
use crate::agent::subagent_host::{
- SubagentRunOptions, SubagentRunStatus, run_subagent_via_driver_tool,
+ run_subagent_via_driver_tool, SubagentRunOptions, SubagentRunStatus,
};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::progress::AgentProgress;
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 9e23946d45..6e9b8a24e6 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::SpanStatus;
use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
+use tinyagents_harness::observability::trace_export::SpanStatus;
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/subagent_host/lifecycle.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
index 4d459979c2..c09a531e02 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
@@ -32,8 +32,8 @@ mod checkpoint;
#[path = "lifecycle_outcome.rs"]
mod outcome;
use checkpoint::absolute_checkpoint_dir;
-use driver_adapter::HostInvocation;
pub(super) use driver_adapter::outcome_to_host;
+use driver_adapter::HostInvocation;
use outcome::HostInFlightMap;
pub(super) use persistence::OpenHumanPersistence;
@@ -268,13 +268,13 @@ pub(crate) async fn spawn_async_via_driver_tool(
input: String,
options: SubagentRunOptions,
completion: impl Fn(
- String,
- Result<SubagentRunOutcome, String>,
- bool,
- ) -> Pin<Box<dyn Future<Output = ()> + Send>>
- + Send
- + Sync
- + 'static,
+ String,
+ Result<SubagentRunOutcome, String>,
+ bool,
+ ) -> Pin<Box<dyn Future<Output = ()> + Send>>
+ + Send
+ + Sync
+ + 'static,
) -> Result<String, SubagentRunError> {
spawn_async_via_driver_tool_using_jobs(parent, definition, input, options, None, completion)
.await
@@ -288,13 +288,13 @@ pub(crate) async fn spawn_async_via_driver_tool_with_jobs(
options: SubagentRunOptions,
jobs: tinyagents_orchestration::subagent::SubAgentJobRegistry,
completion: impl Fn(
- String,
- Result<SubagentRunOutcome, String>,
- bool,
- ) -> Pin<Box<dyn Future<Output = ()> + Send>>
- + Send
- + Sync
- + 'static,
+ String,
+ Result<SubagentRunOutcome, String>,
+ bool,
+ ) -> Pin<Box<dyn Future<Output = ()> + Send>>
+ + Send
+ + Sync
+ + 'static,
) -> Result<String, SubagentRunError> {
spawn_async_via_driver_tool_using_jobs(
parent,
@@ -314,13 +314,13 @@ async fn spawn_async_via_driver_tool_using_jobs(
options: SubagentRunOptions,
jobs: Option<tinyagents_orchestration::subagent::SubAgentJobRegistry>,
completion: impl Fn(
- String,
- Result<SubagentRunOutcome, String>,
- bool,
- ) -> Pin<Box<dyn Future<Output = ()> + Send>>
- + Send
- + Sync
- + 'static,
+ String,
+ Result<SubagentRunOutcome, String>,
+ bool,
+ ) -> Pin<Box<dyn Future<Output = ()> + Send>>
+ + Send
+ + Sync
+ + 'static,
) -> Result<String, SubagentRunError> {
let task_id = options
.task_id
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 8c703c087f..88bb70c07f 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::{
- HostInFlight, OpenHumanDriverBundle, OpenHumanPersistence, decode_driver_job_result,
- host_in_flight, load_subagent_checkpoint, merged_resume_history,
+ decode_driver_job_result, host_in_flight, load_subagent_checkpoint, merged_resume_history,
+ HostInFlight, OpenHumanDriverBundle, OpenHumanPersistence,
};
use super::{SubagentMode, SubagentRunError, SubagentRunOutcome, SubagentRunStatus, SubagentUsage};
@@ -97,11 +97,9 @@ fn driver_error_does_not_hide_completed_mismatched_or_persistence_failures() {
tinytools::ToolResult::error("provider transport failed"),
] {
let error = decode_driver_job_result(result, &bundle, &task_key).unwrap_err();
- assert!(
- error
- .to_string()
- .contains("driver-backed async spawn failed")
- );
+ assert!(error
+ .to_string()
+ .contains("driver-backed async spawn failed"));
}
bundle.failures.lock().unwrap().insert(
@@ -127,11 +125,9 @@ fn driver_error_does_not_hide_completed_mismatched_or_persistence_failures() {
&task_key,
)
.unwrap_err();
- assert!(
- error
- .to_string()
- .contains("driver-backed async spawn failed")
- );
+ assert!(error
+ .to_string()
+ .contains("driver-backed async spawn failed"));
bundle.host_outcome.lock().unwrap().insert(
task_key.clone(),
@@ -334,12 +330,11 @@ async fn tiny_session_port_recovers_legacy_key_from_owned_pause_and_hides_foreig
.unwrap();
assert_eq!(owned.len(), 1);
assert_eq!(owned[0].lifecycle_key, Some(key));
- assert!(
- port.list_for_parent("foreign-session", Some("thread"))
- .await
- .unwrap()
- .is_empty()
- );
+ assert!(port
+ .list_for_parent("foreign-session", Some("thread"))
+ .await
+ .unwrap()
+ .is_empty());
}
#[tokio::test]
@@ -569,7 +564,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::{DomainSet, context::CoreContext};
+ use crate::core::runtime::{context::CoreContext, DomainSet};
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 eaba8d6156..176ee8448c 100644
--- a/crates/openhuman-core/src/agent/subagent_host/mod.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/mod.rs
@@ -63,11 +63,11 @@ pub(crate) use lifecycle::run_subagent_via_driver_tool;
pub(crate) use lifecycle::spawn_async_via_driver_tool;
#[cfg(test)]
pub(crate) use lifecycle::spawn_async_via_driver_tool_with_jobs;
+pub(crate) use lifecycle::{checkpoint_resume, continue_subagent_via_driver_tool};
pub use lifecycle::{
- OpenHumanSubagentHost, continue_subagent, continue_subagent_with_parent, run_subagent,
- run_subagent_with_parent,
+ continue_subagent, continue_subagent_with_parent, run_subagent, run_subagent_with_parent,
+ OpenHumanSubagentHost,
};
-pub(crate) use lifecycle::{checkpoint_resume, continue_subagent_via_driver_tool};
pub(crate) use ops::is_safe_task_id;
pub use types::{
SubagentCheckpointData, SubagentMode, SubagentRunError, SubagentRunOptions, SubagentRunOutcome,
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs
index 4bea14d573..0c35a2b983 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph.rs
@@ -43,10 +43,10 @@ mod transcript;
// (`ops/mod.rs`, `ops/runner.rs`, `graph_tests.rs`'s `use super::*`) are
// unaffected by the responsibility split.
#[cfg(test)]
-pub(super) use dispatch::AggregatedUsage;
-#[cfg(test)]
pub(super) use dispatch::inherited_thread_id;
pub(super) use dispatch::run_subagent_via_graph;
+#[cfg(test)]
+pub(super) use dispatch::AggregatedUsage;
// Only what `graph_tests.rs`'s `use super::*` still needs directly (the rest
// of the original flat imports now live with the code that uses them, in
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph_policy_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph_policy_tests.rs
index e40492a67a..a21e32624d 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph_policy_tests.rs
@@ -40,7 +40,7 @@ impl<S: tracing::Subscriber> tracing_subscriber::Layer<S> for WarnLayer {
let mut message = Message(None);
event.record(&mut message);
if let Some(text) = message.0 {
- self.0.0.lock().unwrap().push(text);
+ self.0 .0.lock().unwrap().push(text);
}
}
}
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/prompt.rs b/crates/openhuman-core/src/agent/subagent_host/ops/prompt.rs
index 47b21b7ba4..e2305d40b4 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/prompt.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/prompt.rs
@@ -6,7 +6,7 @@
use crate::agent::harness::artifact_offload::OFFLOAD_WRITE_TOOL;
use std::collections::HashSet;
use tinyagents_harness::artifacts::{
- ARTIFACT_OFFLOAD_HEADING, render_artifact_offload_contract, should_render_offload_contract,
+ render_artifact_offload_contract, should_render_offload_contract, ARTIFACT_OFFLOAD_HEADING,
};
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 349b751345..8a6e9501ab 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -24,14 +24,14 @@ 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,
- validate_tier_transition,
+ validate_tier_transition, AgentTier, IterationPolicy, PromptSource,
+ SandboxMode as AgentSandboxMode,
};
use tinyagents_harness::artifacts::{
- DEFAULT_OFFLOAD_THRESHOLD_BYTES, HANDOFF_STAGE_RECORDED, effective_offload_threshold,
- extract_artifact_paths, note_artifact_handoff,
+ effective_offload_threshold, extract_artifact_paths, note_artifact_handoff,
+ DEFAULT_OFFLOAD_THRESHOLD_BYTES, HANDOFF_STAGE_RECORDED,
};
-use tinyagents_harness::context::{RunConfig, RunDepth, current_run_depth, with_run_depth};
+use tinyagents_harness::context::{current_run_depth, with_run_depth, RunConfig, RunDepth};
use tinytools::{SandboxMode as TinyagentsSandboxMode, ToolSpec, WorkspaceDescriptor};
use tinytools_std::file_state::with_file_state_agent_id;
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
index ed95201a49..0554357f2b 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
@@ -199,21 +199,19 @@ async fn closing_a_durable_driver_session_cancels_only_its_registered_child() {
assert_eq!(steered_payload["job_id"].as_str(), Some(job_id.as_str()));
assert_eq!(steered_payload["status"], "message_queued");
- assert!(
- port.close("close-driver-session")
- .await
- .expect("Tiny close adapter cancels then closes the durable row")
- );
+ assert!(port
+ .close("close-driver-session")
+ .await
+ .expect("Tiny close adapter cancels then closes the durable row"));
assert_eq!(
jobs.get(job_id.as_str()).unwrap().status,
SubAgentJobStatus::Running,
"the job remains visible while cooperative cancellation unwinds"
);
- assert!(
- port.close("close-driver-session")
- .await
- .expect("repeated close is idempotent without re-cancelling")
- );
+ assert!(port
+ .close("close-driver-session")
+ .await
+ .expect("repeated close is idempotent without re-cancelling"));
assert!(!parent_cancellation.is_cancelled(), "parent stays live");
let tiny_store: std::sync::Arc<dyn TinySessionStore> = std::sync::Arc::new(port.clone());
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
index 8a5162295c..83d6f607c6 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
@@ -1,9 +1,9 @@
use super::*;
use crate::agent::subagent_host::run_subagent;
use crate::agent::subagent_host::{
- SubagentRunStatus, run_subagent_via_driver_tool, spawn_async_via_driver_tool_with_jobs,
+ run_subagent_via_driver_tool, spawn_async_via_driver_tool_with_jobs, SubagentRunStatus,
};
-use tinyagents_harness::context::{RunDepth, current_run_depth, with_run_depth};
+use tinyagents_harness::context::{current_run_depth, with_run_depth, RunDepth};
struct BlockingSubagentCloseTool {
started: tokio::sync::mpsc::Sender<()>,
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs
index cd43987aea..0e549808c7 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::agent::subagent_host::run_subagent;
-use tinyagents_harness::context::{RunDepth, current_run_depth, with_run_depth};
+use tinyagents_harness::context::{current_run_depth, with_run_depth, RunDepth};
#[test]
fn filter_named_scope_keeps_only_named() {
@@ -146,16 +146,12 @@ async fn typed_mode_system_prompt_includes_subagent_role_contract() {
.find(|m| m.role == "system")
.expect("system message should be present");
assert!(system_msg.content.contains("## Sub-agent Role Contract"));
- assert!(
- system_msg
- .content
- .contains("You are a sub-agent working for a parent OpenHuman agent")
- );
- assert!(
- system_msg
- .content
- .contains("Keep your final response concise and synthesis-ready")
- );
+ assert!(system_msg
+ .content
+ .contains("You are a sub-agent working for a parent OpenHuman agent"));
+ assert!(system_msg
+ .content
+ .contains("Keep your final response concise and synthesis-ready"));
}
#[tokio::test]
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 0294dacead..7932dc3b6f 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::integrations::ConnectedIntegrationTool;
-use tinyagents_harness::tool::{MIN_CONFIDENT_HITS, SelectableTool, rank_tools_by_prompt};
+use tinyagents_harness::tool::{rank_tools_by_prompt, SelectableTool, MIN_CONFIDENT_HITS};
fn rank_actions_by_prompt(
prompt: &str,
diff --git a/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs b/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs
index 5924852628..85db46ef3e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/steering_forwarder.rs
@@ -26,7 +26,7 @@ use tinyagents_runtime::turn_driver::{
MessageRunQueueFeed, RunQueueFeed, SteeringFeed, SteeringRegistrar,
};
-use crate::agent::queued_turn::{QueuedTurn, text_preview};
+use crate::agent::queued_turn::{text_preview, QueuedTurn};
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
diff --git a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
index c482fc621e..e61a64a98a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
@@ -14,7 +14,7 @@ use tinyagents_harness::tool::{
};
use tinyagents_registry::{CapabilityRegistry, ComponentKind, RegistryDiagnostic};
use tinyagents_runtime::turn_driver::{SharedToolSet, ToolSetBuilder};
-use tinyagents_runtime::{ToolAdmission, project_descriptors};
+use tinyagents_runtime::{project_descriptors, ToolAdmission};
use tinyinference_llm::model::ChatModel;
use tinytools::{Tool, ToolCallOptions, ToolResult, ToolRunContext};
@@ -22,8 +22,8 @@ use crate::agent::orchestration::tools::{
ContinueSubagentDispatch, DelegateGraphDispatch, DelegationDispatch,
SpawnAsyncSubagentDispatch, SpawnParallelAgentsDispatch, SpawnSubagentDispatch,
};
-use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent::tinyagents::host::run_context::HostOperationContext;
+use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent::tinyagents::turn_policy::is_subagent_spawn_or_delegate_tool;
use crate::agent::tinyagents::use_skill_dispatch::UseSkillDispatch;
use crate::agent::tools::TodoToolDispatch;
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 bcc1645fec..e6a797c699 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
@@ -75,7 +75,7 @@ async fn static_live_harness_builder_resolves_control_aliases_from_the_execution
DurableSubagentSession, DurableSubagentStatus, SubagentSessionStore,
};
use tinyagents_harness::{
- ComponentId, agent_loop::phases::execute_tool_batch, context::RunConfig,
+ agent_loop::phases::execute_tool_batch, context::RunConfig, ComponentId,
};
let workspace = tempfile::tempdir().expect("live harness workspace");
@@ -186,7 +186,7 @@ async fn live_close_alias_enforces_parent_thread_ownership() {
DurableSubagentSession, DurableSubagentStatus, SubagentSessionStore,
};
use tinyagents_harness::{
- ComponentId, agent_loop::phases::execute_tool_batch, context::RunConfig,
+ agent_loop::phases::execute_tool_batch, context::RunConfig, ComponentId,
};
let workspace = tempfile::tempdir().expect("live harness workspace");
@@ -323,7 +323,7 @@ async fn live_close_alias_enforces_parent_thread_ownership() {
#[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::{CallId, context::RunConfig};
+ use tinyagents_harness::{context::RunConfig, CallId};
use tinytools::ToolCallOptions;
let workspace = tempfile::tempdir().unwrap();
let config = config_in(&workspace);
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
index a308dccec0..825e87f057 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
@@ -26,11 +26,11 @@ use crate::agent::tinyagents::middleware::turn_context::TurnContextMiddleware;
use crate::agent::tinyagents::observability::{OpenhumanEventBridge, SubagentScope};
use crate::agent::tinyagents::tool_registration::capability_diagnostics;
use crate::agent::tinyagents::turn_middleware::{
- TurnMiddlewareInputs, TurnWiring, install_turn_middleware,
+ install_turn_middleware, TurnMiddlewareInputs, TurnWiring,
};
use crate::agent::tinyagents::turn_outcome::TinyagentsTurnOutcome;
use crate::agent::tinyagents::turn_plan::{
- OpenHumanTurnPlanner, enforce_registry_diagnostics, turn_models_for_plan, turn_run_policy,
+ enforce_registry_diagnostics, turn_models_for_plan, turn_run_policy, OpenHumanTurnPlanner,
};
use crate::agent::tinyagents::turn_run_error::map_turn_run_error;
use crate::agent::tinyagents::turn_run_finalize::finalize_turn_outcome;
diff --git a/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs b/crates/openhuman-core/src/agent/tinyagents/use_skill_dispatch.rs
index 308520e87e..2c6948d968 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::{PackRegistryHandle, named_tool};
+use tinyagents_harness::tool::packs::{named_tool, PackRegistryHandle};
/// 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 eb99b410b4..0055f93a71 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
@@ -21,9 +21,9 @@ 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/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs
index 843ed74753..023d22feb4 100644
--- a/crates/openhuman-core/src/threads/ops/crud.rs
+++ b/crates/openhuman-core/src/threads/ops/crud.rs
@@ -5,11 +5,11 @@ use super::support::{
counts, envelope, message_to_record, record_to_message, run_to_completion, thread_to_summary,
workspace_dir,
};
-use crate::core::Outcome;
use crate::core::runtime::DispatchCtx;
-use crate::threads::ThreadsError;
+use crate::core::Outcome;
use crate::threads::store as conversations;
use crate::threads::store::{ConversationMessagePatch, CrossThreadHit};
+use crate::threads::ThreadsError;
use crate::threads::{
ApiEnvelope, AppendConversationMessageRequest, ConversationMessageRecord,
ConversationMessagesRequest, ConversationMessagesResponse, ConversationThreadSummary,
diff --git a/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs b/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
index 964dda7317..1eff122c93 100644
--- a/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
@@ -111,55 +111,47 @@ async fn user_append_stages_original_strips_upload_bytes_and_reuses_returned_con
.await
.unwrap();
assert_eq!(persisted.len(), 2);
- assert!(
- !serde_json::to_string(&persisted)
- .unwrap()
- .contains("base64,")
- );
+ assert!(!serde_json::to_string(&persisted)
+ .unwrap()
+ .contains("base64,"));
}
#[tokio::test]
async fn rejected_upload_never_appends_a_message() {
let (_temp, mut config) = setup().await;
config.multimodal_files.max_files = 0;
- assert!(
- append_with_test_config(
- request(
- "disabled",
- "[IMAGE:data:image/png;base64,iVBORw0KGgo=]",
- "user"
- ),
- &config,
- None,
- )
- .await
- .is_err()
- );
+ assert!(append_with_test_config(
+ request(
+ "disabled",
+ "[IMAGE:data:image/png;base64,iVBORw0KGgo=]",
+ "user"
+ ),
+ &config,
+ None,
+ )
+ .await
+ .is_err());
config.multimodal_files.max_files = 3;
- assert!(
- append_with_test_config(
- request("bad", "[FILE:data:application/zip;base64,!]", "user"),
- &config,
- None,
- )
- .await
- .is_err()
- );
+ assert!(append_with_test_config(
+ request("bad", "[FILE:data:application/zip;base64,!]", "user"),
+ &config,
+ None,
+ )
+ .await
+ .is_err());
assert!(
append_with_test_config(request("missing", "image.png", "user"), &config, None)
.await
.is_err()
);
- assert!(
- conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir.clone(),
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty()
- );
+ assert!(conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir.clone(),
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty());
}
#[tokio::test]
@@ -187,16 +179,14 @@ async fn external_origin_cannot_reuse_an_existing_attachment_marker() {
.await
.is_err()
);
- assert!(
- conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir,
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty()
- );
+ assert!(conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir,
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty());
}
#[tokio::test]
@@ -265,16 +255,14 @@ async fn append_uses_host_persistence_workspace_separate_from_rpc_config() {
.await
.unwrap();
assert_eq!(persisted.len(), 1);
- assert!(
- conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir,
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty()
- );
+ assert!(conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir,
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty());
}
#[tokio::test]
@@ -285,21 +273,17 @@ async fn poster_only_user_metadata_is_rejected_before_persistence() {
"attachmentNames": ["video.mp4"],
"attachmentPosters": ["data:image/png;base64,iVBORw0KGgo="]
});
- assert!(
- append_with_test_config(upload, &config, None)
- .await
- .is_err()
- );
- assert!(
- conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir.clone(),
- "uploads".into()
- )
+ assert!(append_with_test_config(upload, &config, None)
.await
- .unwrap()
- .is_empty()
- );
+ .is_err());
+ assert!(conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir.clone(),
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty());
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/tools/delegate.rs b/crates/openhuman-core/src/tools/delegate.rs
index 207334d1e9..2bbe0251fd 100644
--- a/crates/openhuman-core/src/tools/delegate.rs
+++ b/crates/openhuman-core/src/tools/delegate.rs
@@ -1,9 +1,9 @@
use crate::config::DelegateAgentConfig;
use crate::inference::provider::{
- INFERENCE_BACKEND_ID, OpenHumanBackendModel, ProviderRuntimeOptions,
+ OpenHumanBackendModel, ProviderRuntimeOptions, INFERENCE_BACKEND_ID,
};
-use crate::security::SecurityPolicy;
use crate::security::policy::ToolOperation;
+use crate::security::SecurityPolicy;
use crate::tools::timeout::tool_execution_timeout_secs;
use async_trait::async_trait;
use serde_json::json;
diff --git a/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread.rs b/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread.rs
index 9838205804..ac46d701e6 100644
--- a/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread.rs
+++ b/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread.rs
@@ -9,7 +9,7 @@
//! Worker threads carry a hard cap on depth: a worker thread cannot spawn
//! another worker thread.
-use crate::agent::subagent_host::{SubagentRunOptions, run_subagent_with_parent};
+use crate::agent::subagent_host::{run_subagent_with_parent, SubagentRunOptions};
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::threads::store as conversations;
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread_tests.rs b/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread_tests.rs
index 2f753c8705..bfe5833de8 100644
--- a/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/threads/spawn_worker_thread_tests.rs
@@ -62,11 +62,9 @@ async fn rejects_if_already_worker_thread() {
let result = spawn_from_thread(temp.path(), thread_id).await;
assert!(result.is_error);
- assert!(
- result
- .output()
- .contains("cannot spawn other worker threads")
- );
+ assert!(result
+ .output()
+ .contains("cannot spawn other worker threads"));
}
#[tokio::test]
@@ -91,11 +89,9 @@ async fn rejects_if_has_parent_thread_id() {
let result = spawn_from_thread(temp.path(), thread_id).await;
assert!(result.is_error);
- assert!(
- result
- .output()
- .contains("cannot spawn other worker threads")
- );
+ assert!(result
+ .output()
+ .contains("cannot spawn other worker threads"));
}
async fn spawn_from_thread(workspace: &std::path::Path, thread_id: &str) -> tinytools::ToolResult {