Skip to content

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

style: apply rustfmt import ordering and line wrapping

Steven Enamakeladce25644cb3
diff --git a/crates/openhuman-core/src/agent/progress_tracing.rs b/crates/openhuman-core/src/agent/progress_tracing.rs
index b4422e9db9..22081d7fec 100644
--- a/crates/openhuman-core/src/agent/progress_tracing.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing.rs
@@ -51,12 +51,12 @@
//! [`export_spans`]. The collector has no I/O and no async, so the span shape
//! is exhaustively unit-testable.
+mod graph_langfuse;
/// Journal-backed projection from durable tinyagents observations.
pub(crate) mod journal_projection;
/// Langfuse ingestion exporter (remote push through the configured backend).
pub(crate) mod langfuse;
mod otlp;
-mod graph_langfuse;
/// The [`SpanCollector`] state machine that folds progress events into spans.
mod collector;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs
index 44d4b74c83..e8d5ccc1a9 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs
@@ -4,11 +4,11 @@
use std::collections::BTreeMap;
use crate::agent::progress::AgentProgress;
+use tinyagents_harness::observability::trace_export::SpanKind;
use tinyagents_harness::observability::trace_export::serialize::{
- json_f64, json_str, json_u32, json_u64, json_usize, status_of, truncate_chars,
- MAX_ERROR_MESSAGE_CHARS, MAX_MODEL_CONTENT_CHARS,
+ MAX_ERROR_MESSAGE_CHARS, MAX_MODEL_CONTENT_CHARS, json_f64, json_str, json_u32, json_u64,
+ json_usize, status_of, truncate_chars,
};
-use tinyagents_harness::observability::trace_export::SpanKind;
use super::state::{SpanCollector, SubagentState};
use tinyagents_harness::observability::trace_export::SpanStatus;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs
index fc0f3bd5a4..76cf63997c 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/finish.rs
@@ -5,7 +5,7 @@
use std::collections::BTreeMap;
use tinyagents_harness::observability::trace_export::serialize::{
- json_str, truncate_chars, MAX_ERROR_MESSAGE_CHARS,
+ MAX_ERROR_MESSAGE_CHARS, json_str, truncate_chars,
};
use tinyagents_harness::observability::trace_export::{SpanKind, SpanStatus};
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
index df18f750ec..e0f77f1a06 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
@@ -3,10 +3,10 @@
use std::collections::BTreeMap;
+use tinyagents_harness::observability::trace_export::SpanKind;
use tinyagents_harness::observability::trace_export::serialize::{
- truncate_capture_text, MAX_TOOL_CONTENT_CHARS,
+ MAX_TOOL_CONTENT_CHARS, truncate_capture_text,
};
-use tinyagents_harness::observability::trace_export::SpanKind;
use super::state::SpanCollector;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/export.rs b/crates/openhuman-core/src/agent/progress_tracing/export.rs
index 08de1d9924..cb8618f4f3 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/export.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/export.rs
@@ -1,13 +1,13 @@
//! Handing finished spans to their sink(s): the local NDJSON/log exporter and
//! the remote Langfuse usage-data push.
-use crate::config::schema::AgentTracingConfig;
use crate::config::Config;
+use crate::config::schema::AgentTracingConfig;
use super::langfuse;
use super::otlp;
use crate::config::schema::AgentTracingBackend;
-use tinyagents_harness::observability::trace_export::serialize::{spans_to_ndjson, SpanEnvelope};
+use tinyagents_harness::observability::trace_export::serialize::{SpanEnvelope, spans_to_ndjson};
use tinyagents_harness::observability::trace_export::{RunType, TraceContext, TraceSpan};
/// Map the configured backend onto the upstream NDJSON envelope.
diff --git a/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse.rs b/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse.rs
index f201073023..4c53ec0906 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse.rs
@@ -6,7 +6,7 @@
use std::time::Duration;
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
use tinyagents_graph::{GraphLangfuseExporter, GraphObservation};
use tinyagents_harness::{LangfuseAuth, LangfuseClient, LangfuseTraceConfig};
use tinyflows_bus::runs::FlowRunTrigger;
@@ -67,7 +67,11 @@ fn flow_otlp_requests(
trace: LangfuseTraceConfig,
observations: &[GraphObservation],
) -> tinyagents_harness::error::Result<Vec<Value>> {
- exporter.build_otlp_requests(trace, observations, crate::agent::progress_tracing::export_brand().product)
+ exporter.build_otlp_requests(
+ trace,
+ observations,
+ crate::agent::progress_tracing::export_brand().product,
+ )
}
fn graph_otlp_requests(
@@ -118,7 +122,9 @@ pub(crate) async fn export_graph_run_trace(
return;
}
let token = match direct_backend_credential(config, "flows langfuse export") {
- Some(crate::security::credentials::session_support::BackendCredential::Session(token)) => token,
+ Some(crate::security::credentials::session_support::BackendCredential::Session(token)) => {
+ token
+ }
_ => {
tracing::debug!(target: LOG_TARGET, flow_id = %flow_id, "[flows] langfuse export skipped: hosted backend not available");
return;
@@ -152,9 +158,15 @@ pub(crate) async fn export_graph_run_trace(
&requests,
);
match tokio::time::timeout(PUSH_TIMEOUT, send).await {
- Ok(Ok(())) => tracing::debug!(target: LOG_TARGET, flow_id = %flow_id, thread_id = %thread_id, observation_count = observations.len(), request_count, "[flows] pushed flow run trace to Langfuse"),
- Ok(Err(err)) => tracing::warn!(target: LOG_TARGET, flow_id = %flow_id, thread_id = %thread_id, error = %err, "[flows] langfuse export failed (run unaffected)"),
- Err(_) => tracing::warn!(target: LOG_TARGET, flow_id = %flow_id, thread_id = %thread_id, timeout_secs = PUSH_TIMEOUT.as_secs(), "[flows] langfuse export timed out (run unaffected)"),
+ Ok(Ok(())) => {
+ tracing::debug!(target: LOG_TARGET, flow_id = %flow_id, thread_id = %thread_id, observation_count = observations.len(), request_count, "[flows] pushed flow run trace to Langfuse")
+ }
+ Ok(Err(err)) => {
+ tracing::warn!(target: LOG_TARGET, flow_id = %flow_id, thread_id = %thread_id, error = %err, "[flows] langfuse export failed (run unaffected)")
+ }
+ Err(_) => {
+ tracing::warn!(target: LOG_TARGET, flow_id = %flow_id, thread_id = %thread_id, timeout_secs = PUSH_TIMEOUT.as_secs(), "[flows] langfuse export timed out (run unaffected)")
+ }
}
}
diff --git a/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse_tests.rs
index 7ba8f159d7..a692364a87 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/graph_langfuse_tests.rs
@@ -48,15 +48,7 @@ fn sample_observations(thread_id: &str) -> Vec<GraphObservation> {
step: 1,
},
),
- mk(
- 3,
- 1,
- 1_050,
- GraphEvent::NodeCompleted {
- node,
- step: 1,
- },
- ),
+ mk(3, 1, 1_050, GraphEvent::NodeCompleted { node, step: 1 }),
mk(4, 1, 1_060, GraphEvent::StepCompleted { step: 1 }),
]
}
diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
index 725adade1e..7ea5595d6d 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
@@ -60,7 +60,7 @@ use tinyagents_harness::observability::AgentObservation;
use super::SpanCollector;
use crate::agent::progress::AgentProgress;
-use replay::{json_content_text, turn_outcome_for_failure, user_message_text, Replay};
+use replay::{Replay, json_content_text, turn_outcome_for_failure, user_message_text};
#[path = "journal_replay.rs"]
mod replay;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs
index 86ba9eeb36..50908d0ccb 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection_cost_rollup_tests.rs
@@ -262,8 +262,7 @@ fn cache_creation_tokens_reach_the_projected_generation_span() {
}
/// The answer the crate injects for an unknown tool (`unknown_tool_message`).
-const UNKNOWN_TOOL_ANSWER: &str =
- "unknown tool `send_fax` (arguments: {\"to\":\"1234\"}): no tool \
+const UNKNOWN_TOOL_ANSWER: &str = "unknown tool `send_fax` (arguments: {\"to\":\"1234\"}): no tool \
with that name is available to you, and calling it again will fail the same way.";
/// The crate's recovered pair for an unknown tool (TOOL-11 `recover_tool_call`):
diff --git a/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs b/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs
index 8338c423e5..dcc668a709 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/langfuse.rs
@@ -35,9 +35,9 @@ use serde_json::json;
#[cfg(test)]
use tinyagents_harness::events::AgentEvent;
#[cfg(test)]
-use tinyagents_harness::observability::trace_export::{SpanStatus, TraceSpan};
-#[cfg(test)]
use tinyagents_harness::observability::AgentObservation;
+#[cfg(test)]
+use tinyagents_harness::observability::trace_export::{SpanStatus, TraceSpan};
const LOG_TARGET: &str = "agent-tracing::langfuse";
diff --git a/crates/openhuman-core/src/agent/progress_tracing/otlp.rs b/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
index 4455b6244c..578d80f4b2 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
@@ -5,8 +5,8 @@
//! resolves the backend URL and credential and posts the requests.
use serde_json::Value;
-use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use tinyagents_harness::observability::trace_export::TraceSpan;
+use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use super::langfuse::{environment_for_base, ingestion_url, skip_push};
use crate::config::Config;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs
index 834c7022f8..76f74aa483 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_accuracy_tests.rs
@@ -183,12 +183,14 @@ fn single_synthetic_delta_at_completion_records_no_ttft() {
(simple_call("gpt-6.1-sol"), 9_000),
]);
let g = generations(c.spans())[0];
- assert!(!g
- .attributes
- .contains_key("gen_ai.response.first_token_unix_ms"));
- assert!(!g
- .attributes
- .contains_key("gen_ai.response.time_to_first_token_ms"));
+ assert!(
+ !g.attributes
+ .contains_key("gen_ai.response.first_token_unix_ms")
+ );
+ assert!(
+ !g.attributes
+ .contains_key("gen_ai.response.time_to_first_token_ms")
+ );
assert_eq!(
g.attributes["gen_ai.response.streamed"],
serde_json::json!(false)
@@ -307,12 +309,14 @@ fn turn_without_completion_is_an_error() {
exported_attr(c.spans(), "agent.turn", "langfuse.observation.level").as_deref(),
Some("ERROR")
);
- assert!(exported_attr(
- c.spans(),
- "agent.turn",
- "langfuse.observation.status_message"
- )
- .is_some());
+ assert!(
+ exported_attr(
+ c.spans(),
+ "agent.turn",
+ "langfuse.observation.status_message"
+ )
+ .is_some()
+ );
}
#[test]
@@ -332,10 +336,12 @@ fn failed_turn_message_is_content_gated() {
let mut captured = collect_with_capture(&[(AgentProgress::TurnStarted, 1_000)]);
captured.finish_with_outcome(2_000, Some(failed()));
let turn = find(captured.spans(), "agent.turn");
- assert!(turn.attributes["error.message"]
- .as_str()
- .unwrap()
- .contains("provider rejected"));
+ assert!(
+ turn.attributes["error.message"]
+ .as_str()
+ .unwrap()
+ .contains("provider rejected")
+ );
}
#[test]
@@ -465,9 +471,10 @@ fn unpriced_model_unknown_cost_is_not_recorded() {
g.attributes["gen_ai.cost.source"],
serde_json::json!("unpriced")
);
- assert!(!g
- .attributes
- .contains_key("gen_ai.pricing.input_per_mtok_usd"));
+ assert!(
+ !g.attributes
+ .contains_key("gen_ai.pricing.input_per_mtok_usd")
+ );
assert_eq!(
exported_attr(
c.spans(),
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
index 6b6bab88b4..323b8dbf4d 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
@@ -96,12 +96,14 @@ fn tool_io_is_captured_when_capture_content_is_on() {
4,
);
let child_tool = find(c.spans(), "tool.read_file");
- assert!(child_tool
- .input
- .as_ref()
- .and_then(|v| v.as_str())
- .unwrap()
- .contains("notes.md"));
+ assert!(
+ child_tool
+ .input
+ .as_ref()
+ .and_then(|v| v.as_str())
+ .unwrap()
+ .contains("notes.md")
+ );
assert_eq!(
child_tool.output.as_ref().and_then(|v| v.as_str()),
Some("file contents")
@@ -335,12 +337,16 @@ fn zero_reasoning_turn_leaves_root_without_reasoning_attr() {
]);
c.finish(20);
let turn = find(c.spans(), "agent.turn");
- assert!(!turn
- .attributes
- .contains_key("gen_ai.usage.reasoning_tokens"));
- assert!(!turn
- .attributes
- .contains_key("gen_ai.usage.cache_creation_tokens"));
+ assert!(
+ !turn
+ .attributes
+ .contains_key("gen_ai.usage.reasoning_tokens")
+ );
+ assert!(
+ !turn
+ .attributes
+ .contains_key("gen_ai.usage.cache_creation_tokens")
+ );
}
// ── run-type classification ─────────────────────────────────────────────────
@@ -498,12 +504,14 @@ fn generation_records_request_messages_and_completion_when_capture_on() {
input.to_string().contains("You are OpenHuman."),
"system prompt must land in the generation input: {input}"
);
- assert!(generation
- .output
- .as_ref()
- .expect("generation output")
- .to_string()
- .contains("hello"));
+ assert!(
+ generation
+ .output
+ .as_ref()
+ .expect("generation output")
+ .to_string()
+ .contains("hello")
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs
index 7a370d27d7..8fb012217a 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_span_tree_tests.rs
@@ -1,8 +1,8 @@
use super::*;
use crate::agent::progress_tracing::export::export_spans;
-use tinyagents_harness::observability::trace_export::serialize::SpanEnvelope;
use tinyagents_harness::observability::trace_export::SpanKind;
+use tinyagents_harness::observability::trace_export::serialize::SpanEnvelope;
// ── config ────────────────────────────────────────────────────────────────
#[test]
@@ -431,10 +431,11 @@ fn finish_seals_all_open_spans_idempotently() {
assert!(c.spans().iter().all(|s| s.end_unix_ms.is_some()));
// idempotent.
c.finish(200);
- assert!(c
- .spans()
- .iter()
- .all(|s| s.end_unix_ms == Some(s.end_unix_ms.unwrap())));
+ assert!(
+ c.spans()
+ .iter()
+ .all(|s| s.end_unix_ms == Some(s.end_unix_ms.unwrap()))
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
index 727656d92e..fae3b5d53d 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_stop_tests.rs
@@ -5,8 +5,8 @@
use super::*;
-use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use tinyagents_harness::observability::trace_export::SpanStatus;
+use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use tinyagents_harness::turn_stop::TurnStop;
const BREAKER_NOTE: &str = "Stopping after 2 attempt(s): failure class \
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
index b85faccd5b..ffa8682685 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_ttft_tests.rs
@@ -3,8 +3,8 @@
use super::*;
-use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
use tinyagents_harness::observability::trace_export::SpanKind;
+use tinyagents_harness::observability::trace_export::otlp::otlp_requests;
fn iteration(iteration: u32) -> AgentProgress {
AgentProgress::IterationStarted {
@@ -90,12 +90,16 @@ fn unary_call_carries_no_first_token_attributes() {
(completed(1), 2_500),
]);
let generation = generations(c.spans())[0];
- assert!(!generation
- .attributes
- .contains_key("gen_ai.response.first_token_unix_ms"));
- assert!(!generation
- .attributes
- .contains_key("gen_ai.response.time_to_first_text_ms"));
+ assert!(
+ !generation
+ .attributes
+ .contains_key("gen_ai.response.first_token_unix_ms")
+ );
+ assert!(
+ !generation
+ .attributes
+ .contains_key("gen_ai.response.time_to_first_text_ms")
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/flows/ops/execution_tests.rs b/crates/openhuman-core/src/flows/ops/execution_tests.rs
index abb988d19e..65e3f591e6 100644
--- a/crates/openhuman-core/src/flows/ops/execution_tests.rs
+++ b/crates/openhuman-core/src/flows/ops/execution_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use tinyflows::graph::ids;
use tinyflows::graph::GraphEvent;
+use tinyflows::graph::ids;
#[test]
fn graph_observations_are_adapted_without_changing_their_wire_shape() {
@@ -29,7 +29,10 @@ fn graph_observations_are_adapted_without_changing_their_wire_shape() {
serde_json::to_value(&engine).unwrap(),
serde_json::to_value(&converted[0]).unwrap()
);
- assert_eq!(converted[0].thread_id.as_ref().map(|id| id.as_str()), Some(thread_id));
+ assert_eq!(
+ converted[0].thread_id.as_ref().map(|id| id.as_str()),
+ Some(thread_id)
+ );
assert_eq!(converted[0].event_id.as_str(), "evt-1");
assert_eq!(converted[0].step, 1);
assert_eq!(converted[0].ts_ms, 1_020);
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
index 8158fa2b87..766c097772 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
@@ -12,14 +12,14 @@ use std::borrow::Cow;
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
use super::*;
use crate::config::Config;
use crate::flows::agent_route::{
- harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref, AgentRoute,
+ AgentRoute, harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref,
};
/// [`AgentRunner`] backing an `agent` node's `agent_ref`. It runs the selected
@@ -461,9 +461,9 @@ impl OpenHumanAgentRunner {
.map_err(EngineError::Capability)?
.ok_or_else(|| {
EngineError::Capability(format!(
- "agent node: unknown agent_ref '{agent_ref}' (neither a harness definition nor \
+ "agent node: unknown agent_ref '{agent_ref}' (neither a harness definition nor \
a custom agent registry entry)"
- ))
+ ))
})?;
if !entry.enabled {
return Err(EngineError::Capability(format!(
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs b/crates/openhuman-core/src/flows/tinyflows/caps/code.rs
index 83b179c481..3beaf27008 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/code.rs
@@ -9,7 +9,7 @@ use crate::core::runtime::DispatchCtx;
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
index 8087cc9a1a..ecf919b9b2 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
@@ -12,14 +12,14 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
use super::*;
use crate::config::{Config, HttpRequestConfig};
-use crate::security::credentials::{HttpCredential, HttpCredentialsStore};
use crate::security::SecurityPolicy;
+use crate::security::credentials::{HttpCredential, HttpCredentialsStore};
use crate::tools::http_request_tool;
use tinybox_bus::CommandClass;
use tinytools::Tool as _;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs
index 4611d7f543..cff79e191b 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs
@@ -9,9 +9,11 @@ fn credential_resolution_ignores_absent_and_foreign_refs() {
let tmp = tempfile::TempDir::new().unwrap();
let store = store(&tmp);
assert!(resolve_http_credential(&store, None).unwrap().is_none());
- assert!(resolve_http_credential(&store, Some("composio:x:y"))
- .unwrap()
- .is_none());
+ assert!(
+ resolve_http_credential(&store, Some("composio:x:y"))
+ .unwrap()
+ .is_none()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs b/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs
index 58b5e453dd..7ec03f8fcb 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs
@@ -8,7 +8,7 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
index 9df7c4f112..3162342e45 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs
@@ -16,9 +16,9 @@ pub(crate) use crate::integrations::composio::flow_gate::composio_connection_id;
use std::sync::Arc;
use async_trait::async_trait;
+use serde_json::Value;
#[cfg(test)]
use serde_json::json;
-use serde_json::Value;
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
#[cfg(test)]
@@ -30,11 +30,11 @@ use crate::config::HttpRequestConfig;
#[cfg(test)]
use crate::flows;
#[cfg(test)]
-use crate::security::credentials::HttpCredential;
-use crate::security::credentials::HttpCredentialsStore;
-#[cfg(test)]
use crate::security::GateDecision;
use crate::security::SecurityPolicy;
+#[cfg(test)]
+use crate::security::credentials::HttpCredential;
+use crate::security::credentials::HttpCredentialsStore;
use tinybox_bus::CommandClass;
use super::*;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
index 476f84bcd2..8ffe8fa8d1 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
@@ -27,18 +27,22 @@ fn http_request_node_tier_gate_blocks_readonly_allows_higher() {
// Supervised/full do not hard-block — they fall through to the
// ApprovalGate (which performs the Prompt round-trip).
- assert!(enforce_node_tier_gate(
- &policy(AutonomyLevel::Supervised),
- CommandClass::Network,
- "http_request"
- )
- .is_ok());
- assert!(enforce_node_tier_gate(
- &policy(AutonomyLevel::Full),
- CommandClass::Network,
- "http_request"
- )
- .is_ok());
+ assert!(
+ enforce_node_tier_gate(
+ &policy(AutonomyLevel::Supervised),
+ CommandClass::Network,
+ "http_request"
+ )
+ .is_ok()
+ );
+ assert!(
+ enforce_node_tier_gate(
+ &policy(AutonomyLevel::Full),
+ CommandClass::Network,
+ "http_request"
+ )
+ .is_ok()
+ );
}
/// The tier gate a `code` (Write-class) node calls: BLOCKED under read-only,
@@ -47,18 +51,22 @@ fn http_request_node_tier_gate_blocks_readonly_allows_higher() {
fn code_node_tier_gate_blocks_readonly_allows_full() {
use crate::security::AutonomyLevel;
- assert!(enforce_node_tier_gate(
- &policy(AutonomyLevel::ReadOnly),
- CommandClass::Write,
- "code"
- )
- .is_err());
- assert!(enforce_node_tier_gate(
- &policy(AutonomyLevel::Supervised),
- CommandClass::Write,
- "code"
- )
- .is_ok());
+ assert!(
+ enforce_node_tier_gate(
+ &policy(AutonomyLevel::ReadOnly),
+ CommandClass::Write,
+ "code"
+ )
+ .is_err()
+ );
+ assert!(
+ enforce_node_tier_gate(
+ &policy(AutonomyLevel::Supervised),
+ CommandClass::Write,
+ "code"
+ )
+ .is_ok()
+ );
assert!(
enforce_node_tier_gate(&policy(AutonomyLevel::Full), CommandClass::Write, "code").is_ok()
);
@@ -281,22 +289,20 @@ fn prompt_decision_escalates_default_workflow_origin() {
/// escalation — it's already forced through the parking flow.
#[test]
fn prompt_decision_does_not_re_escalate_already_gated_workflow() {
- assert!(escalated_origin_for_prompt(
- GateDecision::Prompt,
- Some(workflow_origin("flow-1", true))
- )
- .is_none());
+ assert!(
+ escalated_origin_for_prompt(GateDecision::Prompt, Some(workflow_origin("flow-1", true)))
+ .is_none()
+ );
}
/// An `Allow` tier decision never escalates, regardless of the workflow's
/// `require_approval` toggle — Full-tier runs keep running unattended.
#[test]
fn allow_decision_never_escalates() {
- assert!(escalated_origin_for_prompt(
- GateDecision::Allow,
- Some(workflow_origin("flow-1", false))
- )
- .is_none());
+ assert!(
+ escalated_origin_for_prompt(GateDecision::Allow, Some(workflow_origin("flow-1", false)))
+ .is_none()
+ );
}
/// No scoped origin (or a non-Workflow origin) never escalates — there is
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs
index c786002dc7..e2ea1f61e9 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs
@@ -190,15 +190,17 @@ async fn captured_agent_and_config_fn_tiers_are_not_replaced_by_parent_file() {
&captured.workspace_dir,
&captured.action_dir,
);
- assert!(enforce_current_node_tier_gate(
- &captured_ctx,
- &captured,
- &captured_policy,
- CommandClass::Write,
- "code"
- )
- .await
- .is_err());
+ assert!(
+ enforce_current_node_tier_gate(
+ &captured_ctx,
+ &captured,
+ &captured_policy,
+ CommandClass::Write,
+ "code"
+ )
+ .await
+ .is_err()
+ );
// A fixed ceiling contributes independently of a disabled file tier.
parent_file.autonomy.enabled = false;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs b/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs
index 8797ee1242..f67b0b08d4 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs
@@ -12,13 +12,13 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
use super::*;
use crate::config::Config;
-use crate::inference::provider::{is_raw_passthrough_model, BilledUsage};
+use crate::inference::provider::{BilledUsage, is_raw_passthrough_model};
use tinyagents_session::transcript::TranscriptMessage;
use tinyflows::nodes::integration::agent_prompt;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs b/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs
index 168c97653f..6da6efe067 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs
@@ -7,7 +7,7 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::*;
use tinyflows::error::{EngineError, Result};
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs
index eaebdf2bb5..31f52bb4da 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs
@@ -5,7 +5,7 @@ use serde_json::Value;
use tinybox_bus::CommandClass;
use tinyflows::error::{EngineError, Result};
-use super::{ToolBackend, ToolCallCtx, NATIVE_TOOL_PREFIX};
+use super::{NATIVE_TOOL_PREFIX, ToolBackend, ToolCallCtx};
pub(crate) struct NativeToolBackend;
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
index 1f263bfe7f..e3670167e5 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs
@@ -34,7 +34,7 @@
use std::sync::Arc;
use async_trait::async_trait;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyflows::caps::MemoryProvider;
use tinyflows::error::{EngineError, Result};
@@ -43,15 +43,15 @@ use crate::agent::turn_origin;
use crate::agent::turn_origin::{AgentTurnOrigin, TrustedAutomationSource};
use crate::config::Config;
use crate::flows::{
- cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, forget_matching, remember_keyed,
- FLOWS_TAG,
+ FLOWS_TAG, cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, forget_matching,
+ remember_keyed,
};
-use crate::memory::types::{FetchParams, RecallParams};
use crate::memory::MemoryError;
+use crate::memory::types::{FetchParams, RecallParams};
+use crate::security::SecurityPolicy;
use crate::security::approval::{
- redact_args, summarize_action, ApprovalGate, ExecutionOutcome, GateOutcome,
+ ApprovalGate, ExecutionOutcome, GateOutcome, redact_args, summarize_action,
};
-use crate::security::SecurityPolicy;
use tinybox_bus::CommandClass;
use tinymemory_api::wrap_untrusted_for_agent;
use tinymemory_api::{Hit, LearningKind, MemoryMeta, MetaFilter, SourceKind};
diff --git a/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs b/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs
index b2263a8b1c..8cce1f390e 100644
--- a/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs
@@ -8,8 +8,8 @@ use super::*;
/// silently returns the UI to that state with every other test still green.
#[test]
fn on_step_start_is_implemented_so_the_running_status_can_reach_the_canvas() {
- use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicBool, Ordering};
// A probe observer whose `on_step_start` records that the *trait's*
// dispatch reached an override rather than the blanket default.
diff --git a/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs b/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs
index 1fa075e43d..935abc8fe7 100644
--- a/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs
@@ -1,6 +1,6 @@
use super::*;
use crate::flows::agent_route::{
- harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref, AgentRoute,
+ AgentRoute, harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref,
};
use crate::flows::tinyflows::caps::OpenHumanCode;
@@ -421,7 +421,7 @@ fn route_custom_entry_lookup_falls_back_when_no_entry_exists() {
/// not cross, even when a third context is ambient.
#[tokio::test]
async fn adapters_act_for_the_context_they_were_handed_not_the_ambient_one() {
- use crate::core::runtime::{context::CoreContext, ComponentSet, DispatchCtx, DomainSet};
+ use crate::core::runtime::{ComponentSet, DispatchCtx, DomainSet, context::CoreContext};
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);