Skip to content

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

chore(orchestration): apply rustfmt import ordering and line wrapping

Steven Enamakel573b3f0d06cc
diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs
index 54ea31fa34..806bd7a5e2 100644
--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs
+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs
@@ -29,7 +29,7 @@
use std::sync::Arc;
-use anyhow::{anyhow, Result};
+use anyhow::{Result, anyhow};
use serde_json::json;
use crate::agent::harness::ParentExecutionContext;
@@ -46,8 +46,8 @@ use {
};
use tinyagents_orchestration::teams::{
- build_member_prompt, claimable_task, deliver_pending_messages, run_member_graph,
- truncate_chars, MemberOutcome, SessionTeamLedger, TeamError,
+ MemberOutcome, SessionTeamLedger, TeamError, build_member_prompt, claimable_task,
+ deliver_pending_messages, run_member_graph, truncate_chars,
};
use tinyagents_graph::GraphTracingSink;
@@ -501,7 +501,7 @@ async fn record_failure_event(
mod run_ledger {
use std::path::Path;
- use anyhow::{anyhow, Result};
+ use anyhow::{Result, anyhow};
use super::{AgentTeamMember, AgentTeamTask, ClaimOutcome, CompletionOutcome, RunEventAppend};
diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs
index b6a951018f..75e38355f2 100644
--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/schemas.rs
@@ -10,8 +10,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::AgentTeamListRequest;
@@ -181,8 +181,7 @@ fn schema_for(function: &str) -> ControllerSchema {
"agent_team_complete_task" => ControllerSchema {
namespace: "agent_team",
function: "complete_task",
- description:
- "Complete a claimed task, gating its transition to done behind quality checks.",
+ description: "Complete a claimed task, gating its transition to done behind quality checks.",
inputs: vec![
required_str("teamId", "Team id."),
required_str("taskId", "Task id to complete."),
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs
index b6f6986a4e..045b7687dd 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions_tenant_tests.rs
@@ -97,7 +97,7 @@ async fn one_profiles_stop_and_delete_never_reach_anothers_thread() {
#[test]
fn a_saas_cancel_reaches_only_the_callers_workspace() {
- use super::running_subagents::{caller_workspace_in, CallerWorkspace};
+ use super::running_subagents::{CallerWorkspace, caller_workspace_in};
let ws = TestWorkspace::new();
let alice = profile("u-alice", ws.path());
assert!(matches!(
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
index 5fc921fd1e..f1dda32d39 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
@@ -49,10 +49,10 @@ use slot::DeliverySlot;
use super::background_completions;
use super::busy_guard::is_busy;
#[cfg(test)]
-use super::busy_guard::{busy, clear_busy_for_thread, TurnBusy};
+use super::busy_guard::{TurnBusy, busy, clear_busy_for_thread};
use super::completion_notice::build_undelivered_notice;
use super::completion_owners;
-use super::delivery_drain::{run_drain, DrainFence, DrainOutcome, RECOVERY_BUSY_POLL};
+use super::delivery_drain::{DrainFence, DrainOutcome, RECOVERY_BUSY_POLL, run_drain};
use crate::core::runtime::CoreContext;
/// Coalesce completions landing within this window into one delivery turn.
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery/slot.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery/slot.rs
index d2113cb217..ec2de0ddcb 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery/slot.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery/slot.rs
@@ -5,8 +5,8 @@ use std::sync::Arc;
use tinyagents_tasks::CompletionRouter;
-use crate::core::runtime::tenant;
use crate::core::runtime::DispatchCtx;
+use crate::core::runtime::tenant;
/// The per-thread (per profile) delivery slot, plus the batch lease.
/// Dropping it frees both: `release` on an already-settled record is a no-op,
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery_slots_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery_slots_tests.rs
index e09bc83f43..261bbaed11 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery_slots_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery_slots_tests.rs
@@ -5,7 +5,7 @@
use super::*;
use crate::agent::orchestration::background_completions::{
- pending_for, record_completion, router_for_workspace, TestWorkspace,
+ TestWorkspace, pending_for, record_completion, router_for_workspace,
};
use crate::core::runtime::DispatchCtx;
use crate::core::runtime::{ContextOverlay, DomainSet};
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs
index c72e47df3c..a36f17ce61 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery_tenant_tests.rs
@@ -9,7 +9,7 @@ use std::path::Path;
use std::sync::Arc;
use super::background_completions::*;
-use super::background_delivery::{drain_schedule_in, Drain};
+use super::background_delivery::{Drain, drain_schedule_in};
use crate::core::events::DomainEvent;
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
use crate::tools::toolpacks::ToolGroups;
@@ -151,7 +151,7 @@ fn an_unknown_session_is_dropped_in_saas() {
/// its own marks.
#[tokio::test]
async fn busy_marks_are_keyed_by_the_explicit_context() {
- use super::busy_guard::{clear_busy_for_thread, is_busy, TurnBusy};
+ use super::busy_guard::{TurnBusy, clear_busy_for_thread, is_busy};
let _guard = crate::config::TEST_ENV_LOCK.lock().await;
let (ws_a, ws_b) = (TestWorkspace::new(), TestWorkspace::new());
let alice = DispatchCtx::new(profile(&unique("b-alice"), ws_a.path()));
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery_tests.rs
index ad766f77a5..edf37dd14f 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery_tests.rs
@@ -6,7 +6,7 @@ fn cx() -> crate::core::runtime::DispatchCtx {
}
use crate::agent::orchestration::background_completions::{
- forget_workspace_for_test, pending_for, record_completion, router_for_workspace, TestWorkspace,
+ TestWorkspace, forget_workspace_for_test, pending_for, record_completion, router_for_workspace,
};
use std::path::Path;
use std::sync::atomic::{AtomicU32, Ordering};
@@ -510,10 +510,12 @@ async fn every_subagent_terminal_event_schedules_a_drain_through_the_handler() {
iterations: 0,
})
.await;
- assert!(scheduled_for_test()
- .lock()
- .expect("scheduled")
- .contains(&("bd-term-thread".to_string(), Duration::from_millis(300))));
+ assert!(
+ scheduled_for_test()
+ .lock()
+ .expect("scheduled")
+ .contains(&("bd-term-thread".to_string(), Duration::from_millis(300)))
+ );
clear_busy(session);
assert_eq!(
drain_schedule(&DomainEvent::SubagentFailed {
@@ -678,10 +680,12 @@ async fn boot_recovery_schedules_a_delivery_for_every_thread_with_undelivered_re
scheduled_for_test().lock().expect("scheduled").clear();
assert_eq!(recover_on_boot(&cx(), w), 1);
- assert!(scheduled_for_test()
- .lock()
- .expect("scheduled")
- .contains(&("thread-boot-sched".to_string(), RECOVERY_DELAY)));
+ assert!(
+ scheduled_for_test()
+ .lock()
+ .expect("scheduled")
+ .contains(&("thread-boot-sched".to_string(), RECOVERY_DELAY))
+ );
assert_eq!(
recover_on_boot(&cx(), w),
0,
diff --git a/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs b/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs
index af36b05917..af459e4f84 100644
--- a/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/command_center/schemas.rs
@@ -8,8 +8,8 @@ use serde_json::{Map, Value};
use tinyagents_session::run_ledger::command_center::ControlVerb;
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
/// Controller schemas exposed by the command center.
diff --git a/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs b/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs
index 215339fcd7..545fe8ceb5 100644
--- a/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs
@@ -1,12 +1,12 @@
use super::*;
use crate::agent::orchestration::background_completions::{
- pending_for, record_completion, router_for_workspace, TestWorkspace,
+ TestWorkspace, pending_for, record_completion, router_for_workspace,
};
use crate::agent::orchestration::busy_guard::TurnBusy;
use crate::core::runtime::DispatchCtx;
-use crate::storage::fence::{system_now_ms, ScopeMatch};
-use crate::storage::lease::{DocumentLeases, LeaseStore};
use crate::storage::MemoryStorage;
+use crate::storage::fence::{ScopeMatch, system_now_ms};
+use crate::storage::lease::{DocumentLeases, LeaseStore};
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
const TTL: Duration = Duration::from_secs(30);
diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rs
index 550d926cdc..6e1e90010b 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs
@@ -29,7 +29,7 @@ use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::harness::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- run_subagent, SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
+ SubagentRunError, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent,
};
use crate::agent::tinyagents::host::steering::shared_steering_registry;
use crate::core::bus::BUS;
@@ -37,8 +37,8 @@ use crate::core::events::DomainEvent;
use std::collections::BTreeMap;
use std::sync::Arc;
use thiserror::Error;
-use tinyagents_harness::ids::TaskId;
use tinyagents_harness::CancellationToken;
+use tinyagents_harness::ids::TaskId;
use tinyagents_tasks::{
DetachedTaskRegistry, DetachedTaskRegistryError, DetachedTaskWaitOutcome,
OrchestrationTaskStatus,
diff --git a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
index a4701d7794..5a80ee7d46 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
@@ -6,8 +6,8 @@ use async_trait::async_trait;
use parking_lot::Mutex;
use std::future::Future;
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
use tinyagents_tasks::OrchestrationTaskStatus;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
@@ -241,11 +241,13 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
.expect("wait first child");
let first_child = &first_wait.agents[0];
assert_eq!(first_child.status, OrchestrationTaskStatus::Completed);
- assert!(first_child
- .result_summary
- .as_deref()
- .unwrap_or_default()
- .contains("CODE_AGENT_QUESTION"));
+ assert!(
+ first_child
+ .result_summary
+ .as_deref()
+ .unwrap_or_default()
+ .contains("CODE_AGENT_QUESTION")
+ );
// `message_agent`/`follow_up` are gone (superseded by the durable verbs in
// `command_center::control`). The orchestrator now records its answer by
@@ -283,11 +285,13 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
Some(first.orchestration_id.as_str())
);
assert_eq!(final_child.status, OrchestrationTaskStatus::Completed);
- assert!(final_child
- .result_summary
- .as_deref()
- .unwrap_or_default()
- .contains("CODE_AGENT_DONE"));
+ assert!(
+ final_child
+ .result_summary
+ .as_deref()
+ .unwrap_or_default()
+ .contains("CODE_AGENT_DONE")
+ );
let prompts = provider.prompts();
assert_eq!(prompts.len(), 2);
@@ -361,10 +365,12 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {
assert!(waited.completed);
assert_eq!(waited.agents.len(), 3);
- assert!(waited
- .agents
- .iter()
- .all(|agent| agent.status == OrchestrationTaskStatus::Completed));
+ assert!(
+ waited
+ .agents
+ .iter()
+ .all(|agent| agent.status == OrchestrationTaskStatus::Completed)
+ );
let outputs = waited
.agents
.iter()
diff --git a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs
index e48ef30d44..72eabf3d6f 100644
--- a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs
+++ b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs
@@ -28,8 +28,8 @@ use std::sync::Arc;
use anyhow::{Context, Result};
-use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::OpenHumanSessionHost;
+use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::config::Config;
const LOG_TARGET: &str = "agent_orchestration::parent_context";
diff --git a/crates/openhuman-core/src/agent/orchestration/parent_context/mod.rs b/crates/openhuman-core/src/agent/orchestration/parent_context/mod.rs
deleted file mode 100644
index 99069a5325..0000000000
--- a/crates/openhuman-core/src/agent/orchestration/parent_context/mod.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//! Shared root [`ParentExecutionContext`] builder for controller-spawned
-//! orchestration tasks (#3374 PR4). Export-only; the implementation lives in
-//! [`builder`] — see it for the rationale and the `with_root_parent` /
-//! `build_root_parent` construction.
-//!
-//! [`ParentExecutionContext`]: crate::agent::harness::fork_context::ParentExecutionContext
-
-mod builder;
-
-pub(crate) use builder::{build_root_parent, with_root_parent};
diff --git a/crates/openhuman-core/src/agent/orchestration/run_ledger_finalize_tests.rs b/crates/openhuman-core/src/agent/orchestration/run_ledger_finalize_tests.rs
index 8f1fe67c08..2daaa0e5b4 100644
--- a/crates/openhuman-core/src/agent/orchestration/run_ledger_finalize_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/run_ledger_finalize_tests.rs
@@ -133,7 +133,9 @@ async fn ignores_unrelated_events_and_missing_runs() {
iterations: 1,
})
.await;
- assert!(get_agent_run(&config.workspace_dir, "ghost")
- .unwrap()
- .is_none());
+ assert!(
+ get_agent_run(&config.workspace_dir, "ghost")
+ .unwrap()
+ .is_none()
+ );
}
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
index 9774538ee9..1c11f492e1 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
@@ -65,16 +65,16 @@ mod tests;
#[cfg(test)]
pub(crate) use cancel::prune;
#[cfg(test)]
-pub(crate) use cancel::{caller_workspace_in, CallerWorkspace};
+pub(crate) use cancel::{CallerWorkspace, caller_workspace_in};
pub(crate) use cancel::{
- cancel_all, cancel_by_session_in_workspace, cancel_by_task, cancel_for_thread, stop_for_thread,
- CancelledSubagent,
+ CancelledSubagent, cancel_all, cancel_by_session_in_workspace, cancel_by_task,
+ cancel_for_thread, stop_for_thread,
};
-pub(crate) use registry::{admit_spawn, register, status_channel, RegistrationError};
+pub(crate) use registry::{RegistrationError, admit_spawn, register, status_channel};
pub(crate) use resolve::{resume_ref_for_task_in_workspace, task_id_for_session_in_workspace};
pub(crate) use roster::active_subagents_context_block;
pub(crate) use steering::steer_control;
-pub use steering::{steer, SteerError};
+pub use steering::{SteerError, steer};
#[cfg(test)]
pub(crate) use task_ledger::task_records;
pub(crate) use task_ledger::{reconcile_orphaned_tasks_on_boot, task_record_for_task_in_workspace};
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 edbb8e5326..c0d2a4c25f 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::{
- spawn_status_watcher, DetachedSubagentStatus, SubagentIdentity, WaitError,
+ DetachedSubagentStatus, SubagentIdentity, WaitError, spawn_status_watcher,
};
#[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 6f9264bd0e..04608bd842 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs
@@ -6,9 +6,8 @@
use std::path::Path;
use tinyagents_orchestration::subagent::{
- 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,
+ 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,
};
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 ef23956cec..65a69b7f4f 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::{snapshot_for_owner, SubagentSnapshot};
+use tinyagents_orchestration::subagent::{SubagentSnapshot, snapshot_for_owner};
use super::registry::{admit_workspace, owner_key, registry};
use crate::agent::orchestration::fleet_tools::FleetToolSet;
@@ -114,8 +114,8 @@ pub(crate) fn active_subagents_context_block(
.collect(),
Err(err) => {
log::warn!(
- "[running_subagents] durable roster load failed parent_session={parent_session} error={err}"
- );
+ "[running_subagents] durable roster load failed parent_session={parent_session} error={err}"
+ );
Vec::new()
}
};
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 a569723274..c51dd49d5d 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::{steer_detached, SteerAccess};
+use tinyagents_orchestration::subagent::{SteerAccess, steer_detached};
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 ffec82d723..72446611f9 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::{
- list_subagent_records, orphaned_subagent_reason, record_agent_id,
+ SpawnedSubagent, WaitError, 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, SpawnedSubagent, WaitError,
+ subagent_record_for_task, task_status_label,
};
use tinyagents_tasks::{
- reconcile_orphaned_tasks, DriverTaskStore, InMemoryTaskStore, OrchestrationTaskFilter,
- OrchestrationTaskRecord, TaskStore, TaskStoreRegistry,
+ DriverTaskStore, InMemoryTaskStore, OrchestrationTaskFilter, OrchestrationTaskRecord,
+ TaskStore, TaskStoreRegistry, reconcile_orphaned_tasks,
};
#[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 c1c4a74133..15e8f92e3d 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::{
- record_to_wait_outcome, task_status_label, wait_detached, WaitError, WaitOutcome,
+ WaitError, WaitOutcome, record_to_wait_outcome, task_status_label, wait_detached,
};
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 d61a7a81a2..f1ceacc7ce 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,9 +584,11 @@ 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 26f2705bf9..d2d1078b71 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -20,7 +20,7 @@ use tinyagents_harness::run_queue::{QueueLane, RunQueue};
use tinyagents_harness::steering::{SteeringCommand, SteeringHandle};
use tinyagents_orchestration::subagent::FinishedOutcome;
use tinyagents_orchestration::subagent::{
- DetachedSubagentStatus, WaitError, WaitOutcome, DETACHED_LEDGER_TIMEOUT_MS,
+ DETACHED_LEDGER_TIMEOUT_MS, DetachedSubagentStatus, WaitError, WaitOutcome,
};
use tinyagents_tasks::OrchestrationTaskStatus;
use tokio::sync::watch;
@@ -280,13 +280,15 @@ 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.
@@ -367,13 +369,15 @@ 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 {
@@ -522,15 +526,17 @@ 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");
}
@@ -578,15 +584,17 @@ 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.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs
index 6860762134..fbb9671e4e 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel.rs
@@ -32,13 +32,13 @@ mod staging;
mod types;
mod workers;
-pub(crate) use collect::{format_spawn_parallel_success, SpawnParallelGraphOutcome};
+pub(crate) use collect::{SpawnParallelGraphOutcome, format_spawn_parallel_success};
pub(crate) use run::run_spawn_parallel_tasks_with_cancellation_and_workspace;
pub(crate) use types::ParallelAgentTask;
#[cfg(test)]
pub(crate) use staging::{
- prepare_spawn_parallel_tasks_from_defs, ParallelTaskRejectionKind, SpawnParallelTaskPreflight,
+ ParallelTaskRejectionKind, SpawnParallelTaskPreflight, prepare_spawn_parallel_tasks_from_defs,
};
#[cfg(test)]
pub(crate) use types::{ParallelAgentLineage, ParallelAgentResult, ParallelAgentStatus};
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 3470262afd..33f8374f10 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
@@ -18,8 +18,8 @@ use crate::agent::progress::AgentProgress;
use tinyagents_definition::SandboxMode;
use super::staging::{
- prepare_spawn_parallel_tasks_from_defs, worktree_request_for_task, ParallelTaskRejectionKind,
- ParallelWorktreeRequest, SpawnParallelTaskPreflight,
+ ParallelTaskRejectionKind, ParallelWorktreeRequest, SpawnParallelTaskPreflight,
+ prepare_spawn_parallel_tasks_from_defs, worktree_request_for_task,
};
use super::types::{
ParallelAgentLineage, ParallelAgentResult, ParallelAgentStatus, ParallelAgentTask,
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs
index c2f4f9be65..6e28bb7a82 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/run.rs
@@ -14,7 +14,7 @@ use tinytools::WorkspaceDescriptor;
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use super::collect::{
- collect_spawn_parallel_results, project_spawn_parallel_result, SpawnParallelGraphOutcome,
+ SpawnParallelGraphOutcome, collect_spawn_parallel_results, project_spawn_parallel_result,
};
use super::dispatch::stage_spawn_parallel_workers_from_defs;
use super::staging::snapshot_agent_definitions;
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs
index 235628e19a..aa674cf473 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/staging.rs
@@ -15,7 +15,7 @@ use std::path::PathBuf;
use std::cell::RefCell;
-use tinyagents_graph::parallel::{parse_relative_claim_paths, ClaimConflict, ClaimPathError};
+use tinyagents_graph::parallel::{ClaimConflict, ClaimPathError, parse_relative_claim_paths};
use tinyagents_orchestration::parallel::WorkerDispatchMode;
use tinyagents_orchestration::parallel::{
AdmissionPolicy, AdmissionVerdict, Plan, Preflight, Rejection, RejectionKind, Task,
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 527d42a7f8..049bf69a49 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::{resolve_concurrency, run, Worker};
+use tinyagents_orchestration::parallel::{Worker, resolve_concurrency, run};
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
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 4214ba6365..9250b771d4 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
@@ -128,12 +128,14 @@ 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);
@@ -144,14 +146,16 @@ 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 445c93f1b8..0cf5de3a91 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::documents::Repo;
use crate::storage::DocumentStoreExt;
+use crate::storage::documents::Repo;
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 885846ceb4..b0f1841397 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,10 +35,12 @@ 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]
@@ -76,10 +78,11 @@ 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());
}
@@ -112,10 +115,11 @@ 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/tools.rs b/crates/openhuman-core/src/agent/orchestration/tools.rs
index 4f4c87a692..57684c3366 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools.rs
@@ -75,7 +75,7 @@ pub(crate) fn live_parent_run_context(
pub use archetype_delegation::{ArchetypeDelegationTool, DelegationTarget};
pub(crate) use close_subagent::CloseSubagentDispatch;
pub use close_subagent::CloseSubagentTool;
-pub use collapsed_delegation::{CollapsedDelegationTool, DelegateTarget, DELEGATE_TO_TOOL_NAME};
+pub use collapsed_delegation::{CollapsedDelegationTool, DELEGATE_TO_TOOL_NAME, DelegateTarget};
pub(crate) use continue_subagent::ContinueSubagentDispatch;
pub use continue_subagent::ContinueSubagentTool;
pub(crate) use delegate_graph::DelegateGraphDispatch;
@@ -83,7 +83,7 @@ pub use delegate_graph::DelegateGraphTool;
pub(crate) use list_subagents::ListSubagentsDispatch;
pub use list_subagents::ListSubagentsTool;
pub(crate) use spawn_async_subagent::SpawnAsyncSubagentDispatch;
-pub use spawn_async_subagent::{scope_spawn_async_subagent_spec, SpawnAsyncSubagentTool};
+pub use spawn_async_subagent::{SpawnAsyncSubagentTool, scope_spawn_async_subagent_spec};
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.rs b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs
index ccd3737059..ae2b4778eb 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs
@@ -1,6 +1,6 @@
use async_trait::async_trait;
-use serde_json::json;
use serde_json::Value;
+use serde_json::json;
use tinytools::ToolRunContext;
use tinytools::{
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs
index 5a1055a2e0..38790dabf8 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs
@@ -56,7 +56,7 @@
//! [`ToolExposure::Hidden`]: tinytools::ToolExposure::Hidden
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
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.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
index 76a9341f32..86c4ccfd5d 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -12,8 +12,8 @@ use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- continue_subagent, continue_subagent_with_parent, load_subagent_checkpoint, SubagentRunOptions,
- SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, continue_subagent, continue_subagent_with_parent,
+ load_subagent_checkpoint,
};
use async_trait::async_trait;
use serde_json::json;
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
index c0bfc6a94c..9e2a07d851 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs
@@ -3,7 +3,7 @@
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
use async_trait::async_trait;
use std::sync::Arc;
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 fc02e5b6e4..4aa2091b40 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::{
- dispatch_targets_from_schema, CollapsedDelegationTool, DelegateTarget,
+ CollapsedDelegationTool, DelegateTarget, dispatch_targets_from_schema,
};
use super::super::delegate_graph::DelegateGraphDispatch;
use crate::agent::tools::DelegateToolDispatch;
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 1fb247e75d..5170e558f1 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
@@ -3,11 +3,13 @@ use super::*;
#[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.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
index fe8421b4e1..22f13357b7 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
@@ -15,7 +15,7 @@ use crate::agent::orchestration::subagent_sessions::{
use crate::agent::orchestration::tools::dispatch::incomplete_stop;
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunStatus, run_subagent_with_parent,
};
use crate::core::runtime::DispatchCtx;
use crate::threads::store::{self as conversations, ConversationMessage};
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 75a5947c5d..549df3e4d1 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
@@ -299,9 +299,10 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {
.iter()
.filter_map(|v| v.as_str())
.collect();
- assert!(next
- .iter()
- .any(|a| a.contains("delivered to you automatically")));
+ assert!(
+ next.iter()
+ .any(|a| a.contains("delivered to you automatically"))
+ );
let message = format_async_subagent_accepted("task_manager_agent", &serialized, &fleet);
let prose = message.split("[async_subagent_ref]").next().unwrap();
@@ -613,8 +614,10 @@ fn scoped_instance_advertises_exactly_the_allowlist() {
schema["properties"]["agent_id"]["enum"],
serde_json::json!(["agent_memory", "workflow_builder"])
);
- assert!(schema["properties"]["agent_id"]["description"]
- .as_str()
- .unwrap_or_default()
- .contains("only these are dispatchable"));
+ assert!(
+ schema["properties"]["agent_id"]["description"]
+ .as_str()
+ .unwrap_or_default()
+ .contains("only these are dispatchable")
+ );
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
index 59298d73e9..cac55f3020 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
@@ -7,8 +7,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::{
- format_spawn_parallel_success, run_spawn_parallel_tasks_with_cancellation_and_workspace,
- SpawnParallelGraphOutcome,
+ SpawnParallelGraphOutcome, format_spawn_parallel_success,
+ run_spawn_parallel_tasks_with_cancellation_and_workspace,
};
use async_trait::async_trait;
use serde_json::json;
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 449c958c51..a8f0bb1e03 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,12 +210,16 @@ 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]
@@ -303,9 +307,11 @@ 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 1cd1d6c488..c2bb3c40b5 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,20 +1,20 @@
use super::*;
+use crate::agent::OpenHumanSessionHost;
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::harness::host_definition::AgentDefinition;
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::spawn_parallel::{
- prepare_spawn_parallel_tasks_from_defs, ParallelTaskRejectionKind, SpawnParallelTaskPreflight,
+ ParallelTaskRejectionKind, SpawnParallelTaskPreflight, prepare_spawn_parallel_tasks_from_defs,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
-use crate::agent::OpenHumanSessionHost;
use crate::config::AgentConfig;
use async_trait::async_trait;
use parking_lot::Mutex;
use serde_json::json;
use std::collections::HashMap;
use std::sync::{
- atomic::{AtomicUsize, Ordering},
Arc,
+ atomic::{AtomicUsize, Ordering},
};
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::{sleep, timeout, Duration};
+use tokio::time::{Duration, sleep, timeout};
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.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
index 7359c187e0..de0ab4b3c5 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs
@@ -16,7 +16,7 @@ use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::orchestration::tools::dispatch::{incomplete_stop, stopped_subagent_result};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
- run_subagent_with_parent, SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus,
+ SubagentRunOptions, SubagentRunOutcome, SubagentRunStatus, run_subagent_with_parent,
};
use crate::core::runtime::DispatchCtx;
use crate::threads::store::{self as conversations, ConversationMessage, CreateConversationThread};
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 50d10575ff..fbd7fcc4dd 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs
@@ -51,11 +51,13 @@ fn parameters_schema_advertises_dedicated_thread_flag() {
assert_eq!(flag.get("type").and_then(|v| v.as_str()), Some("boolean"));
// Must be off by default — workers are an opt-in escape hatch, not
// a free upgrade for every spawn.
- assert!(schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
- .unwrap_or(true));
+ assert!(
+ schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("dedicated_thread")))
+ .unwrap_or(true)
+ );
}
#[test]
@@ -65,11 +67,13 @@ fn parameters_schema_advertises_optional_model_override() {
let props = schema.get("properties").expect("schema has properties");
let model = props.get("model").expect("model override advertised");
assert_eq!(model.get("type").and_then(|v| v.as_str()), Some("string"));
- assert!(schema
- .get("required")
- .and_then(|v| v.as_array())
- .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
- .unwrap_or(true));
+ assert!(
+ schema
+ .get("required")
+ .and_then(|v| v.as_array())
+ .map(|arr| arr.iter().all(|s| s.as_str() != Some("model")))
+ .unwrap_or(true)
+ );
}
#[test]
@@ -232,9 +236,11 @@ async fn legacy_archetype_alias_is_accepted_for_lookup() {
.await
.unwrap();
assert!(result.is_error);
- assert!(result
- .output()
- .contains("unknown agent_id 'totally_made_up'"));
+ assert!(
+ result
+ .output()
+ .contains("unknown agent_id 'totally_made_up'")
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
index 54f4bfdc25..5a9ef4ab45 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
@@ -10,7 +10,7 @@
//! another worker thread.
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
-use crate::agent::subagent_host::{run_subagent_with_parent, SubagentRunOptions};
+use crate::agent::subagent_host::{SubagentRunOptions, run_subagent_with_parent};
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/spawn_worker_thread_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs
index bfe5833de8..2f753c8705 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs
@@ -62,9 +62,11 @@ 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]
@@ -89,9 +91,11 @@ 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 {
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 85c1ab060b..6784e639ba 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::error::TrySendError;
use tokio::sync::mpsc::Sender;
+use tokio::sync::mpsc::error::TrySendError;
use crate::agent::progress::AgentProgress;
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 d4d4a186f5..f32f89a0bd 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,6 +1,6 @@
use super::{ArchetypeDelegationTool, DelegationTarget, SpawnSubagentTool, SpawnWorkerThreadTool};
-use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::harness::ParentExecutionContext;
+use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::prompts::ConnectedIntegration;
use crate::threads::store as conversations;
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs
index b686bfad6b..c1211796f8 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine/lifecycle.rs
@@ -2,10 +2,10 @@
//! that drives a run's phase DAG to completion.
use crate::core::runtime::DispatchCtx;
-use anyhow::{anyhow, Context, Result};
+use anyhow::{Context, Result, anyhow};
use serde_json::Value;
use std::sync::Arc;
-use tinyagents_orchestration::workflow::{reset_running_phases, WorkflowEngine};
+use tinyagents_orchestration::workflow::{WorkflowEngine, reset_running_phases};
use crate::agent::harness::ParentExecutionContext;
use crate::agent::orchestration::parent_context::with_root_parent;
@@ -15,11 +15,11 @@ use tinyagents_session::run_ledger::{WorkflowRun, WorkflowRunStatus, WorkflowRun
use super::super::ops::{
compare_and_swap_workflow_run_lifecycle, definition_by_id, get_workflow_run, workflow_store,
};
+use super::LOG_TARGET;
use super::cancel::{
- cancel_signal_if_current, clear_cancel_signal, is_current_cancel_signal, lookup_cancel_signal,
- register_cancel_signal, replace_cancel_signal, WorkflowCancelSignal,
+ WorkflowCancelSignal, cancel_signal_if_current, clear_cancel_signal, is_current_cancel_signal,
+ lookup_cancel_signal, register_cancel_signal, replace_cancel_signal,
};
-use super::LOG_TARGET;
use tinyagents_orchestration::workflow::WorkflowDefinition;
/// Start a new workflow run and return immediately.
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
index 4fa9c7bbee..81a76fc2c3 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
@@ -2,7 +2,7 @@
use std::sync::Arc;
-use anyhow::{anyhow, Result};
+use anyhow::{Result, anyhow};
use async_trait::async_trait;
use serde_json::json;
use tinyagents_harness::CancellationToken;
@@ -11,8 +11,8 @@ use tinyagents_orchestration::workflow::{
WorkflowDefinition, WorkflowExecutor,
};
-use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::agent::harness::ParentExecutionContext;
+use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use tinyagents_definition::{SandboxMode, ToolScope};
use {
crate::agent::orchestration::AgentOrchestrationSession,
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/mod.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/mod.rs
index 8a568aa782..cfc5eb9d82 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/mod.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/mod.rs
@@ -27,8 +27,8 @@ mod schemas;
pub use engine::{resume_workflow_run, start_workflow_run, stop_workflow_run};
pub use ops::{
- builtin_definitions, definition_by_id, get_run, list_definitions, list_runs,
- PARALLEL_RESEARCH_ID,
+ PARALLEL_RESEARCH_ID, builtin_definitions, definition_by_id, get_run, list_definitions,
+ list_runs,
};
pub use schemas::{
all_controller_schemas as all_workflow_run_controller_schemas,
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops_tests.rs
index 7fe46fcb60..2e8282cbfc 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/ops_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use tinyagents_orchestration::workflow::{
- validate_agents, validate_structure, DefinitionError, WorkflowDefinition, WorkflowPhase,
+ DefinitionError, WorkflowDefinition, WorkflowPhase, validate_agents, validate_structure,
};
fn good_def() -> WorkflowDefinition {
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs
index 1f81e52761..a8ed0793da 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/schemas.rs
@@ -8,8 +8,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::WorkflowRunListRequest;
diff --git a/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs b/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs
index b5059136ed..3102e55c84 100644
--- a/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs
+++ b/crates/openhuman-core/src/agent/orchestration/worktree_schemas.rs
@@ -18,14 +18,14 @@
use crate::core::runtime::DispatchCtx;
use std::path::{Path, PathBuf};
-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};
use tinyagents_harness::workspace::{
- detect_worktree_overlaps, git_worktree_diff_summary, git_worktree_status, list_git_worktrees,
- remove_git_worktree, GitWorktreeError, GitWorktreeStatus, GIT_WORKTREE_SUBDIR,
+ GIT_WORKTREE_SUBDIR, GitWorktreeError, GitWorktreeStatus, detect_worktree_overlaps,
+ git_worktree_diff_summary, git_worktree_status, list_git_worktrees, remove_git_worktree,
};
/// Controller schemas exposed by the worktree manager.
diff --git a/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs b/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
index d52bd017ec..fa4dd03e1d 100644
--- a/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::core::runtime::DispatchCtx;
use std::process::Command;
-use tinyagents_harness::workspace::{create_git_worktree, GitWorktreeBaseRef, GitWorktreeStatus};
+use tinyagents_harness::workspace::{GitWorktreeBaseRef, GitWorktreeStatus, create_git_worktree};
/// `true` when `git` is invokable on this host. Tests that need real
/// `git worktree` plumbing skip (pass trivially) when it's absent, so a