Skip to content

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

chore: files changed crates/openhuman-core/src/agent/goals/mod_tests.rs,crates/openhuman-core/src/ag

Steven Enamakel3bb94bab4476
diff --git a/crates/openhuman-core/src/agent/goals/mod_tests.rs b/crates/openhuman-core/src/agent/goals/mod_tests.rs
index 201a1f83d2..5d5c37485a 100644
--- a/crates/openhuman-core/src/agent/goals/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/mod_tests.rs
@@ -24,11 +24,9 @@ async fn goal_store_is_reused_within_a_context_and_isolated_between_agents() {
drop(first);
drop(repeated);
let reacquired = goal_store(first_workspace.path(), &first_dispatch);
- assert!(
- cache_owns_store
- .upgrade()
- .is_some_and(|cached| Arc::ptr_eq(&cached, &reacquired))
- );
+ assert!(cache_owns_store
+ .upgrade()
+ .is_some_and(|cached| Arc::ptr_eq(&cached, &reacquired)));
let isolated = goal_store(first_workspace.path(), &second_dispatch);
let other_workspace = goal_store(second_workspace.path(), &first_dispatch);
@@ -39,13 +37,11 @@ async fn goal_store_is_reused_within_a_context_and_isolated_between_agents() {
.set("same-thread", "agent a objective", None)
.await
.expect("write first agent goal");
- assert!(
- isolated
- .get("same-thread")
- .await
- .expect("read second agent goal")
- .is_none()
- );
+ assert!(isolated
+ .get("same-thread")
+ .await
+ .expect("read second agent goal")
+ .is_none());
}
#[tokio::test]
@@ -74,13 +70,11 @@ async fn goal_store_isolated_between_profiles_with_the_same_agent_and_thread() {
.set("shared-thread-id", "profile A objective", None)
.await
.expect("write profile A goal");
- assert!(
- store_b
- .get("shared-thread-id")
- .await
- .expect("read profile B goal")
- .is_none()
- );
+ assert!(store_b
+ .get("shared-thread-id")
+ .await
+ .expect("read profile B goal")
+ .is_none());
}
#[tokio::test]
@@ -150,13 +144,11 @@ async fn goal_tool_with_context_uses_the_business_goal_store() {
.await
.expect("execute without a thread");
assert!(no_thread.is_error);
- assert!(
- goal_store(workspace.path(), &dispatch)
- .get("goal-tool-business-store")
- .await
- .expect("confirm existing goal")
- .is_some()
- );
+ assert!(goal_store(workspace.path(), &dispatch)
+ .get("goal-tool-business-store")
+ .await
+ .expect("confirm existing goal")
+ .is_some());
})
.await;
}
diff --git a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs
index 2393a2fa24..ab2cd2665e 100644
--- a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs
+++ b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs
@@ -32,7 +32,7 @@ use serde_json::Value;
use tinyagents_harness::artifacts::tool_results::{self, ArtifactRead, ToolResultArtifactStore};
use tinystoragedrivers::BlobStore;
-use crate::agent::harness::artifact_offload::{READ_TOOL, SanitizingRedactor};
+use crate::agent::harness::artifact_offload::{SanitizingRedactor, READ_TOOL};
use tinytools_std::filesystem::FileReadTool;
/// Namespace of the artifact index in the run's store registry.
diff --git a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs
index 54293c37e9..7854784434 100644
--- a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs
@@ -131,14 +131,12 @@ async fn artifacts_are_tenant_scoped() {
fn read_targets_use_openhumans_tool_names() {
let path = "artifacts/tool-results/s/shell/c.txt";
assert!(artifact_read_target(None, "file_read", &json!({"path": path})).is_some());
- assert!(
- artifact_read_target(
- None,
- "use_skill",
- &json!({"skill": "files", "tool": "file_read", "args": {"path": path, "offset": 3}})
- )
- .is_some_and(|read| read.offset == 3)
- );
+ assert!(artifact_read_target(
+ None,
+ "use_skill",
+ &json!({"skill": "files", "tool": "file_read", "args": {"path": path, "offset": 3}})
+ )
+ .is_some_and(|read| read.offset == 3));
assert!(artifact_read_target(None, "glob", &json!({"path": path})).is_none());
}
@@ -150,22 +148,18 @@ fn read_targets_recognise_the_stores_blob_keys() {
let store = in_memory_tool_result_store(tmp.path().join("tool-results"), "s");
let pointer = store.path_for_read_tool("shell", Some("c"));
assert!(artifact_read_target(Some(&store), "file_read", &json!({"path": pointer})).is_some());
- assert!(
- artifact_read_target(
- Some(&store),
- "use_skill",
- &json!({"skill": "files", "tool": "file_read", "args": {"path": pointer, "offset": 3}})
- )
- .is_some_and(|read| read.offset == 3)
- );
- assert!(
- artifact_read_target(
- Some(&store),
- "file_read",
- &json!({"path": "tool-results-backup/s/x.txt"})
- )
- .is_none()
- );
+ assert!(artifact_read_target(
+ Some(&store),
+ "use_skill",
+ &json!({"skill": "files", "tool": "file_read", "args": {"path": pointer, "offset": 3}})
+ )
+ .is_some_and(|read| read.offset == 3));
+ assert!(artifact_read_target(
+ Some(&store),
+ "file_read",
+ &json!({"path": "tool-results-backup/s/x.txt"})
+ )
+ .is_none());
}
/// A continuation names `file_read` and the offset, in the wire format the
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions/store_adapter.rs b/crates/openhuman-core/src/agent/orchestration/background_completions/store_adapter.rs
index 7e051d9c5a..82a41708cf 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions/store_adapter.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions/store_adapter.rs
@@ -2,8 +2,8 @@
use super::*;
use tinyagents_tasks::{
- CompletionRouterPool, CompletionStoreReplaceOutcome, DEFAULT_MAX_ATTEMPTS,
- DriverCompletionStore, InMemoryCompletionStore,
+ CompletionRouterPool, CompletionStoreReplaceOutcome, DriverCompletionStore,
+ InMemoryCompletionStore, DEFAULT_MAX_ATTEMPTS,
};
pub(in crate::agent::orchestration) fn router_scope_for(
@@ -92,8 +92,8 @@ pub(in crate::agent::orchestration) fn router_pool() -> &'static CompletionRoute
}
#[cfg(test)]
-pub(in crate::agent::orchestration) fn test_store_overrides()
--> &'static Mutex<HashMap<RouterScope, Arc<dyn CompletionStore>>> {
+pub(in crate::agent::orchestration) fn test_store_overrides(
+) -> &'static Mutex<HashMap<RouterScope, Arc<dyn CompletionStore>>> {
static STORES: OnceLock<Mutex<HashMap<RouterScope, Arc<dyn CompletionStore>>>> =
OnceLock::new();
STORES.get_or_init(|| Mutex::new(HashMap::new()))
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions_pause_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_completions_pause_tests.rs
index e161a60158..1ebacd754c 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions_pause_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions_pause_tests.rs
@@ -158,12 +158,10 @@ fn delivered_pause_leaves_the_task_key_free_for_a_later_delivery() {
.receipt()
.expect("claimed completion has a settlement receipt");
assert_eq!(router.mark_delivered(&[completion_receipt]).unwrap(), 1);
- assert!(
- router
- .claim_pending("thread-sequential", usize::MAX)
- .unwrap()
- .is_empty()
- );
+ assert!(router
+ .claim_pending("thread-sequential", usize::MAX)
+ .unwrap()
+ .is_empty());
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
index ff0a9c8a70..4370547179 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
@@ -57,12 +57,10 @@ fn record_is_thread_scoped_and_batches_in_completion_order() {
let claimed = router.claim_pending("thread-A", usize::MAX).unwrap();
assert_eq!(claimed.len(), 2, "everything ready is claimed as one batch");
assert_eq!(claimed[0].result.text, "eiffel");
- assert!(
- router
- .claim_pending("thread-A", usize::MAX)
- .unwrap()
- .is_empty()
- );
+ assert!(router
+ .claim_pending("thread-A", usize::MAX)
+ .unwrap()
+ .is_empty());
}
#[test]
@@ -82,12 +80,10 @@ fn headless_completion_is_dropped() {
let _guard = test_guard();
let ws = workspace();
record(ws.path(), "sess-headless", "sub-1", "x", None);
- assert!(
- router_for_workspace(ws.path())
- .claim_pending("", usize::MAX)
- .unwrap()
- .is_empty()
- );
+ assert!(router_for_workspace(ws.path())
+ .claim_pending("", usize::MAX)
+ .unwrap()
+ .is_empty());
assert!(recover_pending_threads(&cx(), ws.path()).is_empty());
}
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
index e3dc5a1a74..7044b3197e 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery.rs
@@ -56,7 +56,7 @@ use slot::DeliverySlot;
use super::background_completions;
use super::busy_guard::is_busy;
#[cfg(test)]
-use super::busy_guard::{TurnBusy, busy, clear_busy_for_thread};
+use super::busy_guard::{busy, clear_busy_for_thread, TurnBusy};
use super::completion_notice::build_undelivered_notice;
use super::completion_owners;
use super::delivery_drain::{DrainFence, RECOVERY_BUSY_POLL};
@@ -64,9 +64,9 @@ use super::delivery_drain::{DrainFence, RECOVERY_BUSY_POLL};
mod delivery_events;
use crate::core::runtime::CoreContext;
#[cfg(test)]
-pub(super) use delivery_events::Drain;
-#[cfg(test)]
pub(super) use delivery_events::drain_schedule;
+#[cfg(test)]
+pub(super) use delivery_events::Drain;
pub(super) use delivery_events::{drain_schedule_in, owning_profiles};
/// Coalesce completions landing within this window into one delivery turn.
@@ -157,8 +157,8 @@ fn schedule_delivery_inner(
.push((thread_id.clone(), delay));
#[cfg(not(test))]
let _ = delay; // The owner applies debounce/recovery timing inside its delivery API.
- // Scoped: the thread -> workspace table is keyed per profile, so the
- // delayed task must run under the profile that scheduled it.
+ // Scoped: the thread -> workspace table is keyed per profile, so the
+ // delayed task must run under the profile that scheduled it.
ctx.clone().spawn(async move {
let outcome = try_deliver(ctx.clone(), thread_id.clone(), fence.clone(), wait_idle).await;
if outcome == DeliveryOutcome::ParentBusy {
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 08377e20af..70fb5ab9eb 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::{CompletionReceipt, CompletionRouter};
-use crate::core::runtime::DispatchCtx;
use crate::core::runtime::tenant;
+use crate::core::runtime::DispatchCtx;
/// 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 316ab8580b..f4101dc0e8 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,8 +5,8 @@
use super::*;
use crate::agent::orchestration::background_completions::{
- TestWorkspace, pending_for_ctx, record_completion, router_for_workspace,
- router_for_workspace_ctx,
+ pending_for_ctx, record_completion, router_for_workspace, router_for_workspace_ctx,
+ TestWorkspace,
};
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.rs
index edf37dd14f..ad766f77a5 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::{
- TestWorkspace, forget_workspace_for_test, pending_for, record_completion, router_for_workspace,
+ forget_workspace_for_test, pending_for, record_completion, router_for_workspace, TestWorkspace,
};
use std::path::Path;
use std::sync::atomic::{AtomicU32, Ordering};
@@ -510,12 +510,10 @@ 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 {
@@ -680,12 +678,10 @@ 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/running_subagents/steering.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs
index ebd72e0521..9d68c3e8c7 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::steering::{SteerAccess, SteerError, steer_detached};
+use tinyagents_orchestration::steering::{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_projection_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_projection_tests.rs
index 6961345249..0485416736 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_projection_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_projection_tests.rs
@@ -96,26 +96,18 @@ async fn explicit_profile_projects_spawn_completion_and_cancel_without_ambient_s
let alice_spawned = records(&alice, workspace.path());
let bob_spawned = records(&bob, workspace.path());
- assert!(
- alice_spawned
- .iter()
- .any(|row| row.spec.task_id.as_str() == alice_task)
- );
- assert!(
- alice_spawned
- .iter()
- .all(|row| row.spec.task_id.as_str() != bob_task)
- );
- assert!(
- bob_spawned
- .iter()
- .any(|row| row.spec.task_id.as_str() == bob_task)
- );
- assert!(
- bob_spawned
- .iter()
- .all(|row| row.spec.task_id.as_str() != alice_task)
- );
+ assert!(alice_spawned
+ .iter()
+ .any(|row| row.spec.task_id.as_str() == alice_task));
+ assert!(alice_spawned
+ .iter()
+ .all(|row| row.spec.task_id.as_str() != bob_task));
+ assert!(bob_spawned
+ .iter()
+ .any(|row| row.spec.task_id.as_str() == bob_task));
+ assert!(bob_spawned
+ .iter()
+ .all(|row| row.spec.task_id.as_str() != alice_task));
alice_tx
.send(DetachedSubagentStatus::Completed {
@@ -213,9 +205,7 @@ async fn cancellation_projection_uses_the_captured_profile_store() {
.find(|row| row.spec.task_id.as_str() == task_id)
.expect("Alice cancellation is persisted to Alice's profile store");
assert_eq!(alice_row.status, OrchestrationTaskStatus::Cancelled);
- assert!(
- records(&bob, workspace.path())
- .iter()
- .all(|row| row.spec.task_id.as_str() != task_id)
- );
+ assert!(records(&bob, workspace.path())
+ .iter()
+ .all(|row| row.spec.task_id.as_str() != task_id));
}
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 b819eb11ea..f63c1851a2 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
@@ -568,11 +568,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(),
@@ -599,11 +597,9 @@ async fn saas_controls_follow_the_explicit_context_not_the_tasks_scope() {
"alice reaches her own worker"
);
assert_eq!(b_side.unwrap(), (true, true), "bob reaches his own worker");
- assert!(
- snapshot_for_parent(&alice, PARENT)
- .iter()
- .all(|worker| worker.task_id != a_task)
- );
+ assert!(snapshot_for_parent(&alice, PARENT)
+ .iter()
+ .all(|worker| worker.task_id != a_task));
}
#[tokio::test]
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 3965475e04..4e8237baa3 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;
@@ -284,15 +284,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.
@@ -374,15 +372,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 {
@@ -531,17 +527,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");
}
@@ -589,17 +583,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/subagent_sessions/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/ops_tests.rs
index d583ee1885..5f1f932993 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
@@ -108,51 +108,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());
@@ -230,14 +222,12 @@ fn driver_task_cancel_reports_legacy_failure_and_refuses_ambiguous_ids() {
.unwrap()
.is_none()
);
- assert!(
- store
- .load()
- .unwrap()
- .iter()
- .filter(|row| row.current_task_id.as_deref() == Some("same-public-id"))
- .all(|row| row.status == DurableSubagentStatus::Running)
- );
+ assert!(store
+ .load()
+ .unwrap()
+ .iter()
+ .filter(|row| row.current_task_id.as_deref() == Some("same-public-id"))
+ .all(|row| row.status == DurableSubagentStatus::Running));
}
#[test]
@@ -506,16 +496,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]
@@ -576,14 +564,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);
@@ -594,16 +580,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/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/spawn_async_subagent_completion.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_completion.rs
index 478699d0fa..5716df1300 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/tools_e2e_continuation_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
index dcd661fa21..0c39f4d048 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
@@ -308,11 +308,10 @@ async fn cancelling_a_paused_driver_through_rpc_settles_once_with_its_reason() {
.find(|row| row.current_task_id.as_deref() == Some(task_id.as_str()))
.expect("cancelled durable session remains available");
assert_eq!(row.status, DurableSubagentStatus::Failed);
- assert!(
- row.latest_error
- .as_deref()
- .is_some_and(|error| error.contains("user requested stop"))
- );
+ assert!(row
+ .latest_error
+ .as_deref()
+ .is_some_and(|error| error.contains("user requested stop")));
let deliveries = pending_for(workspace.path(), "paused-cancel-rpc-thread");
assert_eq!(deliveries.len(), 1);
assert_eq!(deliveries[0].status, CompletionStatus::Failed);
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs
index 6f5a824ecf..27c09f9fa5 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_workspace_owner_tests.rs
@@ -5,7 +5,7 @@ async fn driver_job_controls_are_isolated_by_workspace_with_shared_runtime_state
use crate::agent::orchestration::subagent_sessions::{
DurableSubagentSession, DurableSubagentStatus, SubagentSessionStore,
};
- use crate::agent::subagent_host::{SubagentRunOptions, run_subagent_via_driver_tool};
+ use crate::agent::subagent_host::{run_subagent_via_driver_tool, SubagentRunOptions};
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
use crate::tools::toolpacks::ToolGroups;
use tinyagents_harness::agent_loop::phases::execute_tool_batch;
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
index 6d0754ae85..f860502917 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests.rs
@@ -396,7 +396,7 @@ fn the_no_tools_sentinel_can_never_name_a_real_tool() {
#[test]
fn is_empty_tool_scope_distinguishes_the_three_states() {
- use crate::agent_registry::host_definition::{NO_TOOLS_SENTINEL, is_empty_tool_scope};
+ use crate::agent_registry::host_definition::{is_empty_tool_scope, NO_TOOLS_SENTINEL};
use std::collections::HashSet;
// Unset — the historical "everything" sentinel.
@@ -468,19 +468,15 @@ fn the_repl_tools_join_a_belt_only_while_handle_mode_is_active() {
let mut inactive = belt();
super::ensure_repl_tools_visible(&mut inactive, false);
- assert!(
- tinyjuice_bus::tools::REPL_TOOLS
- .iter()
- .all(|n| !inactive.contains(*n))
- );
+ assert!(tinyjuice_bus::tools::REPL_TOOLS
+ .iter()
+ .all(|n| !inactive.contains(*n)));
let mut active = belt();
super::ensure_repl_tools_visible(&mut active, true);
- assert!(
- tinyjuice_bus::tools::REPL_TOOLS
- .iter()
- .all(|n| active.contains(*n))
- );
+ assert!(tinyjuice_bus::tools::REPL_TOOLS
+ .iter()
+ .all(|n| active.contains(*n)));
// "No filter" and "deliberately no tools" both stay as they were.
let mut unfiltered = std::collections::HashSet::new();
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
index 2503c55d2d..36d9adc52e 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_host_tools_tests.rs
@@ -6,8 +6,8 @@
//! real tool: it is on the belt, and it is advertised.
use super::*;
-use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Arc;
/// A tool that does nothing but be present under a name nothing else uses.
#[derive(Debug)]
@@ -461,11 +461,9 @@ fn permanent_metadata_without_a_source_is_rejected_before_build() {
)
.err()
.expect("inconsistent permanent metadata must be rejected");
- assert!(
- error
- .to_string()
- .contains("permanent tool must have exactly one source: missing_source")
- );
+ assert!(error
+ .to_string()
+ .contains("permanent tool must have exactly one source: missing_source"));
}
/// The factory is told the context the session is built under, not the
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs
index 9df1feb257..edd3cd3d0c 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_tests_session_definition_tests.rs
@@ -214,11 +214,9 @@ async fn a_padded_name_is_stored_as_the_definitions_own_id() {
.expect("a name that differs only by padding is not a contradiction");
assert_eq!(agent.agent_definition_name(), SEAT);
- assert!(
- catalogue(&agent)
- .resolve(agent.agent_definition_name())
- .await
- .expect("resolution never errors")
- .is_some()
- );
+ assert!(catalogue(&agent)
+ .resolve(agent.agent_definition_name())
+ .await
+ .expect("resolution never errors")
+ .is_some());
}
diff --git a/crates/openhuman-core/src/agent/session_host/builder/host_only.rs b/crates/openhuman-core/src/agent/session_host/builder/host_only.rs
index 4dbafa2fdb..198c4ca82b 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/host_only.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/host_only.rs
@@ -29,8 +29,8 @@ use tinyagents_harness::context::RunContext;
use tinyagents_harness::middleware::{PolicyDecision, ToolCallPolicy};
use tinyinference_llm::tool::ToolCall;
-use crate::agent::OpenHumanSessionHost;
use crate::agent::tinyagents::host::OpenHumanRunContext;
+use crate::agent::OpenHumanSessionHost;
use crate::config::Config;
use anyhow::Result;
use tinyagents_definition::{SandboxMode, ToolScope};
@@ -45,8 +45,8 @@ pub struct HostOnlyToolPolicy {
host: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
}
@@ -59,8 +59,8 @@ impl HostOnlyToolPolicy {
host: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
) -> Self {
@@ -112,15 +112,15 @@ pub(super) fn session_policy(
host: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
) -> Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
> {
if !host_only {
diff --git a/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs b/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
index e544c03186..583c1eb887 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/host_tools.rs
@@ -64,8 +64,8 @@ pub struct HostTurnTools {
pub policy: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
}
@@ -180,8 +180,8 @@ impl HostTurnTools {
mut self,
policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
) -> Self {
self.policy = Some(policy);
@@ -205,8 +205,8 @@ pub(super) struct MergedHostTurnTools {
pub policy: Option<
Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
>,
pub withheld: HashSet<String>,
diff --git a/crates/openhuman-core/src/agent/session_host/builder/setters.rs b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
index 88781ae22a..448e2cb9ef 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/setters.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
@@ -378,8 +378,8 @@ impl SessionHostBuilder {
mut self,
policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
) -> Self {
self.tool_policy = Some(policy);
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rs
index 896a14c126..08a9f43f6e 100644
--- a/crates/openhuman-core/src/agent/session_host/driver.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver.rs
@@ -18,7 +18,7 @@ use tinyinference_llm::message::Message;
use tinytools_agent::dialect::ToolDialect;
use crate::agent::tinyagents::{
- TurnModelSource, TurnSpec, host::OpenHumanHostBase, host::OpenHumanRunContext,
+ host::OpenHumanHostBase, host::OpenHumanRunContext, TurnModelSource, TurnSpec,
};
/// Immutable host composition consumed by [`OpenHumanSessionDriver`].
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
index d60af1ec68..ef2f7ac37f 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
@@ -23,7 +23,7 @@ use crate::agent::{
},
tinyagents::{SupplementalTrace, TinyagentsTurnOutcome, TurnModelSource},
};
-use crate::inference::provider::{AGENT_TURN_MAX_OUTPUT_TOKENS, BilledUsage};
+use crate::inference::provider::{BilledUsage, AGENT_TURN_MAX_OUTPUT_TOKENS};
/// Accounting from model calls performed after the harness loop has ended.
#[derive(Default)]
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
index 93d29b87ec..f9de522431 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
@@ -520,14 +520,12 @@ async fn timed_out_repair_keeps_the_usage_of_its_answered_call() {
};
// A full channel whose receiver is alive: the correction's send blocks.
let (progress, _receiver) = tokio::sync::mpsc::channel(1);
- assert!(
- progress
- .try_send(AgentProgress::TextDelta {
- delta: "earlier".into(),
- iteration: 1,
- })
- .is_ok()
- );
+ assert!(progress
+ .try_send(AgentProgress::TextDelta {
+ delta: "earlier".into(),
+ iteration: 1,
+ })
+ .is_ok());
let mut usage = RepairUsage::for_model("test-model");
let repaired = tokio::time::timeout(
diff --git a/crates/openhuman-core/src/agent/session_host/driver_tests.rs b/crates/openhuman-core/src/agent/session_host/driver_tests.rs
index f3fb30ee20..0b25d057c1 100644
--- a/crates/openhuman-core/src/agent/session_host/driver_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver_tests.rs
@@ -1,7 +1,7 @@
use super::*;
-fn sidecar()
--> std::sync::Arc<std::sync::Mutex<crate::agent::tinyagents::host::run_context::SessionTurnSidecar>>
+fn sidecar(
+) -> std::sync::Arc<std::sync::Mutex<crate::agent::tinyagents::host::run_context::SessionTurnSidecar>>
{
crate::agent::tinyagents::host::OpenHumanRunContext::new()
.session_sidecar
@@ -32,13 +32,11 @@ fn graph_failure_persists_only_accepted_snapshot_history() {
assert_eq!(partial.history.len(), 2);
assert_eq!(partial.history[0].text(), "stable prefix");
assert_eq!(partial.history[1].text(), "request");
- assert!(
- partial
- .partial
- .expect("display partial")
- .content
- .contains("provider rejected follow-up")
- );
+ assert!(partial
+ .partial
+ .expect("display partial")
+ .content
+ .contains("provider rejected follow-up"));
}
#[test]
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
index 434024bf1e..d993a1705c 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
@@ -70,12 +70,10 @@ fn codec_marks_failed_tool_rows_from_the_explicit_turn_sidecar() {
},
)
.unwrap();
- assert!(
- rows[0]
- .tool_failure
- .as_ref()
- .is_some_and(|failure| failure.failed)
- );
+ assert!(rows[0]
+ .tool_failure
+ .as_ref()
+ .is_some_and(|failure| failure.failed));
}
/// The durable record is the parent's OWN spend.
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index 27739ccc3c..186e46dd66 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -39,7 +39,7 @@ use super::types::OpenHumanSessionHost;
use crate::agent::{
message_convert::{user_message_from_text, user_text_with_markers},
session_host::{
- OpenHumanSessionHooks, OpenHumanTranscriptCodec, driver::OpenHumanSessionDriver,
+ driver::OpenHumanSessionDriver, OpenHumanSessionHooks, OpenHumanTranscriptCodec,
},
tinyagents::{host::OpenHumanRunContext, middleware::turn_context::TurnContextMiddleware},
};
@@ -86,8 +86,8 @@ struct OpenHumanTurnPrelude {
context_config: crate::config::ContextConfig,
tool_policy: Arc<
dyn tinyagents_harness::middleware::ToolCallPolicy<
- crate::agent::tinyagents::host::OpenHumanRunContext,
- >,
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
>,
tool_dispatcher: Arc<dyn tinytools_agent::dialect::ToolDialect>,
workspace_dir: std::path::PathBuf,
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
index 54fe438700..2137af49b0 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/permanent_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use std::{collections::HashSet, sync::Arc};
-use tinyagents_session::transcript::{SessionRef, session_stem};
+use tinyagents_session::transcript::{session_stem, SessionRef};
use tinyinference_llm::message::Message;
use tinytools::ToolSpec;
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
index f7b641d5a8..fd1d329616 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
@@ -76,7 +76,7 @@ async fn committed_progress_uses_each_turns_receipt_sender() {
#[tokio::test]
async fn committed_progress_carries_the_sidecar_stop_on_turn_completed() {
use crate::progress::AgentProgress;
- use tinyagents_harness::{TurnFailureClass, TurnStop, turn_stop::TurnStopKind};
+ use tinyagents_harness::{turn_stop::TurnStopKind, TurnFailureClass, TurnStop};
use tinyagents_runtime::{
CommitReceipt, ResumeMode, SessionTurnOutcome, TranscriptTurnOptions,
};
@@ -268,14 +268,12 @@ fn connected_mcp_actions_enter_search_and_leave_on_disconnect() {
.clear();
prelude.refresh_delegation_tool_surface().unwrap();
assert!(!synthesized_tool_names(&prelude).contains(&action));
- assert!(
- !prelude
- .tool_surface
- .lock()
- .expect("tool surface")
- .deferred_tool_names
- .contains(&action)
- );
+ assert!(!prelude
+ .tool_surface
+ .lock()
+ .expect("tool surface")
+ .deferred_tool_names
+ .contains(&action));
}
#[cfg(feature = "mcp")]
@@ -401,12 +399,10 @@ async fn desktop_browser_setting_keeps_deferred_tools_in_fresh_and_resumed_surfa
.expect("desktop orchestrator");
for name in ["browser", "browser_open"] {
assert!(host.deferred_tool_names.contains(name), "{name}");
- assert!(
- !host
- .visible_tool_specs_arc()
- .iter()
- .any(|spec| spec.name == name)
- );
+ assert!(!host
+ .visible_tool_specs_arc()
+ .iter()
+ .any(|spec| spec.name == name));
}
host.ensure_runtime_session().expect("runtime session");
let prelude = host
@@ -717,18 +713,14 @@ async fn newly_connected_action_cannot_shadow_a_permanent_source() {
mutable.connected_integrations_authoritative = true;
}
let error = prelude.refresh_delegation_tool_surface().unwrap_err();
- assert!(
- error
- .to_string()
- .contains("collision with synthesized tool")
- );
+ assert!(error
+ .to_string()
+ .contains("collision with synthesized tool"));
let surface = prelude.tool_surface.lock().unwrap();
assert!(Arc::ptr_eq(&surface.visible_tool_specs, &before));
assert_eq!(surface.tools[0].description(), "host-owned action");
- assert!(
- !surface
- .synthesized_tools
- .iter()
- .any(|tool| tool.name() == "GMAIL_SEND_EMAIL")
- );
+ assert!(!surface
+ .synthesized_tools
+ .iter()
+ .any(|tool| tool.name() == "GMAIL_SEND_EMAIL"));
}
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
index 7414630db2..98c1ad4d3d 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
@@ -195,13 +195,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
@@ -215,13 +215,13 @@ pub(crate) async fn spawn_async_via_driver_tool_with_jobs(
options: SubagentRunOptions,
jobs: tinyagents_harness_tools::subagents::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,
@@ -241,13 +241,13 @@ async fn spawn_async_via_driver_tool_using_jobs(
options: SubagentRunOptions,
jobs: Option<tinyagents_harness_tools::subagents::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_terminal_tests.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle_terminal_tests.rs
index f9649a21cc..ac5db9c740 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle_terminal_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle_terminal_tests.rs
@@ -3,8 +3,8 @@ use super::*;
#[tokio::test]
async fn driver_cancel_uses_the_typed_terminal_for_lossy_idle_sessions() {
use crate::agent::orchestration::subagent_sessions::{
- DurableSubagentStatus, SubagentSessionSelector, SubagentSessionStore,
- SubagentSessionUpsert, cancel_driver_job_by_task, mark_finished, upsert_running,
+ cancel_driver_job_by_task, mark_finished, upsert_running, DurableSubagentStatus,
+ SubagentSessionSelector, SubagentSessionStore, SubagentSessionUpsert,
};
let directory = tempfile::tempdir().unwrap();
@@ -204,7 +204,7 @@ async fn terminal_and_pause_race_leave_only_one_authoritative_state() {
#[tokio::test]
async fn shared_flights_are_partitioned_by_agent_and_workspace() {
use crate::core::runtime::agent_scope::test_agent_context;
- use crate::core::runtime::{DomainSet, context::CoreContext};
+ use crate::core::runtime::{context::CoreContext, DomainSet};
let root = CoreContext::for_test(DomainSet::full(), None);
let alpha = test_agent_context(&root, "alpha");
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 875f4d26d0..d13962bbbc 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
@@ -236,12 +236,10 @@ async fn independent_host_bundles_share_and_project_the_persisted_winner() {
!leader.final_history.is_empty(),
"winner history is preserved"
);
- assert!(
- leader
- .final_history
- .iter()
- .any(|row| { row.role == "tool" && row.tool_call_id.as_deref() == Some("call-1") })
- );
+ assert!(leader
+ .final_history
+ .iter()
+ .any(|row| { row.role == "tool" && row.tool_call_id.as_deref() == Some("call-1") }));
assert_eq!(leader.usage.input_tokens, follower.usage.input_tokens);
assert!(leader.usage.input_tokens > 0, "winner usage is preserved");
assert_eq!(leader.artifact_paths, follower.artifact_paths);
@@ -421,21 +419,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/tool_prep.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
index 22ca3e9e38..07b28d26d8 100644
--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
@@ -9,7 +9,7 @@ use crate::agent::prompts::PromptContext;
use crate::agent_registry::host_definition::AgentDefinition;
use tinyagents_definition::{PromptSource, ToolScope};
use tinyagents_harness::tool::ToolSnapshot;
-use tinyagents_orchestration::subagent::{SubagentRole, restrict_tools_with_scope};
+use tinyagents_orchestration::subagent::{restrict_tools_with_scope, SubagentRole};
use tinytools::Tool;
// ── Prompt dialect selection ────────────────────────────────────────────
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs
index f96933701a..8d09df2f46 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs
@@ -2,7 +2,7 @@ use super::*;
use std::collections::{HashMap, HashSet};
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinyagents_harness::context::{RunConfig, RunContext};
use tinyagents_harness::middleware::Middleware;
use tinyinference_llm::tool::ToolCall as TaToolCall;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
index bf5a0ced50..74129e776c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
@@ -148,21 +148,15 @@ fn desktop_approval_bypass_skips_only_require_approval_channel_verdict() {
}
let approval_middleware = middleware(ToolPolicyAction::RequireApproval);
let request = call("desktop_goal", json!({"app":"TextEdit","goal":"type"}));
- assert!(
- approval_middleware
- .channel_permission_block(&request, false)
- .is_some()
- );
- assert!(
- approval_middleware
- .channel_permission_block(&request, true)
- .is_none()
- );
- assert!(
- middleware(ToolPolicyAction::Deny)
- .channel_permission_block(&request, true)
- .is_some()
- );
+ assert!(approval_middleware
+ .channel_permission_block(&request, false)
+ .is_some());
+ assert!(approval_middleware
+ .channel_permission_block(&request, true)
+ .is_none());
+ assert!(middleware(ToolPolicyAction::Deny)
+ .channel_permission_block(&request, true)
+ .is_some());
}
fn call(name: &str, args: serde_json::Value) -> TaToolCall {
diff --git a/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs b/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs
index 581ef8f1e4..d7483f6961 100644
--- a/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs
@@ -12,7 +12,7 @@
use std::sync::{Arc, Mutex};
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinyagents_definition::{AgentDefinition, InMemoryDefinitionRegistry};
use tinyagents_harness::context::{RunConfig, RunContext};
use tinyagents_harness::host::{
@@ -225,9 +225,10 @@ async fn the_security_gate_refuses_a_nested_call_on_the_hosted_path() {
));
let host = HostCapabilities::new(
Arc::new(StaticContextComposer::empty()),
- Arc::new(InMemoryDefinitionRegistry::new(vec![
- AgentDefinition::new("helper", "Helper", "test").with_tools(["caller", "read_file"]),
- ])),
+ Arc::new(InMemoryDefinitionRegistry::new(vec![AgentDefinition::new(
+ "helper", "Helper", "test",
+ )
+ .with_tools(["caller", "read_file"])])),
gate,
Arc::new(FixedModelResolver::new(model())),
);
diff --git a/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs b/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs
index 9be73d1664..99992a342f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/prompt_cache_golden_tests.rs
@@ -17,7 +17,7 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinyagents_harness::context::RunConfig;
use tinyagents_harness::middleware::PromptCacheGuardMiddleware;
use tinyagents_harness::runtime::AgentHarness;
diff --git a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
index dd75841b9a..c5847cb332 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration.rs
@@ -11,18 +11,18 @@ use tinyagents_harness::tool::{
CanonicalSharedToolAdapter, ToolDispatch, ToolExecScope, ToolExecution, ToolExecutionContext,
};
use tinyagents_harness_tools::goals::GoalToolKind;
-use tinyagents_harness_tools::skills::{PackSelection, USE_SKILL, UseSkillDispatch};
+use tinyagents_harness_tools::skills::{PackSelection, UseSkillDispatch, USE_SKILL};
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};
use crate::agent::orchestration::tools::{
ContinueSubagentDispatch, DelegationDispatch, SpawnAsyncSubagentDispatch, 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::tools::TodoToolDispatch;
use crate::core::runtime::CoreContext;
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 e8693bc362..69c54f1820 100644
--- a/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/tool_registration_tests.rs
@@ -134,7 +134,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");
@@ -245,7 +245,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");
@@ -382,7 +382,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 48c5b96dac..b0ba4f884c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
@@ -16,26 +16,26 @@ use tinyagents_harness::runtime::{AgentInvocation, AgentTurnRequest, InvocationR
use tinyagents_harness::store::{InMemoryStore as ToolResultArtifactIndexStore, StoreRegistry};
use tinyagents_harness::tool::ToolSnapshot;
use tinyagents_harness::turn_policy::effective_max_iterations;
-use tinyagents_runtime::DriverRequest;
use tinyagents_runtime::turn_driver::{
SubagentScope as DriverSubagentScope, TurnControls, TurnDriver, TurnScope,
};
+use tinyagents_runtime::DriverRequest;
use crate::agent::harness::tool_result_artifacts::TINYAGENTS_TOOL_RESULT_ARTIFACT_STORE;
-use crate::agent::tinyagents::NativeSubagentRunContext;
use crate::agent::tinyagents::host::OpenHumanRunContext;
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;
+use crate::agent::tinyagents::NativeSubagentRunContext;
use crate::agent::tinyagents::{journal, routes, steering_forwarder};
use crate::inference::turn_models::TurnModels;
use tinyagents_harness::events::EventSink;
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
index 5bd6d1df3b..16c40a5ed5 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
@@ -15,13 +15,13 @@ use std::sync::Arc;
use tinyagents_harness::cache::InMemoryResponseCache;
use tinyagents_harness::middleware::{
- ApprovalGateMiddleware, ArgRecoveryMiddleware, BudgetLimits, BudgetMiddleware,
- ContextCompressionMiddleware, PromptCacheGuardMiddleware, RepeatProgressMiddleware,
- RunModeHandle, ToolPolicyMiddleware as TaToolPolicyMiddleware, plan_mode_middleware,
+ install_unmet_deliverable, is_repeat_call_exempt, tool_sets_lookup, ResearchBudgetMiddleware,
+ ShellTurnBudget, TurnClockMiddleware, DIRECT_WEB_READ_LIMIT,
};
use tinyagents_harness::middleware::{
- DIRECT_WEB_READ_LIMIT, ResearchBudgetMiddleware, ShellTurnBudget, TurnClockMiddleware,
- install_unmet_deliverable, is_repeat_call_exempt, tool_sets_lookup,
+ plan_mode_middleware, ApprovalGateMiddleware, ArgRecoveryMiddleware, BudgetLimits,
+ BudgetMiddleware, ContextCompressionMiddleware, PromptCacheGuardMiddleware,
+ RepeatProgressMiddleware, RunModeHandle, ToolPolicyMiddleware as TaToolPolicyMiddleware,
};
use tinyagents_harness::runtime::AgentHarness;
use tinyagents_harness::steering::SteeringHandle;
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs b/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
index 73e931c915..b345e26c8a 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
@@ -9,8 +9,8 @@ use tinyagents_harness::tool::ToolSnapshot;
use tinyagents_harness::turn_policy::{
DEFAULT_MODEL_CALL_TIMEOUT_SECS, LOCAL_MODEL_CALL_TIMEOUT_SECS,
};
-use tinyagents_runtime::DriverRequest;
use tinyagents_runtime::turn_driver::{SharedToolSet, TurnControls, TurnDriver};
+use tinyagents_runtime::DriverRequest;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
use tinytools::{Tool, ToolResult};
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 b48d100e77..7ccd34b349 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_tools::skills::{PackRegistryHandle, USE_SKILL, UseSkillTool};
+use tinyagents_harness::CallId;
+use tinyagents_harness_tools::skills::{PackRegistryHandle, UseSkillTool, USE_SKILL};
use tinyinference_llm::message::Message;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
use tinytools::{Tool, ToolCallOptions, ToolResult};
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
index 3162c67568..98cede5658 100644
--- a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
+++ b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
@@ -1,4 +1,4 @@
-use crate::agent::tools::{PLAN_EXIT_MARKER, PlanExitTool};
+use crate::agent::tools::{PlanExitTool, PLAN_EXIT_MARKER};
use crate::plan_review::PlanReviewResolution;
use serde_json::json;
use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolRunContext};
@@ -63,15 +63,13 @@ async fn plan_exit_does_not_flip_while_a_review_is_parked() {
// Resolve the parked review so the spawned task and the gate's
// bookkeeping don't leak past this test.
- assert!(
- crate::plan_review::gate::global().decide_by_thread(
- &crate::core::runtime::DispatchCtx::ambient()
- .tenant()
- .unwrap(),
- thread_id,
- PlanReviewResolution::Approve,
- )
- );
+ assert!(crate::plan_review::gate::global().decide_by_thread(
+ &crate::core::runtime::DispatchCtx::ambient()
+ .tenant()
+ .unwrap(),
+ thread_id,
+ PlanReviewResolution::Approve,
+ ));
let resolution = parked.await.unwrap();
assert_eq!(resolution, PlanReviewResolution::Approve);
diff --git a/crates/openhuman-core/src/agent/tools/todo_tests.rs b/crates/openhuman-core/src/agent/tools/todo_tests.rs
index c93775289f..4523b1199a 100644
--- a/crates/openhuman-core/src/agent/tools/todo_tests.rs
+++ b/crates/openhuman-core/src/agent/tools/todo_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinyagents_harness_tools::todos::{TodoItem, TodoStatus};
/// Serialize tests that share the process-global scratch store. Same lock
diff --git a/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests.rs
index f88ba0ee7c..c293e59383 100644
--- a/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests.rs
@@ -416,11 +416,8 @@ fn connected_integrations_block_is_format_independent() {
#[test]
fn connected_integrations_block_routes_capability_questions_to_search() {
let guide = render_connected_integrations(&gmail_only());
- assert!(
- guide.contains(
- "Its results, not prior knowledge or past answers, say what a toolkit can do."
- )
- );
+ assert!(guide
+ .contains("Its results, not prior knowledge or past answers, say what a toolkit can do."));
assert!(!guide.contains("integrations_agent"));
}
@@ -557,11 +554,8 @@ fn build_carries_the_spec_check_grounding_rules() {
assert!(body.contains("Checks must mirror how the task is specified or graded"));
assert!(body.contains("Never delete state, data or services the solution needs at runtime"));
assert!(body.contains("Verify the final state as a fresh consumer would see it."));
- assert!(
- body.contains(
- "List the request's stated constraints, filters and thresholds as `todo` items"
- )
- );
+ assert!(body
+ .contains("List the request's stated constraints, filters and thresholds as `todo` items"));
}
#[test]
diff --git a/crates/openhuman-core/src/agent_runs/subagent_control.rs b/crates/openhuman-core/src/agent_runs/subagent_control.rs
index 2f096a4229..427dee6bd0 100644
--- a/crates/openhuman-core/src/agent_runs/subagent_control.rs
+++ b/crates/openhuman-core/src/agent_runs/subagent_control.rs
@@ -15,13 +15,13 @@
//! cancelled.
use crate::core::runtime::DispatchCtx;
-use serde_json::{Map, Value, json};
+use serde_json::{json, Map, Value};
use tinyagents_orchestration::steering::SteerError;
use crate::agent::orchestration::running_subagents::CancelledSubagent;
use crate::agent::orchestration::{background_completions, running_subagents, subagent_sessions};
-use crate::core::Outcome;
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_harness::run_queue::QueueLane;
diff --git a/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs b/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs
index 8a82a22acd..b0da293296 100644
--- a/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs
+++ b/crates/openhuman-core/src/agent_runs/subagent_control_tests.rs
@@ -148,8 +148,8 @@ async fn cancelling_a_paused_driver_queues_a_failed_delivery_with_reason() {
forget_workspace_for_test, pending_for,
};
use crate::agent::orchestration::subagent_sessions::{
- DriverTaskCancellation, DurableSubagentStatus, SubagentSessionSelector,
- SubagentSessionStore, SubagentSessionUpsert, mark_finished, upsert_running,
+ mark_finished, upsert_running, DriverTaskCancellation, DurableSubagentStatus,
+ SubagentSessionSelector, SubagentSessionStore, SubagentSessionUpsert,
};
use tinyagents_orchestration::subagent::SubagentTaskKey;
use tinyagents_tasks::CompletionStatus;
@@ -213,15 +213,13 @@ async fn cancelling_a_paused_driver_queues_a_failed_delivery_with_reason() {
};
forget_workspace_for_test(&workspace_dir);
- assert!(
- settle_paused_driver_cancel(
- &DispatchCtx::process_default(),
- &observed,
- Some("user requested stop")
- )
- .await
- .expect("paused cancellation settles")
- );
+ assert!(settle_paused_driver_cancel(
+ &DispatchCtx::process_default(),
+ &observed,
+ Some("user requested stop")
+ )
+ .await
+ .expect("paused cancellation settles"));
let row = store.load().unwrap().remove(0);
assert_eq!(row.status, DurableSubagentStatus::Failed);
diff --git a/crates/openhuman-core/src/artifacts/artifact_wiring.rs b/crates/openhuman-core/src/artifacts/artifact_wiring.rs
index c73627ffde..865b28d9e3 100644
--- a/crates/openhuman-core/src/artifacts/artifact_wiring.rs
+++ b/crates/openhuman-core/src/artifacts/artifact_wiring.rs
@@ -14,7 +14,7 @@
use std::path::Path;
use std::sync::Arc;
-use crate::agent::harness::tool_result_artifacts::{HostArtifactStore, new_tool_result_store};
+use crate::agent::harness::tool_result_artifacts::{new_tool_result_store, HostArtifactStore};
use crate::security::policy::tool_result_artifacts_dir;
use crate::storage::sessions::artifact_blobs_for;
use tinystoragedrivers::{MemoryStorage, Scope, StorageBackend};
diff --git a/crates/openhuman-core/src/artifacts/artifact_wiring_tests.rs b/crates/openhuman-core/src/artifacts/artifact_wiring_tests.rs
index 1a82c7a76e..7c293fd93f 100644
--- a/crates/openhuman-core/src/artifacts/artifact_wiring_tests.rs
+++ b/crates/openhuman-core/src/artifacts/artifact_wiring_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::security::policy::tool_result_artifacts_dir;
use serde_json::json;
-use tinyagents_harness::artifacts::tool_results::{ArtifactRead, apply_per_result_persistence};
+use tinyagents_harness::artifacts::tool_results::{apply_per_result_persistence, ArtifactRead};
const DAY: std::time::Duration = std::time::Duration::from_secs(24 * 60 * 60);
diff --git a/crates/openhuman-core/src/artifacts/mod.rs b/crates/openhuman-core/src/artifacts/mod.rs
index 8fd2a54b1f..80f25a90ed 100644
--- a/crates/openhuman-core/src/artifacts/mod.rs
+++ b/crates/openhuman-core/src/artifacts/mod.rs
@@ -15,11 +15,11 @@ pub mod types;
pub mod version_documents;
pub(crate) use files::resolve_ready_file_meta;
-pub use files::{FileRoots, resolve_ready_file};
-pub use migrate::{MigrationReport, migrate_legacy_artifacts};
+pub use files::{resolve_ready_file, FileRoots};
+pub use migrate::{migrate_legacy_artifacts, MigrationReport};
pub use publisher_slot::{
- ArtifactPublisherBinder, ArtifactPublisherFactory, artifact_publisher,
- register_artifact_publisher, register_artifact_publisher_in, unregister_artifact_publisher,
+ artifact_publisher, register_artifact_publisher, register_artifact_publisher_in,
+ unregister_artifact_publisher, ArtifactPublisherBinder, ArtifactPublisherFactory,
};
pub use schemas::{
all_controller_schemas as all_artifacts_controller_schemas,
diff --git a/crates/openhuman-core/src/artifacts/ops.rs b/crates/openhuman-core/src/artifacts/ops.rs
index 76ef339297..54215e3db8 100644
--- a/crates/openhuman-core/src/artifacts/ops.rs
+++ b/crates/openhuman-core/src/artifacts/ops.rs
@@ -1,4 +1,4 @@
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use crate::config::Config;
use crate::core::Outcome;
@@ -6,10 +6,10 @@ use crate::core::Outcome;
// Imports used only by the `documents`-gated presentation regeneration helper
// below; when the feature is off the PresentationTool is compiled out.
#[cfg(feature = "documents")]
-use crate::security::SecurityPolicy;
-#[cfg(feature = "documents")]
use crate::security::approval::ApprovalChatContext;
#[cfg(feature = "documents")]
+use crate::security::SecurityPolicy;
+#[cfg(feature = "documents")]
use crate::tools::PresentationTool;
use super::store;
diff --git a/crates/openhuman-core/src/artifacts/ops_tests.rs b/crates/openhuman-core/src/artifacts/ops_tests.rs
index de8006f45b..2061e83d81 100644
--- a/crates/openhuman-core/src/artifacts/ops_tests.rs
+++ b/crates/openhuman-core/src/artifacts/ops_tests.rs
@@ -187,45 +187,39 @@ async fn delete_missing_id_error() {
async fn regenerate_rejects_empty_id() {
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);
- assert!(
- ai_regenerate(
- &crate::core::runtime::DispatchCtx::ambient(),
- &config,
- "",
- "t",
- "c"
- )
- .await
- .is_err()
- );
+ assert!(ai_regenerate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ "",
+ "t",
+ "c"
+ )
+ .await
+ .is_err());
}
#[tokio::test]
async fn regenerate_requires_thread_and_client() {
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);
- assert!(
- ai_regenerate(
- &crate::core::runtime::DispatchCtx::ambient(),
- &config,
- "id",
- "",
- "c"
- )
- .await
- .is_err()
- );
- assert!(
- ai_regenerate(
- &crate::core::runtime::DispatchCtx::ambient(),
- &config,
- "id",
- "t",
- ""
- )
- .await
- .is_err()
- );
+ assert!(ai_regenerate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ "id",
+ "",
+ "c"
+ )
+ .await
+ .is_err());
+ assert!(ai_regenerate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ "id",
+ "t",
+ ""
+ )
+ .await
+ .is_err());
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/artifacts/schemas.rs b/crates/openhuman-core/src/artifacts/schemas.rs
index 543d9d84ac..fef41af9ff 100644
--- a/crates/openhuman-core/src/artifacts/schemas.rs
+++ b/crates/openhuman-core/src/artifacts/schemas.rs
@@ -2,8 +2,8 @@ use crate::core::runtime::DispatchCtx;
use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
-use crate::core::Outcome;
use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
pub fn all_controller_schemas() -> Vec<ControllerSchema> {
diff --git a/crates/openhuman-core/src/artifacts/storage_schema.rs b/crates/openhuman-core/src/artifacts/storage_schema.rs
index c1648252ea..d4d189bb43 100644
--- a/crates/openhuman-core/src/artifacts/storage_schema.rs
+++ b/crates/openhuman-core/src/artifacts/storage_schema.rs
@@ -12,7 +12,7 @@
//! `{"_args": <value>}`, so the body is always an object and
//! [`args_of_body`] reads either form back.
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinystoragedrivers::schema::{Schema, ScopeClass, SourceRecord, Step, TargetRecord};
use tinystoragedrivers::{CollectionSpec, IndexSpec, Result};
diff --git a/crates/openhuman-core/src/artifacts/store_documents.rs b/crates/openhuman-core/src/artifacts/store_documents.rs
index 61bc7397c1..23c8d39687 100644
--- a/crates/openhuman-core/src/artifacts/store_documents.rs
+++ b/crates/openhuman-core/src/artifacts/store_documents.rs
@@ -38,12 +38,12 @@ use serde_json::Value;
use tinystoragedrivers::{CollectionSpec, Filter, Precondition, Query, Sort};
use super::storage_schema::{
- ARGS, RECORDS as ARTIFACTS, args_body, args_of_body, meta_from_body, meta_to_body, records_spec,
+ args_body, args_of_body, meta_from_body, meta_to_body, records_spec, ARGS, RECORDS as ARTIFACTS,
};
use super::types::ArtifactMeta;
-use crate::storage::DocumentStoreExt;
use crate::storage::documents::Repo;
use crate::storage::schema_support::key_of;
+use crate::storage::DocumentStoreExt;
const DOMAIN: &str = "artifacts::store";
diff --git a/crates/openhuman-core/src/artifacts/store_documents_tests.rs b/crates/openhuman-core/src/artifacts/store_documents_tests.rs
index 8c2b238947..e00790c523 100644
--- a/crates/openhuman-core/src/artifacts/store_documents_tests.rs
+++ b/crates/openhuman-core/src/artifacts/store_documents_tests.rs
@@ -1,10 +1,10 @@
use super::*;
-use crate::artifacts::FileRoots;
use crate::artifacts::store::{
delete_artifact, get_artifact, list_artifacts, read_artifact_args, save_artifact_args,
save_artifact_meta,
};
use crate::artifacts::types::{ArtifactKind, ArtifactStatus};
+use crate::artifacts::FileRoots;
use crate::storage::{MemoryStorage, Scope, StorageBackend};
use chrono::{TimeZone, Utc};
diff --git a/crates/openhuman-core/src/artifacts/tiny_store_tests.rs b/crates/openhuman-core/src/artifacts/tiny_store_tests.rs
index 807575f538..c7685afd3f 100644
--- a/crates/openhuman-core/src/artifacts/tiny_store_tests.rs
+++ b/crates/openhuman-core/src/artifacts/tiny_store_tests.rs
@@ -144,15 +144,13 @@ async fn explicit_artifact_context_binds_records_and_blobs_to_the_same_profile()
&context_b,
);
assert!(artifacts_b.get(&id).await.unwrap().is_none());
- assert!(
- files_b
- .as_ref()
- .unwrap()
- .metadata(&file.key)
- .await
- .unwrap()
- .is_none()
- );
+ assert!(files_b
+ .as_ref()
+ .unwrap()
+ .metadata(&file.key)
+ .await
+ .unwrap()
+ .is_none());
})
.await;
}
@@ -292,20 +290,16 @@ async fn deleting_an_artifact_removes_its_card() {
.await
.unwrap();
let id = saved.record.id;
- assert!(
- super::super::store::get_artifact(&workspace, &id)
- .await
- .is_ok()
- );
+ assert!(super::super::store::get_artifact(&workspace, &id)
+ .await
+ .is_ok());
let (removed, notice) = artifacts.delete(&id).await.unwrap();
assert!(removed);
assert!(notice.is_none(), "{notice:?}");
- assert!(
- super::super::store::get_artifact(&workspace, &id)
- .await
- .is_err()
- );
+ assert!(super::super::store::get_artifact(&workspace, &id)
+ .await
+ .is_err());
}
struct NoopPublisher;
diff --git a/crates/openhuman-core/src/artifacts/version_documents.rs b/crates/openhuman-core/src/artifacts/version_documents.rs
index 38b2480500..d7f24be28d 100644
--- a/crates/openhuman-core/src/artifacts/version_documents.rs
+++ b/crates/openhuman-core/src/artifacts/version_documents.rs
@@ -29,11 +29,11 @@ use serde_json::Value;
use tiny_artifacts::{ArtifactRecord, ArtifactStore};
use tinystoragedrivers::{CollectionSpec, Precondition, Query, Sort};
-use super::storage_schema::{VERSIONS, version_body, version_record};
-use crate::storage::DocumentStoreExt;
-use crate::storage::ScopedStorage;
+use super::storage_schema::{version_body, version_record, VERSIONS};
use crate::storage::documents::Repo;
use crate::storage::schema_support::key_of;
+use crate::storage::DocumentStoreExt;
+use crate::storage::ScopedStorage;
const DOMAIN: &str = "artifacts::versions";
diff --git a/crates/openhuman-core/src/artifacts/version_documents_tests.rs b/crates/openhuman-core/src/artifacts/version_documents_tests.rs
index b436a48336..e2f7c982c3 100644
--- a/crates/openhuman-core/src/artifacts/version_documents_tests.rs
+++ b/crates/openhuman-core/src/artifacts/version_documents_tests.rs
@@ -35,11 +35,9 @@ async fn records_round_trip_through_the_document_store() {
assert!(store.get("a-1").await.unwrap().is_none());
assert!(!store.delete("a-1").await.unwrap());
// Nothing is written as a file.
- assert!(
- !super::super::tiny_store::legacy_versioned_dir(&ws)
- .join("a-2.json")
- .exists()
- );
+ assert!(!super::super::tiny_store::legacy_versioned_dir(&ws)
+ .join("a-2.json")
+ .exists());
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/media/generation/artifact_tool.rs b/crates/openhuman-core/src/media/generation/artifact_tool.rs
index 44fb9539ae..35032d63c4 100644
--- a/crates/openhuman-core/src/media/generation/artifact_tool.rs
+++ b/crates/openhuman-core/src/media/generation/artifact_tool.rs
@@ -29,20 +29,20 @@ use std::path::{Path, PathBuf};
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use tinytools::{
PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolContent, ToolPolicy, ToolResult,
ToolRunContext, ToolScope, ToolTimeout,
};
use tokio::io::AsyncWriteExt;
-use crate::artifacts::ArtifactKind;
use crate::artifacts::production::Production;
+use crate::artifacts::ArtifactKind;
use crate::security::approval::ApprovalChatContext;
use crate::tools::host_extensions::tool_call_id;
use tinyagents_harness::tinyinference_video::ProgressFn;
-use super::progress::{JobStateSlot, video_status_observer};
+use super::progress::{video_status_observer, JobStateSlot};
const FILE_REFERENCE_FIELDS: [&str; 8] = [
"references",
diff --git a/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs b/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs
index b3430b01c4..919b67df3c 100644
--- a/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs
+++ b/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs
@@ -1,12 +1,12 @@
use async_trait::async_trait;
-use serde_json::{Value, json};
+use serde_json::{json, Value};
use std::path::Path;
use std::sync::Arc;
use tinyagents_harness::media::MediaOutput;
use tinystoragedrivers::BlobStore;
use tinytools::{PermissionLevel, Tool, ToolCategory, ToolContent, ToolResult};
-use super::{MediaArtifactTool, copy_blob_to_file, has_reusable_files_reference};
+use super::{copy_blob_to_file, has_reusable_files_reference, MediaArtifactTool};
use crate::artifacts::{ArtifactKind, ArtifactStatus, FileRoots};
#[test]
@@ -62,11 +62,10 @@ async fn artifact_history_refresh_failure_fails_closed_for_cached_files() {
.with_reference_allowlist(Arc::clone(&allowed));
assert!(allowed.lock().unwrap().contains(&replacement));
- assert!(
- tool.execute(json!({ "references": [replacement.to_string_lossy()] }))
- .await
- .is_err()
- );
+ assert!(tool
+ .execute(json!({ "references": [replacement.to_string_lossy()] }))
+ .await
+ .is_err());
}
struct PartialThenFail(bool);
@@ -223,13 +222,11 @@ async fn files_a_blob_backed_generated_artifact() {
Some(format!("Saved image at {}\nCost: $0.01", canonical_file.display()).as_str())
);
assert_eq!(std::fs::read(&file).unwrap(), b"blob-media-bytes");
- assert!(
- blobs
- .get("generated-media/stub-0.png")
- .await
- .unwrap()
- .is_none()
- );
+ assert!(blobs
+ .get("generated-media/stub-0.png")
+ .await
+ .unwrap()
+ .is_none());
let (_, failed_file) = crate::artifacts::create_artifact_for_call(
&workspace,
@@ -292,15 +289,13 @@ async fn files_a_blob_backed_generated_artifact() {
"failed regeneration retains the previous non-empty file"
);
fresh.refresh_allowed_references().await.unwrap();
- assert!(
- !fresh
- .allowed_references
- .as_ref()
- .unwrap()
- .lock()
- .unwrap()
- .contains(&canonical_file)
- );
+ assert!(!fresh
+ .allowed_references
+ .as_ref()
+ .unwrap()
+ .lock()
+ .unwrap()
+ .contains(&canonical_file));
}
#[tokio::test]
@@ -438,11 +433,10 @@ async fn files_every_artifact_when_n_greater_than_one() {
.await
.expect("artifact metadata is persisted");
assert_eq!(meta.status, ArtifactStatus::Ready);
- assert!(
- meta.file
- .as_deref()
- .is_some_and(|file| std::path::Path::new(file).exists())
- );
+ assert!(meta
+ .file
+ .as_deref()
+ .is_some_and(|file| std::path::Path::new(file).exists()));
}
}
diff --git a/crates/openhuman-core/src/memory/lifecycle/session_hooks_tests.rs b/crates/openhuman-core/src/memory/lifecycle/session_hooks_tests.rs
index 5ded847bfa..b0cb9e3e6c 100644
--- a/crates/openhuman-core/src/memory/lifecycle/session_hooks_tests.rs
+++ b/crates/openhuman-core/src/memory/lifecycle/session_hooks_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use tinyagents_harness::summarization::{SummaryPlacement, checkpoint_message};
+use tinyagents_harness::summarization::{checkpoint_message, SummaryPlacement};
use tinyinference_llm::ToolCall;
fn assistant_with_call(id: &str, name: &str) -> Message {