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
style: format upstream Rust changes
Steven Enamakele1e754fd5f3d
diff --git a/crates/openhuman-core/src/core/runtime/builder.rs b/crates/openhuman-core/src/core/runtime/builder.rsindex b58ef9a5bc..d674e1718c 100644--- a/crates/openhuman-core/src/core/runtime/builder.rs+++ b/crates/openhuman-core/src/core/runtime/builder.rs@@ -492,7 +492,11 @@ impl CoreRuntime {/// to stop either: the user runs Ollama / LM Studio / MLX themselves and/// OpenHuman never spawns it.pub async fn exit_cleanup(&self) {- if let Err(error) = crate::integrations::composio::trigger_history::close_global(&crate::core::runtime::DispatchCtx::new(Arc::clone(&self.ctx))).await {+ if let Err(error) = crate::integrations::composio::trigger_history::close_global(+ &crate::core::runtime::DispatchCtx::new(Arc::clone(&self.ctx)),+ )+ .await+ {log::warn!("[composio][history] archive shutdown failed: {error}");}log::debug!("[core] shutdown: exit cleanup done (no owned local runtime to stop)");diff --git a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rsindex f125ff5f89..040834f492 100644--- a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs+++ b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs@@ -173,7 +173,9 @@ async fn inference_gate_reports_signed_out_for_dynamic_agent_ref_only_graph() {..Default::default()};- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors =+ validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g)+ .await;assert!(!errors.is_empty(),"a signed-out session must still be reported even though the only agent node's \@@ -367,7 +369,9 @@ async fn local_agent_flow_is_ready_without_openhuman_session() {],"edges": [{ "from_node": "t", "to_node": "a" }]}));- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors =+ validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g)+ .await;assert!(errors.is_empty(),"local flow must not need a session: {errors:?}"@@ -400,7 +404,12 @@ async fn claude_agent_flow_readiness_does_not_require_an_openhuman_session() {let tmp = TempDir::new().unwrap();let mut config = test_config(&tmp);config.memory_provider = Some(provider.into());- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors = validate_inference_readiness(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &g,+ )+ .await;if provider == "openhuman" {assert!(errors.iter().any(|e| e.contains("signed out")),@@ -465,7 +474,12 @@ async fn harness_readiness_checks_session_for_execution_provider() {config.default_model = Some("hint:reasoning".into());config.reasoning_provider = Some(runtime.into());config.memory_provider = Some(summary.into());- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors = validate_inference_readiness(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &g,+ )+ .await;assert_eq!(errors.iter().any(|e| e.contains("signed out")),should_reject,diff --git a/crates/openhuman-core/src/flows/ops_connection_ref_gate_tests.rs b/crates/openhuman-core/src/flows/ops_connection_ref_gate_tests.rsindex 879c4ca7d9..ba7a8069fd 100644--- a/crates/openhuman-core/src/flows/ops_connection_ref_gate_tests.rs+++ b/crates/openhuman-core/src/flows/ops_connection_ref_gate_tests.rs@@ -46,7 +46,12 @@ async fn cached_probe_inference_readiness_caches_a_negative_result() {config.api_url = Some(format!("http://{addr}"));// First call: a real (mock) network round trip, definitively rejected.- let first = cached_probe_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), "summarization", &config).await;+ let first = cached_probe_inference_readiness(+ &crate::core::runtime::DispatchCtx::ambient(),+ "summarization",+ &config,+ )+ .await;let err = first.expect_err("a confirmed provider-not-configured 400 must reject");assert!(err.to_ascii_lowercase()@@ -61,7 +66,12 @@ async fn cached_probe_inference_readiness_caches_a_negative_result() {// Second call, same (role, config_path) key, well within the TTL: must be// served from cache — the mock server's hit count must NOT increase.- let second = cached_probe_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), "summarization", &config).await;+ let second = cached_probe_inference_readiness(+ &crate::core::runtime::DispatchCtx::ambient(),+ "summarization",+ &config,+ )+ .await;assert!(second.is_err(),"the cached negative result must still be an Err"diff --git a/crates/openhuman-core/src/flows/ops_inference_gate_tests.rs b/crates/openhuman-core/src/flows/ops_inference_gate_tests.rsindex bf24395840..62d4b3150d 100644--- a/crates/openhuman-core/src/flows/ops_inference_gate_tests.rs+++ b/crates/openhuman-core/src/flows/ops_inference_gate_tests.rs@@ -18,7 +18,9 @@ async fn inference_gate_skips_when_no_agent_nodes() {],"edges": [ { "from_node": "t", "to_node": "post" } ]}));- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors =+ validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g)+ .await;assert!(errors.is_empty(), "{errors:?}");}@@ -124,7 +126,9 @@ async fn inference_gate_passes_when_model_constructs() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors =+ validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g)+ .await;assert!(errors.is_empty(), "{errors:?}");}@@ -151,7 +155,9 @@ async fn inference_gate_surfaces_construction_error() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors =+ validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g)+ .await;assert!(!errors.is_empty(), "a construction failure must reject");assert!(errors.iter().any(|e| e.contains("Node 'a'")),@@ -251,7 +257,9 @@ async fn inference_gate_probes_every_distinct_agent_node_role() {]}));- let errors = validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;+ let errors =+ validate_inference_readiness(&crate::core::runtime::DispatchCtx::ambient(), &config, &g)+ .await;assert!(!errors.is_empty(),"both roles are broken, the gate must reject"diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs b/crates/openhuman-core/src/flows/tinyflows/caps/llm.rsindex b230a59e2c..58b5e453dd 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs@@ -102,8 +102,9 @@ impl LlmProvider for OpenHumanLlm {"[flows] llm.complete: dispatching agent-node completion");- let (chat_model, model) = create_chat_model_with_model_id_in(&self.ctx, role, &self.config, temperature)- .map_err(|e| EngineError::Capability(e.to_string()))?;+ let (chat_model, model) =+ create_chat_model_with_model_id_in(&self.ctx, role, &self.config, temperature)+ .map_err(|e| EngineError::Capability(e.to_string()))?;// `create_chat_provider` handed back the role's default model. If the node// pinned a raw/BYOK id, forward it verbatim instead (issue #4598).let model =diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rsindex 8f28fe330d..48d929a4ad 100644--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs@@ -134,7 +134,13 @@ async fn create_chat_model_uses_native_test_override() {])));let config = Config::default();- let model = create_chat_model_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.3).expect("create_chat_model must build");+ let model = create_chat_model_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.3,+ )+ .expect("create_chat_model must build");let response = model.invoke(&(), ModelRequest::new(vec![Message::user("hi there")])).await@@ -175,7 +181,13 @@ async fn one_shot_chat_models_preserve_factory_temperature_as_request_default()}));let config = Config::default();- let role_model = create_chat_model_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.3).expect("role model");+ let role_model = create_chat_model_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.3,+ )+ .expect("role model");role_model.invoke(&(), ModelRequest::new(vec![Message::user("default")])).await@@ -252,8 +264,13 @@ fn create_chat_model_routes_managed_backend_to_crate_native() {let _guard = crate::inference::inference_test_guard();// No test-provider override installed → the managed short-circuit engages.let config = Config::default();- let (model, _model_id) = create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.7)- .expect("managed create_chat_model must build");+ let (model, _model_id) = create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.7,+ )+ .expect("managed create_chat_model must build");assert_eq!(model.profile()@@ -268,8 +285,13 @@ fn create_chat_model_routes_local_runtime_to_crate_native() {let _guard = crate::inference::inference_test_guard();let mut config = Config::default();config.chat_provider = Some("ollama:qwen2.5".to_string());- let (model, model_id) = create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.7)- .expect("local create_chat_model must build");+ let (model, model_id) = create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.7,+ )+ .expect("local create_chat_model must build");assert_eq!(model_id, "qwen2.5");// Motion B (#4727): a local runtime now builds a crate-native `OpenAiModel`// (not a legacy model wrapper), so its profile carries the concrete@@ -325,8 +347,13 @@ fn create_chat_model_routes_plain_bearer_cloud_slug_to_crate_native() {let mut config = Config::default();config.cloud_providers.push(deepseek_entry("p_ds"));config.chat_provider = Some("deepseek:deepseek-reasoner".to_string());- let (model, model_id) = create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.7)- .expect("bearer cloud create_chat_model must build");+ let (model, model_id) = create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.7,+ )+ .expect("bearer cloud create_chat_model must build");assert_eq!(model_id, "deepseek-reasoner");let profile = model.profile()@@ -390,8 +417,13 @@ fn create_chat_model_routes_anthropic_auth_cloud_slug_to_crate_native() {.cloud_providers.push(anthropic_entry("p_anth", "anthropic"));config.chat_provider = Some("anthropic:claude-sonnet-4-6".to_string());- let (model, model_id) = create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.7)- .expect("anthropic cloud create_chat_model must build");+ let (model, model_id) = create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.7,+ )+ .expect("anthropic cloud create_chat_model must build");assert_eq!(model_id, "claude-sonnet-4-6");assert_eq!(model.profile().and_then(|p| p.provider.as_deref()),diff --git a/crates/openhuman-core/src/inference/provider/factory_egress_fallback_tests.rs b/crates/openhuman-core/src/inference/provider/factory_egress_fallback_tests.rsindex abf4101bb9..d9063862cf 100644--- a/crates/openhuman-core/src/inference/provider/factory_egress_fallback_tests.rs+++ b/crates/openhuman-core/src/inference/provider/factory_egress_fallback_tests.rs@@ -21,7 +21,12 @@ async fn create_chat_model_managed_emits_exactly_one_egress_realpath() {let marker = "egress-managed-realpath-marker-v1";let mut config = Config::default();config.default_model = Some(marker.to_string());- let _ = create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "scratch", &config, 0.7);+ let _ = create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "scratch",+ &config,+ 0.7,+ );// Bound the drain with a unique sentinel published AFTER our construction.let sentinel = "egress-managed-sentinel-end";@@ -72,7 +77,12 @@ async fn create_chat_model_local_runtime_does_not_emit_egress_realpath() {let local_marker = "egress-local-realpath-marker";let mut config = Config::default();config.chat_provider = Some(format!("ollama:{local_marker}"));- let _ = create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", &config, 0.7);+ let _ = create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &config,+ 0.7,+ );// Sentinel bounds the drain; if the local marker ever appears as an external// transfer before it, the local-suppression contract is broken.diff --git a/crates/openhuman-core/src/inference/provider/factory_tests.rs b/crates/openhuman-core/src/inference/provider/factory_tests.rsindex 263411b7b2..13b62a915c 100644--- a/crates/openhuman-core/src/inference/provider/factory_tests.rs+++ b/crates/openhuman-core/src/inference/provider/factory_tests.rs@@ -181,11 +181,11 @@ fn only_library_hosts_are_exempt_from_app_login() {#[path = "factory_crate_native_diagnostics_tests.rs"]mod crate_native_diagnostics_tests;-#[path = "factory_explicit_ctx_tests.rs"]-mod explicit_ctx_tests;#[path = "factory_crate_native_tests.rs"]mod crate_native_tests;#[path = "factory_egress_fallback_tests.rs"]mod egress_fallback_tests;+#[path = "factory_explicit_ctx_tests.rs"]+mod explicit_ctx_tests;#[path = "factory_route_resolution_tests.rs"]mod route_resolution_tests;diff --git a/crates/openhuman-core/src/web_chat/session_routing_tests.rs b/crates/openhuman-core/src/web_chat/session_routing_tests.rsindex 184d291be6..379fd13dcc 100644--- a/crates/openhuman-core/src/web_chat/session_routing_tests.rs+++ b/crates/openhuman-core/src/web_chat/session_routing_tests.rs@@ -230,12 +230,14 @@ fn selected_managed_route_constructs_with_the_picker_model() {let config = Config::default();let selection = "openrouter/author/picked-model:free";let effective = effective_session_config(&config, Some(selection), None);- let (_, resolved_model) = crate::inference::provider::factory::create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(),- "chat",- &effective,- effective.default_temperature,- )- .expect("managed picker selection should construct without network access");+ let (_, resolved_model) =+ crate::inference::provider::factory::create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ &effective,+ effective.default_temperature,+ )+ .expect("managed picker selection should construct without network access");assert_eq!(resolved_model, selection);}@@ -251,7 +253,8 @@ fn selected_ollama_route_constructs_the_selected_model_without_network() {let selection = format!("ollama:{model}");let effective = effective_session_config(&config, Some(&selection), None);let (_, resolved_model) =- crate::inference::provider::factory::create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(),+ crate::inference::provider::factory::create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),"chat",&effective,effective.default_temperature,@@ -399,8 +402,13 @@ fn assert_huggingface_model_builds(config: &Config, expected_model: &str) {// Wait out any test that has a mock chat model installed process-wide.let _serial = crate::inference::provider::factory::test_provider_override::exclusive();let (_, resolved_model) =- crate::inference::provider::factory::create_chat_model_with_model_id_in(&crate::core::runtime::DispatchCtx::ambient(), "chat", config, 0.0)- .expect("case-insensitive cloud selection should resolve through its configured slug");+ crate::inference::provider::factory::create_chat_model_with_model_id_in(+ &crate::core::runtime::DispatchCtx::ambient(),+ "chat",+ config,+ 0.0,+ )+ .expect("case-insensitive cloud selection should resolve through its configured slug");assert_eq!(resolved_model, expected_model);}