The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: files changed crates/openhuman-core/src/agent/debug/mod_tests.rs,crates/openhuman-core/src/ag
Steven Enamakel938bcb6d40e5
diff --git a/crates/openhuman-core/src/agent/debug/mod_tests.rs b/crates/openhuman-core/src/agent/debug/mod_tests.rsindex 5f4d712725..327b7b4b1e 100644--- a/crates/openhuman-core/src/agent/debug/mod_tests.rs+++ b/crates/openhuman-core/src/agent/debug/mod_tests.rs@@ -20,7 +20,10 @@ async fn debug_dump_composes_each_flow_prompt_from_the_copilot_bus() {let prompt = render_via_session(&config, agent_id).await.unwrap_or_else(|error| panic!("rendering {agent_id}: {error:#}"));- assert!(prompt.text.contains(required), "{agent_id} prompt missing {required}");+ assert!(+ prompt.text.contains(required),+ "{agent_id} prompt missing {required}"+ );assert!(prompt.text.contains("## Workspace"));}}diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/events.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/events.rsindex e8d5ccc1a9..44d4b74c83 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::{- MAX_ERROR_MESSAGE_CHARS, MAX_MODEL_CONTENT_CHARS, json_f64, json_str, json_u32, json_u64,- json_usize, status_of, truncate_chars,+ json_f64, json_str, json_u32, json_u64, json_usize, status_of, truncate_chars,+ MAX_ERROR_MESSAGE_CHARS, MAX_MODEL_CONTENT_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.rsindex 76cf63997c..fc0f3bd5a4 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::{- MAX_ERROR_MESSAGE_CHARS, json_str, truncate_chars,+ json_str, truncate_chars, MAX_ERROR_MESSAGE_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.rsindex e0f77f1a06..df18f750ec 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::{- MAX_TOOL_CONTENT_CHARS, truncate_capture_text,+ truncate_capture_text, MAX_TOOL_CONTENT_CHARS,};+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.rsindex cb8618f4f3..08de1d9924 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::Config;use crate::config::schema::AgentTracingConfig;+use crate::config::Config;use super::langfuse;use super::otlp;use crate::config::schema::AgentTracingBackend;-use tinyagents_harness::observability::trace_export::serialize::{SpanEnvelope, spans_to_ndjson};+use tinyagents_harness::observability::trace_export::serialize::{spans_to_ndjson, SpanEnvelope};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/flow_export.rs b/crates/openhuman-core/src/agent/progress_tracing/flow_export.rsindex 0e69b833f8..047f73e339 100644--- a/crates/openhuman-core/src/agent/progress_tracing/flow_export.rs+++ b/crates/openhuman-core/src/agent/progress_tracing/flow_export.rs@@ -7,7 +7,7 @@use std::time::Duration;-use serde_json::{Map, Value, json};+use serde_json::{json, Map, Value};use tinyagents_graph::{GraphLangfuseExporter, GraphObservation};use tinyagents_harness::{LangfuseAuth, LangfuseClient, LangfuseTraceConfig};use tinyflows_bus::runs::FlowRunTrigger;diff --git a/crates/openhuman-core/src/agent/progress_tracing/flow_export_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/flow_export_tests.rsindex 4ad970d9e1..28f61738fb 100644--- a/crates/openhuman-core/src/agent/progress_tracing/flow_export_tests.rs+++ b/crates/openhuman-core/src/agent/progress_tracing/flow_export_tests.rs@@ -170,7 +170,10 @@ fn flow_batch_keeps_trace_metadata_and_agent_graph_node_keys() {assert_eq!(trace_event["body"]["metadata"]["source"], "flows");assert_eq!(trace_event["body"]["metadata"]["run_type"], "flow");assert_eq!(trace_event["body"]["metadata"]["trigger"], "rpc");- assert_eq!(trace_event["body"]["tags"], json!(["run:flow", "trigger:rpc"]));+ assert_eq!(+ trace_event["body"]["tags"],+ json!(["run:flow", "trigger:rpc"])+ );assert_eq!(trace_event["body"]["release"], APP_VERSION);assert_eq!(trace_event["body"]["metadata"]["app_version"], APP_VERSION);diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rsindex 7ea5595d6d..725adade1e 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::{Replay, json_content_text, turn_outcome_for_failure, user_message_text};+use replay::{json_content_text, turn_outcome_for_failure, user_message_text, Replay};#[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.rsindex 50908d0ccb..86ba9eeb36 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,7 +262,8 @@ 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.rsindex dcc668a709..8338c423e5 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::AgentObservation;-#[cfg(test)]use tinyagents_harness::observability::trace_export::{SpanStatus, TraceSpan};+#[cfg(test)]+use tinyagents_harness::observability::AgentObservation;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.rsindex 578d80f4b2..4455b6244c 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::TraceSpan;use tinyagents_harness::observability::trace_export::otlp::otlp_requests;+use tinyagents_harness::observability::trace_export::TraceSpan;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.rsindex 76f74aa483..834c7022f8 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,14 +183,12 @@ 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)@@ -309,14 +307,12 @@ 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]@@ -336,12 +332,10 @@ 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]@@ -471,10 +465,9 @@ 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.rsindex 323b8dbf4d..6b6bab88b4 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,14 +96,12 @@ 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")@@ -337,16 +335,12 @@ 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 ─────────────────────────────────────────────────@@ -504,14 +498,12 @@ 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.rsindex 8fb012217a..7a370d27d7 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::SpanKind;use tinyagents_harness::observability::trace_export::serialize::SpanEnvelope;+use tinyagents_harness::observability::trace_export::SpanKind;// ── config ────────────────────────────────────────────────────────────────#[test]@@ -431,11 +431,10 @@ 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.rsindex fae3b5d53d..727656d92e 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::SpanStatus;use tinyagents_harness::observability::trace_export::otlp::otlp_requests;+use tinyagents_harness::observability::trace_export::SpanStatus;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.rsindex ffa8682685..b85faccd5b 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::SpanKind;use tinyagents_harness::observability::trace_export::otlp::otlp_requests;+use tinyagents_harness::observability::trace_export::SpanKind;fn iteration(iteration: u32) -> AgentProgress {AgentProgress::IterationStarted {@@ -90,16 +90,12 @@ 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/agent/prompts/flow_archetype.rs b/crates/openhuman-core/src/agent/prompts/flow_archetype.rsindex 8c61d72a27..d1ee10ebfd 100644--- a/crates/openhuman-core/src/agent/prompts/flow_archetype.rs+++ b/crates/openhuman-core/src/agent/prompts/flow_archetype.rs@@ -12,7 +12,10 @@ use crate::{agent::harness::host_definition::AgentDefinition, config::Config};pub(crate) fn is_bus_backed_builtin(definition: &AgentDefinition) -> bool {matches!(&definition.source, DefinitionSource::Builtin)&& matches!(&definition.system_prompt, PromptSource::Dynamic(()))- && matches!(definition.id.as_str(), "workflow_builder" | "flow_discovery")+ && matches!(+ definition.id.as_str(),+ "workflow_builder" | "flow_discovery"+ )}/// Fetch the archetype for a resolved definition through the module bus.diff --git a/crates/openhuman-core/src/agent/prompts/mod.rs b/crates/openhuman-core/src/agent/prompts/mod.rsindex dd209ddef6..c230565b7d 100644--- a/crates/openhuman-core/src/agent/prompts/mod.rs+++ b/crates/openhuman-core/src/agent/prompts/mod.rs@@ -4,11 +4,11 @@pub mod types;pub use types::*;+mod connected_identities;#[cfg(feature = "flows")]pub(crate) mod flow_archetype;#[cfg(feature = "flows")]pub(crate) mod flow_archetype;-mod connected_identities;pub use connected_identities::render_connected_identities;pub mod agents_md;diff --git a/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt.rsindex 0e2c0aa91a..adc2887e7c 100644--- a/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt.rs@@ -9,9 +9,9 @@ use crate::agent::prompts::PromptContext;use anyhow::{anyhow, Result};pub fn build(ctx: &PromptContext<'_>) -> Result<String> {- let archetype = ctx.flow_archetype_text.ok_or_else(|| {- anyhow!("flow_discovery requires a scoped TinyFlows GetPrompt response")- })?;+ let archetype = ctx+ .flow_archetype_text+ .ok_or_else(|| anyhow!("flow_discovery requires a scoped TinyFlows GetPrompt response"))?;super::super::flow_prompts::build_with_archetype(ctx, archetype)}diff --git a/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt_tests.rsindex cb3f586b36..b6ff561bd4 100644--- a/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/flow_discovery/prompt_tests.rs@@ -32,16 +32,20 @@ async fn module_prompt_teaches_the_read_only_emit_invariant() {..crate::config::Config::default()};let registry = crate::agent::harness::host_definition::AgentDefinitionRegistry::builtins_only();- let definition = registry.get("flow_discovery").expect("flow_discovery builtin");- let archetype = crate::agent::prompts::flow_archetype::load_for_definition(- Some(&config),- definition,- )- .await- .expect("TinyFlows GetPrompt succeeds")- .expect("flow builtin prompt");- let body = build(&ctx(workspace.path(), &std::collections::HashSet::new(), Some(&archetype)))- .expect("compose module prompt");+ let definition = registry+ .get("flow_discovery")+ .expect("flow_discovery builtin");+ let archetype =+ crate::agent::prompts::flow_archetype::load_for_definition(Some(&config), definition)+ .await+ .expect("TinyFlows GetPrompt succeeds")+ .expect("flow builtin prompt");+ let body = build(&ctx(+ workspace.path(),+ &std::collections::HashSet::new(),+ Some(&archetype),+ ))+ .expect("compose module prompt");let lc = body.to_lowercase();assert!(lc.contains("suggest_workflows"), "must name the emit tool");assert!(diff --git a/crates/openhuman-core/src/agent/registry/agents/mod.rs b/crates/openhuman-core/src/agent/registry/agents/mod.rsindex b22e6eee6c..ac9cbeb1ec 100644--- a/crates/openhuman-core/src/agent/registry/agents/mod.rs+++ b/crates/openhuman-core/src/agent/registry/agents/mod.rs@@ -31,6 +31,8 @@ mod flow_prompts;mod fleet_prompt_tests;pub mod critic;+#[cfg(feature = "flows")]+pub mod flow_discovery;pub mod image_agent;pub mod morning_briefing;pub mod orchestrator;@@ -43,8 +45,6 @@ pub mod trigger_triage;pub mod video_agent;pub mod vision_agent;#[cfg(feature = "flows")]-pub mod flow_discovery;-#[cfg(feature = "flows")]pub mod workflow_builder;pub use loader::{load_builtins, validate_tier_hierarchy, BuiltinAgent, BUILTINS};diff --git a/crates/openhuman-core/src/agent/registry/agents/workflow_builder/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/workflow_builder/prompt_tests.rsindex 7ba4dcac26..3bca18cf47 100644--- a/crates/openhuman-core/src/agent/registry/agents/workflow_builder/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/workflow_builder/prompt_tests.rs@@ -3,7 +3,10 @@ use crate::agent::prompts::{PromptContext, PromptTool};#[test]fn builder_prompt_composes_supplied_archetype_tools_and_workspace() {let temp = tempfile::tempdir().expect("workspace");- let tools = [PromptTool::new("save_workflow", "Save the proposed workflow")];+ let tools = [PromptTool::new(+ "save_workflow",+ "Save the proposed workflow",+ )];let visible = std::collections::HashSet::from(["save_workflow".to_string()]);let context = PromptContext {workspace_dir: temp.path(),diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rsindex 804d736d23..ffcf2c471b 100644--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs@@ -279,9 +279,8 @@ impl OpenHumanTurnPrelude {None};let prefix = if cold {- let tiered = self.build_system_prompt_tiered_with_flow_archetype(- flow_archetype_text.as_deref(),- )?;+ let tiered = self+ .build_system_prompt_tiered_with_flow_archetype(flow_archetype_text.as_deref())?;Some(super::prefix_snapshot::tiered_prefix_snapshot(&tiered))} else {Nonediff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rsindex 395aca2238..4bef2e959b 100644--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs@@ -197,10 +197,11 @@ async fn explicit_flow_session_prompt_override_does_not_require_tinyflows_or_conconfig_path: temp.path().join("config.toml"),..Default::default()};- let mut definition = crate::agent::harness::host_definition::AgentDefinitionRegistry::builtins_only()- .get("workflow_builder")- .expect("workflow_builder builtin")- .clone();+ let mut definition =+ crate::agent::harness::host_definition::AgentDefinitionRegistry::builtins_only()+ .get("workflow_builder")+ .expect("workflow_builder builtin")+ .clone();definition.source = DefinitionSource::CustomRegistry;definition.system_prompt = PromptSource::Inline("session-owned flow prompt".into());diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rsindex c0cd15cd7d..1144ba5114 100644--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs@@ -801,8 +801,7 @@ async fn run_typed_mode(agents_md_local: agents_md.local.clone(),};- let archetype_prompt_body =- load_typed_prompt_source(definition, config, prompt_ctx).await?;+ let archetype_prompt_body = load_typed_prompt_source(definition, config, prompt_ctx).await?;let system_prompt = match &definition.system_prompt {// The whole prompt, with no sub-agent sections around it.PromptSource::Dynamic(_) | PromptSource::Verbatim(_) => archetype_prompt_body,diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner_flow_prompt_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner_flow_prompt_tests.rsindex 211d401f13..b3140ff5e7 100644--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner_flow_prompt_tests.rs+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner_flow_prompt_tests.rs@@ -1,10 +1,7 @@use super::*;#[cfg(feature = "flows")]-fn prompt_context<'a>(- workspace: &'a std::path::Path,- agent_id: &'a str,-) -> PromptContext<'a> {+fn prompt_context<'a>(workspace: &'a std::path::Path, agent_id: &'a str) -> PromptContext<'a> {static VISIBLE: std::sync::OnceLock<std::collections::HashSet<String>> =std::sync::OnceLock::new();PromptContext {@@ -48,7 +45,10 @@ async fn typed_subagent_prompts_use_scoped_bus_text_for_both_flow_builtins() {let body = load_typed_prompt_source(definition, &loaded_config, context).await.unwrap_or_else(|error| panic!("loading {agent_id} prompt: {error}"));- assert!(body.contains(expected_tool), "{agent_id} prompt missing its tool");+ assert!(+ body.contains(expected_tool),+ "{agent_id} prompt missing its tool"+ );assert!(body.contains("## Workspace"));}}diff --git a/crates/openhuman-core/src/flows/ops/execution_tests.rs b/crates/openhuman-core/src/flows/ops/execution_tests.rsindex 65e3f591e6..37a3098deb 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::GraphEvent;use tinyflows::graph::ids;+use tinyflows::graph::GraphEvent;#[test]fn graph_observations_are_adapted_without_changing_their_wire_shape() {diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rsindex 766c097772..854a10d4e4 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::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};use super::*;use crate::config::Config;use crate::flows::agent_route::{- AgentRoute, harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref,+ harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref, AgentRoute,};/// [`AgentRunner`] backing an `agent` node's `agent_ref`. It runs the selecteddiff --git a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs b/crates/openhuman-core/src/flows/tinyflows/caps/code.rsindex 3beaf27008..83b179c481 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::{Value, json};+use serde_json::{json, Value};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.rsindex ecf919b9b2..8087cc9a1a 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::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};use super::*;use crate::config::{Config, HttpRequestConfig};-use crate::security::SecurityPolicy;use crate::security::credentials::{HttpCredential, HttpCredentialsStore};+use crate::security::SecurityPolicy;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.rsindex cff79e191b..4611d7f543 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs@@ -9,11 +9,9 @@ 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.rsindex 7ec03f8fcb..58b5e453dd 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::{Value, json};+use serde_json::{json, Value};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.rsindex 3162342e45..9df7c4f112 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::GateDecision;-use crate::security::SecurityPolicy;-#[cfg(test)]use crate::security::credentials::HttpCredential;use crate::security::credentials::HttpCredentialsStore;+#[cfg(test)]+use crate::security::GateDecision;+use crate::security::SecurityPolicy;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.rsindex 8ffe8fa8d1..476f84bcd2 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,22 +27,18 @@ 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,@@ -51,22 +47,18 @@ 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());@@ -289,20 +281,22 @@ 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 isdiff --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.rsindex e2ea1f61e9..c786002dc7 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,17 +190,15 @@ 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.rsindex f67b0b08d4..8797ee1242 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::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};use super::*;use crate::config::Config;-use crate::inference::provider::{BilledUsage, is_raw_passthrough_model};+use crate::inference::provider::{is_raw_passthrough_model, BilledUsage};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.rsindex 6da6efe067..168c97653f 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::{Value, json};+use serde_json::{json, Value};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.rsindex 31f52bb4da..eaebdf2bb5 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::{NATIVE_TOOL_PREFIX, ToolBackend, ToolCallCtx};+use super::{ToolBackend, ToolCallCtx, NATIVE_TOOL_PREFIX};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.rsindex e3670167e5..1f263bfe7f 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::{Value, json};+use serde_json::{json, Value};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::{- FLOWS_TAG, cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, forget_matching,- remember_keyed,+ cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, forget_matching, remember_keyed,+ FLOWS_TAG,};-use crate::memory::MemoryError;use crate::memory::types::{FetchParams, RecallParams};-use crate::security::SecurityPolicy;+use crate::memory::MemoryError;use crate::security::approval::{- ApprovalGate, ExecutionOutcome, GateOutcome, redact_args, summarize_action,+ redact_args, summarize_action, ApprovalGate, ExecutionOutcome, GateOutcome,};+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.rsindex 8cce1f390e..b2263a8b1c 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::Arc;use std::sync::atomic::{AtomicBool, Ordering};+ use std::sync::Arc;// 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.rsindex 935abc8fe7..1fa075e43d 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::{- AgentRoute, harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref,+ harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref, AgentRoute,};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::{ComponentSet, DispatchCtx, DomainSet, context::CoreContext};+ use crate::core::runtime::{context::CoreContext, ComponentSet, DispatchCtx, DomainSet};let tmp = TempDir::new().unwrap();let config = test_config(&tmp);diff --git a/crates/openhuman-core/src/mcp/server/resources.rs b/crates/openhuman-core/src/mcp/server/resources.rsindex b771107b9c..30bd05d0eb 100644--- a/crates/openhuman-core/src/mcp/server/resources.rs+++ b/crates/openhuman-core/src/mcp/server/resources.rs@@ -175,10 +175,9 @@ pub async fn read_resource() -> Result<Value, ToolCallError> {#[cfg(feature = "flows")]if let Some(agent_id) = flow_prompt_agent_id(uri) {- let config = ctx- .load_config()- .await- .map_err(|_| ToolCallError::Internal("TinyFlows prompt config is unavailable".into()))?;+ let config = ctx.load_config().await.map_err(|_| {+ ToolCallError::Internal("TinyFlows prompt config is unavailable".into())+ })?;return read_flow_prompt(&config, uri, agent_id).await;}diff --git a/crates/openhuman-core/src/mcp/server/resources_tests.rs b/crates/openhuman-core/src/mcp/server/resources_tests.rsindex 3b609552ab..7db25b35ec 100644--- a/crates/openhuman-core/src/mcp/server/resources_tests.rs+++ b/crates/openhuman-core/src/mcp/server/resources_tests.rs@@ -57,8 +57,8 @@ async fn flow_prompt_resource_fails_closed_when_tinyflows_is_disabled() {),);let error = read_resource(&ctx, "openhuman://prompts/agents/flow_discovery")- .await- .expect_err("disabled TinyFlows must not expose a copied prompt");+ .await+ .expect_err("disabled TinyFlows must not expose a copied prompt");assert_eq!(error.code(), -32603);assert!(error.message().contains("unavailable"));}diff --git a/tests/tinyflows_published_prompt_e2e.rs b/tests/tinyflows_published_prompt_e2e.rsindex bb9514978b..dc6ada5af0 100644--- a/tests/tinyflows_published_prompt_e2e.rs+++ b/tests/tinyflows_published_prompt_e2e.rs@@ -1,9 +1,9 @@//! Normal-host prompt composition against the checksum-verified TinyFlows v0.8.26 module.-#[path = "support/published_tinyflows.rs"]-mod published_tinyflows;#[path = "support/env_guard.rs"]mod env_guard;+#[path = "support/published_tinyflows.rs"]+mod published_tinyflows;use env_guard::EnvVarGuard;@@ -42,8 +42,14 @@ async fn published_module_prompts_render_through_the_normal_host_path() {.await.unwrap_or_else(|error| panic!("rendering {agent_id} prompt: {error:#}"));let lower = prompt.text.to_lowercase();- assert!(prompt.text.contains(required), "{agent_id} prompt missing {required}");- assert!(lower.contains(invariant), "{agent_id} prompt missing {invariant}");+ assert!(+ prompt.text.contains(required),+ "{agent_id} prompt missing {required}"+ );+ assert!(+ lower.contains(invariant),+ "{agent_id} prompt missing {invariant}"+ );assert!(prompt.text.contains("## Workspace"));}}