Skip to content

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

chore: apply rustfmt formatting

Steven Enamakela9dc631533a4
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/cancel.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/cancel.rs
index 08976ea357..39f3fc76cf 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/cancel.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/cancel.rs
@@ -343,12 +343,16 @@ pub(crate) async fn cancel_for_thread(
cancelled += usize::from(!cancelled_job.status.is_terminal());
}
Err(error) => {
- log::warn!("[running_subagents] driver thread deletion cancellation failed: {error}");
+ log::warn!(
+ "[running_subagents] driver thread deletion cancellation failed: {error}"
+ );
continue;
}
}
if let Err(error) = jobs.wait_owned(job.id.as_str(), &owner_key).await {
- log::warn!("[running_subagents] failed waiting for deleted-thread child to settle: {error}");
+ log::warn!(
+ "[running_subagents] failed waiting for deleted-thread child to settle: {error}"
+ );
}
}
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs
index 5420c72ff0..f18be91c36 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_driver_tests.rs
@@ -316,7 +316,7 @@ async fn deleting_parent_thread_cancels_driver_child_before_discarding_completio
use crate::agent::orchestration::background_completions::{self, BackgroundAgentOutcome};
use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
- use crate::threads::store::{blocking, CreateConversationThread};
+ use crate::threads::store::{CreateConversationThread, blocking};
use crate::tools::toolpacks::ToolGroups;
use tinyagents_harness::context::RunContext;
use tinyagents_harness_tools::subagents::SubAgentJobRegistry;
diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs
index 6d46b2fb3e..2d537066e8 100644
--- a/crates/openhuman-core/src/threads/ops/crud.rs
+++ b/crates/openhuman-core/src/threads/ops/crud.rs
@@ -5,11 +5,11 @@ use super::support::{
counts, envelope, message_to_record, record_to_message, run_to_completion, thread_to_summary,
workspace_dir,
};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
+use crate::threads::ThreadsError;
use crate::threads::store as conversations;
use crate::threads::store::{ConversationMessagePatch, CrossThreadHit};
-use crate::threads::ThreadsError;
use crate::threads::{
ApiEnvelope, AppendConversationMessageRequest, ConversationMessageRecord,
ConversationMessagesRequest, ConversationMessagesResponse, ConversationThreadSummary,
@@ -489,11 +489,9 @@ async fn thread_delete_inner(
// completion in the gap between the two calls, then discard anything already
// queued for delivery. Both target a thread that's being deleted, so there's
// nowhere left to deliver to — abort + cleanup is the whole behavior.
- let cancelled_legacy = crate::agent::orchestration::running_subagents::cancel_for_thread(
- &ctx,
- &request.thread_id,
- )
- .await;
+ let cancelled_legacy =
+ crate::agent::orchestration::running_subagents::cancel_for_thread(&ctx, &request.thread_id)
+ .await;
let jobs = crate::core::runtime::slot_for::<
tinyagents_harness_tools::subagents::SubAgentJobRegistry,
>(&ctx);
diff --git a/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs b/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
index 1eff122c93..964dda7317 100644
--- a/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
@@ -111,47 +111,55 @@ async fn user_append_stages_original_strips_upload_bytes_and_reuses_returned_con
.await
.unwrap();
assert_eq!(persisted.len(), 2);
- assert!(!serde_json::to_string(&persisted)
- .unwrap()
- .contains("base64,"));
+ assert!(
+ !serde_json::to_string(&persisted)
+ .unwrap()
+ .contains("base64,")
+ );
}
#[tokio::test]
async fn rejected_upload_never_appends_a_message() {
let (_temp, mut config) = setup().await;
config.multimodal_files.max_files = 0;
- assert!(append_with_test_config(
- request(
- "disabled",
- "[IMAGE:data:image/png;base64,iVBORw0KGgo=]",
- "user"
- ),
- &config,
- None,
- )
- .await
- .is_err());
+ assert!(
+ append_with_test_config(
+ request(
+ "disabled",
+ "[IMAGE:data:image/png;base64,iVBORw0KGgo=]",
+ "user"
+ ),
+ &config,
+ None,
+ )
+ .await
+ .is_err()
+ );
config.multimodal_files.max_files = 3;
- assert!(append_with_test_config(
- request("bad", "[FILE:data:application/zip;base64,!]", "user"),
- &config,
- None,
- )
- .await
- .is_err());
+ assert!(
+ append_with_test_config(
+ request("bad", "[FILE:data:application/zip;base64,!]", "user"),
+ &config,
+ None,
+ )
+ .await
+ .is_err()
+ );
assert!(
append_with_test_config(request("missing", "image.png", "user"), &config, None)
.await
.is_err()
);
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir.clone(),
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir.clone(),
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -179,14 +187,16 @@ async fn external_origin_cannot_reuse_an_existing_attachment_marker() {
.await
.is_err()
);
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir,
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir,
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -255,14 +265,16 @@ async fn append_uses_host_persistence_workspace_separate_from_rpc_config() {
.await
.unwrap();
assert_eq!(persisted.len(), 1);
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir,
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir,
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -273,17 +285,21 @@ async fn poster_only_user_metadata_is_rejected_before_persistence() {
"attachmentNames": ["video.mp4"],
"attachmentPosters": ["data:image/png;base64,iVBORw0KGgo="]
});
- assert!(append_with_test_config(upload, &config, None)
+ assert!(
+ append_with_test_config(upload, &config, None)
+ .await
+ .is_err()
+ );
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir.clone(),
+ "uploads".into()
+ )
.await
- .is_err());
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir.clone(),
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]