Skip to content

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

style(tinymemes): reformat callbacks and tests to rustfmt

Steven Enamakela55555e2cd7e
diff --git a/crates/openhuman-core/src/tinymemes/callbacks.rs b/crates/openhuman-core/src/tinymemes/callbacks.rs
index 7ea62b624a..977307a4b5 100644
--- a/crates/openhuman-core/src/tinymemes/callbacks.rs
+++ b/crates/openhuman-core/src/tinymemes/callbacks.rs
@@ -186,11 +186,7 @@ pub(super) async fn dispatch(
session.enter(answer(session, member, payload)).await
}
-async fn answer(
- session: &Session,
- member: &str,
- payload: Value,
-) -> Result<Value, tinybus::Error> {
+async fn answer(session: &Session, member: &str, payload: Value) -> Result<Value, tinybus::Error> {
match member {
host_methods::COMPLETE => reply(complete(session, args(payload)?).await),
host_methods::EVALUATE => reply(evaluate(session, args(payload)?).await),
diff --git a/crates/openhuman-core/src/tinymemes/callbacks_tests.rs b/crates/openhuman-core/src/tinymemes/callbacks_tests.rs
index 15c6f79554..0675064b25 100644
--- a/crates/openhuman-core/src/tinymemes/callbacks_tests.rs
+++ b/crates/openhuman-core/src/tinymemes/callbacks_tests.rs
@@ -168,12 +168,19 @@ async fn callbacks_run_as_the_identity_that_registered_the_remix() {
team: Some("team-a".into()),
};
// Registered inside the caller's task...
- let session = crate::memory::scope::within(identity.clone(), async { Session::new(&config) }).await;
+ let session =
+ crate::memory::scope::within(identity.clone(), async { Session::new(&config) }).await;
// ...and answered later, on a task that has no scope of its own.
assert_eq!(crate::memory::scope::current(), None);
- let seen = session.enter(async { crate::memory::scope::current() }).await;
+ let seen = session
+ .enter(async { crate::memory::scope::current() })
+ .await;
assert_eq!(seen, Some(identity));
- assert_eq!(crate::memory::scope::current(), None, "the scope does not leak out");
+ assert_eq!(
+ crate::memory::scope::current(),
+ None,
+ "the scope does not leak out"
+ );
}
#[tokio::test]
@@ -181,7 +188,9 @@ async fn a_session_registered_without_a_scope_adds_none() {
let dir = tempfile::tempdir().unwrap();
let session = Session::new(&config_in(dir.path()));
assert_eq!(
- session.enter(async { crate::memory::scope::current() }).await,
+ session
+ .enter(async { crate::memory::scope::current() })
+ .await,
None
);
}
diff --git a/crates/openhuman-core/src/tinymemes/service_tests.rs b/crates/openhuman-core/src/tinymemes/service_tests.rs
index 7b4b0a2bb0..411f41a9e1 100644
--- a/crates/openhuman-core/src/tinymemes/service_tests.rs
+++ b/crates/openhuman-core/src/tinymemes/service_tests.rs
@@ -231,5 +231,8 @@ async fn a_second_remix_for_one_workspace_waits_for_the_first_but_another_worksp
let held = scope_lock(&a);
let _first = held.lock().await;
assert!(scope_lock(&a).try_lock().is_err(), "same workspace waits");
- assert!(scope_lock(&b).try_lock().is_ok(), "another workspace does not");
+ assert!(
+ scope_lock(&b).try_lock().is_ok(),
+ "another workspace does not"
+ );
}