Skip to content

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

refactor(tests): clean up test code and imports

Steven Enamakel574ee1243265
diff --git a/crates/openhuman-core/src/agent/goals/mod_tests.rs b/crates/openhuman-core/src/agent/goals/mod_tests.rs
index 79e36c9ca5..a258622ff3 100644
--- a/crates/openhuman-core/src/agent/goals/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/goals/mod_tests.rs
@@ -79,7 +79,9 @@ async fn goal_tool_with_context_uses_the_business_goal_store() {
.expect("goal was persisted");
assert_eq!(stored.objective, "persist through the host store");
- let no_thread = set.execute(serde_json::json!({ "objective": "no thread" })).await
+ let no_thread = set
+ .execute(serde_json::json!({ "objective": "no thread" }))
+ .await
.expect("execute without a thread");
assert!(no_thread.is_error);
assert!(goal_store(workspace.path(), &dispatch)
@@ -96,10 +98,7 @@ async fn goal_store_uses_the_explicit_dispatch_context_provider() {
use crate::core::runtime::{ContextOverlay, CoreContext, DispatchCtx, DomainSet};
use tinyagents_session::port::{InMemorySessionStores, SessionStoreProvider};
- fn context_for(
- agent: &str,
- provider: Arc<dyn SessionStoreProvider>,
- ) -> Arc<CoreContext> {
+ fn context_for(agent: &str, provider: Arc<dyn SessionStoreProvider>) -> Arc<CoreContext> {
let mut overrides = crate::agent::host_overrides::HostOverrides::default();
overrides.session_store = Some(provider);
let overlay = ContextOverlay::new(
diff --git a/crates/openhuman-core/src/storage/sessions/mod.rs b/crates/openhuman-core/src/storage/sessions/mod.rs
index 2d1e0bd2a1..a6ac9023c2 100644
--- a/crates/openhuman-core/src/storage/sessions/mod.rs
+++ b/crates/openhuman-core/src/storage/sessions/mod.rs
@@ -27,9 +27,9 @@ pub use rebound::{rebind_all, ReboundSessionStores, StoreRegistry};
pub use tenant_router::TenantSessionStores;
pub use workspace::{
artifact_blobs_for, attachment_stash_for, current_documents_for, default_turn_states_for,
- ledger_for, provider_for_workspace, provider_for_workspace_in, release_workspace, release_workspace_defaults,
- require_ledger, session_scope, status_store_for, stores_for, stores_or_ephemeral,
- turn_states_for, with_ledger, with_ledger_async, WorkspaceSessionStores,
+ ledger_for, provider_for_workspace, provider_for_workspace_in, release_workspace,
+ release_workspace_defaults, require_ledger, session_scope, status_store_for, stores_for,
+ stores_or_ephemeral, turn_states_for, with_ledger, with_ledger_async, WorkspaceSessionStores,
};
static PROVIDER: LazyLock<RwLock<Option<Arc<dyn SessionStoreProvider>>>> =
diff --git a/crates/openhuman-core/src/web_chat/event_bus_tests.rs b/crates/openhuman-core/src/web_chat/event_bus_tests.rs
index b8fb3bff18..91ada868dc 100644
--- a/crates/openhuman-core/src/web_chat/event_bus_tests.rs
+++ b/crates/openhuman-core/src/web_chat/event_bus_tests.rs
@@ -358,7 +358,10 @@ async fn goal_resume_and_account_updates_reach_the_web_channel() {
std::time::Duration::from_secs(1),
)
.await;
- assert!(matches!(web_rx.try_recv(), Err(broadcast::error::TryRecvError::Empty)));
+ assert!(matches!(
+ web_rx.try_recv(),
+ Err(broadcast::error::TryRecvError::Empty)
+ ));
crate::agent::goals::account_turn(
workspace.path(),
&dispatch,