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
chore(orchestration): apply rustfmt import ordering and line wrapping
Steven Enamakelaef8fe8e0f12
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery.rsindex bf4725f37d..7b533ce642 100644--- a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs@@ -54,7 +54,7 @@ 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::{DrainFence, RECOVERY_BUSY_POLL};@@ -434,12 +434,13 @@ async fn try_deliver(}};let write_undelivered = move |records: &[CompletionRecord]| {- let attempts = records.iter().map(|record| record.attempts).max().unwrap_or(1);- let notice = build_undelivered_notice(- records,- attempts,- "the background delivery turn failed",- );+ let attempts = records+ .iter()+ .map(|record| record.attempts)+ .max()+ .unwrap_or(1);+ let notice =+ build_undelivered_notice(records, attempts, "the background delivery turn failed");if let Some(notice) = notice {let run_id = format!("bgdeliver-undelivered-{}", uuid::Uuid::new_v4());if let Err(error) = persist_delivery_reply(@@ -483,7 +484,9 @@ async fn try_deliver(.await};let retry_after = match outcome {- DeliveryOutcome::Failed { count, gave_up } if count > gave_up => Some(Duration::from_secs(2)),+ DeliveryOutcome::Failed { count, gave_up } if count > gave_up => {+ Some(Duration::from_secs(2))+ }_ => None,};// A failed turn that published no `AgentError` (a session checkout failure,diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery/slot.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery/slot.rsindex 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.rsindex 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_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery_tests.rsindex 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_rescheduled_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/delivery_drain_tests.rs b/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rsindex 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);