Skip to content

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

style(composio): reformat legacy import and test closures

Steven Enamakel2ad7f0556c1b
diff --git a/crates/openhuman-core/src/integrations/composio/file_store.rs b/crates/openhuman-core/src/integrations/composio/file_store.rs
index 55731058f6..f3ce082391 100644
--- a/crates/openhuman-core/src/integrations/composio/file_store.rs
+++ b/crates/openhuman-core/src/integrations/composio/file_store.rs
@@ -41,12 +41,13 @@ async fn import_legacy(
let value: serde_json::Value = serde_json::from_slice(&bytes)
.map_err(|error| format!("[composio:store] parsing legacy {name} failed: {error}"))?;
let docs = docs.clone();
- let wrote = crate::core::runtime::spawn_blocking_scoped(move || {
- docs.import_if_absent(name, value)
- })
- .await
- .map_err(|error| format!("[composio:store] importing legacy {name} failed: {error}"))?
- .map_err(|error| format!("[composio:store] importing legacy {name} failed: {error:#}"))?;
+ let wrote =
+ crate::core::runtime::spawn_blocking_scoped(move || docs.import_if_absent(name, value))
+ .await
+ .map_err(|error| format!("[composio:store] importing legacy {name} failed: {error}"))?
+ .map_err(|error| {
+ format!("[composio:store] importing legacy {name} failed: {error:#}")
+ })?;
log::debug!("[composio:store] legacy import name={name} wrote={wrote}");
let migrated = path.with_file_name(format!("{name}.migrated"));
if let Err(error) = tokio::fs::rename(&path, &migrated).await {
diff --git a/crates/openhuman-core/src/integrations/composio/file_store_tests.rs b/crates/openhuman-core/src/integrations/composio/file_store_tests.rs
index 518cbdb189..3e521bf373 100644
--- a/crates/openhuman-core/src/integrations/composio/file_store_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/file_store_tests.rs
@@ -61,10 +61,14 @@ async fn a_legacy_state_file_is_imported_once_and_retired() {
.exists());
// A later edit is not clobbered by a re-import.
- update(&config, USER_SCOPES_FILE, |v: &mut BTreeMap<String, u32>| {
- v.insert("gmail".into(), 9);
- ((), true)
- })
+ update(
+ &config,
+ USER_SCOPES_FILE,
+ |v: &mut BTreeMap<String, u32>| {
+ v.insert("gmail".into(), 9);
+ ((), true)
+ },
+ )
.await
.unwrap();
let again: BTreeMap<String, u32> = load(&config, USER_SCOPES_FILE).await.unwrap();