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
test(flows): pass ambient dispatch context to gate helpers
Steven Enamakele3e354c25662
diff --git a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rsindex 1b5faf15bd..e8300d0348 100644--- a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs+++ b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs@@ -17,7 +17,7 @@ async fn agent_ref_plain_node_without_ref_is_accepted() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = validate_agent_refs(&config, &g).await;+ let errors = validate_agent_refs(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;assert!(errors.is_empty(), "{errors:?}");}@@ -35,7 +35,7 @@ async fn agent_ref_blank_string_is_treated_as_absent() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = validate_agent_refs(&config, &g).await;+ let errors = validate_agent_refs(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;assert!(errors.is_empty(), "{errors:?}");}@@ -61,7 +61,7 @@ async fn agent_ref_resolving_to_a_harness_definition_is_accepted() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = validate_agent_refs(&config, &g).await;+ let errors = validate_agent_refs(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;assert!(errors.is_empty(),"a real harness agent_ref must never be rejected: {errors:?}"@@ -86,7 +86,7 @@ async fn agent_ref_unknown_is_rejected() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = validate_agent_refs(&config, &g).await;+ let errors = validate_agent_refs(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;assert!(!errors.is_empty(), "an unknown agent_ref must be rejected");assert!(errors.iter().any(|e| e.contains("no_such_agent_xyz")),@@ -207,6 +207,7 @@ async fn proposal_includes_inference_status_for_agent_graph() {}));let payload = build_builder_proposal(+ &crate::core::runtime::DispatchCtx::ambient(),&config,"propose_workflow","agent-flow",@@ -244,6 +245,7 @@ async fn proposal_omits_inference_status_for_tool_call_only_graph() {}));let payload = build_builder_proposal(+ &crate::core::runtime::DispatchCtx::ambient(),&config,"propose_workflow","tool-flow",diff --git a/crates/openhuman-core/src/flows/ops_inference_gate_tests.rs b/crates/openhuman-core/src/flows/ops_inference_gate_tests.rsindex f4ce23538b..5e5eecc3d8 100644--- a/crates/openhuman-core/src/flows/ops_inference_gate_tests.rs+++ b/crates/openhuman-core/src/flows/ops_inference_gate_tests.rs@@ -46,7 +46,7 @@ async fn run_builder_gates_does_not_reject_when_signed_out() {],"edges": [ { "from_node": "t", "to_node": "a" } ]}));- let errors = run_builder_gates(&config, &g).await;+ let errors = run_builder_gates(&crate::core::runtime::DispatchCtx::ambient(), &config, &g).await;assert!(errors.is_empty(),"authoring must not be blocked by a signed-out session: {errors:?}"@@ -74,6 +74,7 @@ async fn proposal_surfaces_signed_out_inference_status() {}));let payload = build_builder_proposal(+ &crate::core::runtime::DispatchCtx::ambient(),&config,"propose_workflow","agent-flow",diff --git a/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs b/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rsindex ed1e888790..1450eaf3ce 100644--- a/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs+++ b/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs@@ -334,19 +334,19 @@ async fn flows_update_does_not_force_require_approval_on_readonly_graph() {async fn strict_gate_passes_a_valid_graph_and_rejects_a_structurally_invalid_one() {let config = Config::default();// A trigger-only graph is structurally valid and has no outbound gates.- assert!(strict_gate(&config, &trigger_only_graph()).await.is_ok());+ assert!(strict_gate(&crate::core::runtime::DispatchCtx::ambient(), &config, &trigger_only_graph()).await.is_ok());// No trigger → structural failure surfaced by strict mode.let bad = json!({"nodes": [ { "id": "a", "kind": "output_parser", "name": "A" } ],"edges": []});- let err = strict_gate(&config, &bad).await.unwrap_err();+ let err = strict_gate(&crate::core::runtime::DispatchCtx::ambient(), &config, &bad).await.unwrap_err();assert!(err.contains("structurally invalid"), "{err}");assert!(err.contains("trigger"), "{err}");// A structurally valid graph must still pass the shared engine gate.- let err = strict_gate(&config, &nested_conditional_fan_in_graph())+ let err = strict_gate(&crate::core::runtime::DispatchCtx::ambient(), &config, &nested_conditional_fan_in_graph()).await.unwrap_err();assert!(err.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN), "{err}");@@ -365,7 +365,7 @@ async fn strict_gate_rejects_an_incompatible_saved_child_reference() {).unwrap();- let error = strict_gate(&config, &referenced_child_graph(&child.id))+ let error = strict_gate(&crate::core::runtime::DispatchCtx::ambient(), &config, &referenced_child_graph(&child.id)).await.expect_err("strict authoring must reject an incompatible saved child");assert!(@@ -391,6 +391,7 @@ async fn builder_proposal_rejects_an_incompatible_saved_child_reference() {let parent = structurally_valid_graph(referenced_child_graph(&child.id));let error = build_builder_proposal(+ &crate::core::runtime::DispatchCtx::ambient(),&config,"propose_workflow","parent",