Skip to content

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

chore: reformat long lines across flows module

Steven Enamakel07c9e4159f0d
diff --git a/crates/openhuman-core/src/flows/bus_subscriber_tests.rs b/crates/openhuman-core/src/flows/bus_subscriber_tests.rs
index 6a294c17de..7965df654e 100644
--- a/crates/openhuman-core/src/flows/bus_subscriber_tests.rs
+++ b/crates/openhuman-core/src/flows/bus_subscriber_tests.rs
@@ -353,7 +353,11 @@ async fn digest_writes_run_digest_entry_for_completed_run() {
.await;
let digests = stored_digests(&config, "f-ok").await;
- assert_eq!(digests.len(), 1, "completed run must produce one run digest");
+ assert_eq!(
+ digests.len(),
+ 1,
+ "completed run must produce one run digest"
+ );
let entry = &digests[0];
assert_eq!(entry.meta.source.kind, tinymemory::SourceKind::Agent);
assert!(entry.meta.tags.contains(&crate::flows::flow_tag("f-ok")));
@@ -440,7 +444,9 @@ async fn retention_cap_forgets_the_oldest_digests() {
assert_eq!(enforce_retention_cap(&config, "f-cap", 2).await.unwrap(), 2);
let kept = stored_digests(&config, "f-cap").await;
assert_eq!(kept.len(), 2);
- assert!(kept.iter().all(|hit| hit.text.contains("digest 2") || hit.text.contains("digest 3")));
+ assert!(kept
+ .iter()
+ .all(|hit| hit.text.contains("digest 2") || hit.text.contains("digest 3")));
}
#[test]
diff --git a/crates/openhuman-core/src/flows/memory_tools.rs b/crates/openhuman-core/src/flows/memory_tools.rs
index 413e04aee3..58a842886c 100644
--- a/crates/openhuman-core/src/flows/memory_tools.rs
+++ b/crates/openhuman-core/src/flows/memory_tools.rs
@@ -134,7 +134,9 @@ pub fn flow_meta(flow_id: &str, extra: &[String]) -> MemoryMeta {
/// off forgets nothing.
pub async fn forget_matching(config: &Config, filter: MetaFilter) -> MemoryResult<usize> {
if filter.is_empty() {
- return Err(MemoryError::invalid("refusing to forget with an empty filter"));
+ return Err(MemoryError::invalid(
+ "refusing to forget with an empty filter",
+ ));
}
let bound = match crate::memory::engine::resolve(config).engine() {
Ok(bound) => bound,
@@ -371,7 +373,9 @@ impl Tool for FlowMemoryRecallTool {
code = error.code(),
"[flows:memory] flow_memory_recall: failed"
);
- Ok(ToolResult::error(format!("Flow memory recall failed: {error}")))
+ Ok(ToolResult::error(format!(
+ "Flow memory recall failed: {error}"
+ )))
}
}
}
diff --git a/crates/openhuman-core/src/flows/memory_tools_tests.rs b/crates/openhuman-core/src/flows/memory_tools_tests.rs
index 60fca55af3..265b64f6bf 100644
--- a/crates/openhuman-core/src/flows/memory_tools_tests.rs
+++ b/crates/openhuman-core/src/flows/memory_tools_tests.rs
@@ -65,7 +65,10 @@ fn flow_key_round_trips_through_tags() {
fn learning_kind_maps_categories() {
assert_eq!(learning_kind_for(None), LearningKind::Fact);
assert_eq!(learning_kind_for(Some("core")), LearningKind::Fact);
- assert_eq!(learning_kind_for(Some("Preference")), LearningKind::Preference);
+ assert_eq!(
+ learning_kind_for(Some("Preference")),
+ LearningKind::Preference
+ );
assert_eq!(learning_kind_for(Some("daily")), LearningKind::Other);
}
@@ -97,7 +100,10 @@ async fn flow_filters_isolate_flows_and_cross_flow_sees_all() {
.unwrap();
assert_eq!(list(&config, flow_filter("f1")).await.len(), 1);
assert_eq!(list(&config, cross_flow_filter()).await.len(), 2);
- assert_eq!(forget_matching(&config, flow_filter("f1")).await.unwrap(), 1);
+ assert_eq!(
+ forget_matching(&config, flow_filter("f1")).await.unwrap(),
+ 1
+ );
assert_eq!(list(&config, cross_flow_filter()).await.len(), 1);
}
@@ -113,7 +119,10 @@ async fn forget_matching_refuses_an_empty_filter() {
#[tokio::test]
async fn memory_off_forgets_nothing_and_refuses_writes() {
let (_tmp, config) = off_config();
- assert_eq!(forget_matching(&config, flow_filter("f1")).await.unwrap(), 0);
+ assert_eq!(
+ forget_matching(&config, flow_filter("f1")).await.unwrap(),
+ 0
+ );
let err = remember_keyed(&config, "f1", "k", "v", LearningKind::Fact)
.await
.unwrap_err();
diff --git a/crates/openhuman-core/src/flows/mod.rs b/crates/openhuman-core/src/flows/mod.rs
index db9473d6c1..35ce39dd78 100644
--- a/crates/openhuman-core/src/flows/mod.rs
+++ b/crates/openhuman-core/src/flows/mod.rs
@@ -78,6 +78,6 @@ pub use tinyflows_catalog::{
// subscriber, `flows_delete` and the tinyflows `memory` node adapter reach the
// same helpers through these re-exports so every caller tags identically.
pub use memory_tools::{
- cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, flow_meta, flow_tag, forget_matching,
- remember_keyed, FLOWS_TAG,
+ cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, flow_meta, flow_tag,
+ forget_matching, remember_keyed, FLOWS_TAG,
};
diff --git a/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs b/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs
index e7bc745657..316c354e38 100644
--- a/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs
+++ b/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs
@@ -59,8 +59,8 @@ pub(crate) fn toolkit_has_curated_catalog(toolkit: &str) -> bool {
pub(crate) async fn validate_tool_contracts(config: &Config, graph: &WorkflowGraph) -> Vec<String> {
use crate::flows::tinyflows::caps::fetch_live_toolkit_catalog;
- use tinyagents_harness::tool::{missing_required_args, unsupported_arg_names};
use crate::integrations::composio::contract::toolkit_from_slug;
+ use tinyagents_harness::tool::{missing_required_args, unsupported_arg_names};
let mut errors = Vec::new();
for node in &graph.nodes {
diff --git a/crates/openhuman-core/src/flows/ops/wiring_warnings.rs b/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
index aecb87f9da..2a55023b06 100644
--- a/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
+++ b/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
@@ -96,8 +96,8 @@ pub(super) async fn graph_output_field_warnings(
use crate::flows::tinyflows::caps::fetch_live_toolkit_catalog;
// Reading a graph's `=`-bindings is the engine's grammar, not this host's:
// both helpers were a private copy here until the gates moved upstream.
- use tinyflows::bindings::{collect_expressions, parse_node_binding};
use crate::integrations::composio::contract::toolkit_from_slug;
+ use tinyflows::bindings::{collect_expressions, parse_node_binding};
let mut warnings = Vec::new();
for node in &graph.nodes {
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
index fde6bb2f78..bfc87b03a3 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
@@ -369,9 +369,10 @@ impl MemoryProvider for OpenHumanMemory {
let audit_id = self.tier_gate_write("remember", &action).await?;
let flow_id = self.trusted_flow_id()?;
- let store_result = remember_keyed(&self.config, &flow_id, key, &content, LearningKind::Fact)
- .await
- .map_err(|e| capability_error("remember", &e));
+ let store_result =
+ remember_keyed(&self.config, &flow_id, key, &content, LearningKind::Fact)
+ .await
+ .map_err(|e| capability_error("remember", &e));
Self::record_write_execution(
"remember",
audit_id.as_deref(),
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
index 44d35eb887..7f5d571f5b 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
@@ -242,7 +242,10 @@ async fn remember_search_and_forget_round_trip_in_the_flows_own_scope() {
assert_eq!(results[0]["key"], json!("sent"));
let text = results[0]["text"].as_str().unwrap();
assert!(text.contains("item 43"));
- assert!(text.contains("untrusted-source"), "flow output is marked as data");
+ assert!(
+ text.contains("untrusted-source"),
+ "flow output is marked as data"
+ );
let recalled = adapter
.recall("flows", "newsletter item", json!({"operation": "recall"}))
@@ -310,5 +313,8 @@ fn min_score_keeps_unscored_rows() {
fn plain_agent_learnings_are_trusted_and_everything_else_is_not() {
assert!(!is_untrusted(&MemoryMeta::default()));
assert!(is_untrusted(&crate::flows::flow_meta("f", &[])));
- assert!(is_untrusted(&MemoryMeta::from_source(SourceKind::Composio, None)));
+ assert!(is_untrusted(&MemoryMeta::from_source(
+ SourceKind::Composio,
+ None
+ )));
}