The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
style: apply rustfmt import ordering and assertion formatting
Steven Enamakelb5e70af34d83
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents.rsindex 365835c62b..2088d157e5 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::{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;#[cfg(test)]-pub(crate) use registry::{register, status_channel, RegistrationError};+pub(crate) use registry::{RegistrationError, register, status_channel};pub(crate) use roster::active_subagents_context_block;pub use steering::steer;pub(crate) use steering::steer_control;diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rsindex 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.rsindex 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.rsindex 6d3ad37e94..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;diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rsindex a696ed18d8..83b615775d 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, SteerError};+use tinyagents_orchestration::subagent::{SteerAccess, SteerError, 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.rsindex 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.rsindex 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.rsindex 40716203c6..2a6ca43fa8 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.rsindex 3b3b14b550..443acd3940 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::{- DetachedSubagentStatus, WaitError, WaitOutcome, DETACHED_LEDGER_TIMEOUT_MS,+ DETACHED_LEDGER_TIMEOUT_MS, DetachedSubagentStatus, WaitError, WaitOutcome,};use tinyagents_tasks::OrchestrationTaskStatus;use tokio::sync::watch;@@ -281,13 +281,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.@@ -369,13 +371,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 {@@ -524,15 +528,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");}@@ -580,15 +586,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);