Skip to content

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

style: apply rustfmt formatting across flows module

Steven Enamakele839f3ecb17e
diff --git a/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs b/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs
index e5512bc902..df1f3e59c1 100644
--- a/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs
@@ -16,7 +16,8 @@ async fn cancel_flow_run_cancels_when_flow_id_matches_the_owner() {
.await
.unwrap()
.value;
- let run = ops::flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = ops::flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&flow.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
index 3d22800ece..25049f7cf2 100644
--- a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
@@ -528,7 +528,8 @@ async fn cancel_flow_run_refuses_a_run_the_caller_does_not_own() {
.unwrap()
.value;
- let run = ops::flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = ops::flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&owner_flow.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/bus/trigger.rs b/crates/openhuman-core/src/flows/bus/trigger.rs
index 0f03a9ea29..d7339d1ffd 100644
--- a/crates/openhuman-core/src/flows/bus/trigger.rs
+++ b/crates/openhuman-core/src/flows/bus/trigger.rs
@@ -112,10 +112,7 @@ impl FlowTriggerSubscriber {
}
/// The configuration to handle an event under (`super::owner::config_for_scope`).
- pub(super) fn config_for_scope(
- &self,
- ctx: &crate::core::runtime::DispatchCtx,
- ) -> Arc<Config> {
+ pub(super) fn config_for_scope(&self, ctx: &crate::core::runtime::DispatchCtx) -> Arc<Config> {
super::owner::config_for_scope(ctx, &self.config)
}
diff --git a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
index c60fe9e70b..1b5faf15bd 100644
--- a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
@@ -300,7 +300,8 @@ async fn flows_run_fails_cleanly_without_invoking_engine_when_inference_not_read
.await
.expect("creating (authoring) an agent-node flow must succeed even when signed out");
- let err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs b/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
index faec523f17..f96988e39a 100644
--- a/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
@@ -13,7 +13,8 @@ async fn flows_run_detached_returns_running_run_id_and_inserts_row() {
)
.unwrap();
- let outcome = flows_run_detached(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run_detached(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&flow.id,
json!({}),
@@ -55,7 +56,8 @@ async fn flows_run_detached_registers_the_run_before_returning_its_id() {
)
.unwrap();
- let outcome = flows_run_detached(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run_detached(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&flow.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
index 91fedae5b4..7d50ecd2c0 100644
--- a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
@@ -76,7 +76,8 @@ async fn flows_run_rejects_legacy_nested_conditional_fan_in_before_execution() {
let graph = structurally_valid_graph(nested_conditional_fan_in_graph());
let flow = store::create_flow(&config, "legacy".to_string(), graph, false, true).unwrap();
- let err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&flow.id,
json!({ "outer": true, "inner": true }),
@@ -116,7 +117,8 @@ async fn flows_run_rejects_an_incompatible_saved_child_before_execution() {
)
.unwrap();
- let error = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let error = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&parent.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs b/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs
index be90b3726d..1366647153 100644
--- a/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs
@@ -11,7 +11,8 @@ async fn flows_resume_succeeds_when_the_graph_is_unchanged() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -30,9 +31,16 @@ async fn flows_resume_succeeds_when_the_graph_is_unchanged() {
"a freshly parked run must pin the graph it parked against"
);
- let resumed = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![])
- .await
- .expect("resume must succeed when the pinned graph still matches the current one");
+ let resumed = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await
+ .expect("resume must succeed when the pinned graph still matches the current one");
assert_eq!(resumed.value["pending_approvals"], json!([]));
assert!(
!resumed.value["output"]["nodes"]["downstream"]["items"].is_null(),
@@ -61,7 +69,8 @@ async fn flows_resume_allows_a_legacy_row_with_null_graph_hash() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -112,9 +121,16 @@ async fn flows_resume_allows_a_legacy_row_with_null_graph_hash() {
)
.unwrap();
- let resumed = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![])
- .await
- .expect("a legacy row with no graph_hash must still resume (unknown treated as allow)");
+ let resumed = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await
+ .expect("a legacy row with no graph_hash must still resume (unknown treated as allow)");
assert_eq!(resumed.value["pending_approvals"], json!([]));
}
@@ -155,7 +171,8 @@ async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {
let created = flows_create(&config, "gated".to_string(), approval_gated_graph(), false)
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -206,9 +223,16 @@ async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {
)
.unwrap();
- let error = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![])
- .await
- .expect_err("an incompatible checkpoint cannot be resumed safely");
+ let error = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await
+ .expect_err("an incompatible checkpoint cannot be resumed safely");
assert!(
error.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN),
"{error}"
@@ -235,7 +259,8 @@ async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failed
let created = flows_create(&config, "gated".to_string(), approval_gated_graph(), false)
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -285,9 +310,16 @@ async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failed
)
.unwrap();
- let error = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![])
- .await
- .expect_err("an incompatible saved child cannot be resumed safely");
+ let error = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await
+ .expect_err("an incompatible saved child cannot be resumed safely");
assert!(
error.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN),
"{error}"
@@ -309,9 +341,16 @@ async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failed
async fn flows_resume_missing_flow_errors() {
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, "missing", "thread-1", vec![], vec![])
- .await
- .expect_err("must error");
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ "missing",
+ "thread-1",
+ vec![],
+ vec![],
+ )
+ .await
+ .expect_err("must error");
assert!(err.contains("not found"));
}
@@ -334,7 +373,8 @@ async fn flows_resume_with_empty_approvals_is_rejected_and_does_not_complete_the
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -345,9 +385,16 @@ async fn flows_resume_with_empty_approvals_is_rejected_and_does_not_complete_the
.unwrap();
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, vec![], vec![])
- .await
- .expect_err("an empty approvals list must not silently approve the pending gate");
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ vec![],
+ vec![],
+ )
+ .await
+ .expect_err("an empty approvals list must not silently approve the pending gate");
assert!(
err.contains("no pending approval matches"),
"expected a clear approval-mismatch error, got: {err}"
@@ -374,7 +421,8 @@ async fn flows_resume_with_mismatched_approvals_is_rejected() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -386,7 +434,8 @@ async fn flows_resume_with_mismatched_approvals_is_rejected() {
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
// Names a node id that is not actually pending for this run.
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -406,7 +455,8 @@ async fn flows_resume_with_the_correct_gate_completes_and_runs_downstream() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -417,7 +467,8 @@ async fn flows_resume_with_the_correct_gate_completes_and_runs_downstream() {
.unwrap();
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
- let resumed = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let resumed = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -449,7 +500,8 @@ async fn flows_resume_denying_a_gate_routes_to_its_error_port() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -461,7 +513,8 @@ async fn flows_resume_denying_a_gate_routes_to_its_error_port() {
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
// Deny the gate: no approvals, `gate` in rejections.
- let resumed = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let resumed = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -500,7 +553,8 @@ async fn flows_resume_denying_a_gate_with_no_error_port_fails_the_run() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -511,7 +565,8 @@ async fn flows_resume_denying_a_gate_with_no_error_port_fails_the_run() {
.unwrap();
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -539,7 +594,8 @@ async fn flows_resume_rejects_a_gate_named_in_both_approvals_and_rejections() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -550,7 +606,8 @@ async fn flows_resume_rejects_a_gate_named_in_both_approvals_and_rejections() {
.unwrap();
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -576,7 +633,8 @@ async fn flows_resume_of_a_non_paused_run_errors_clearly() {
// This run completes outright (no approval gate) — its recorded status
// is "completed", not "pending_approval".
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -587,9 +645,16 @@ async fn flows_resume_of_a_non_paused_run_errors_clearly() {
.unwrap();
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, vec![], vec![])
- .await
- .expect_err("resuming an already-completed run must be a clear error, not a silent no-op");
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ vec![],
+ vec![],
+ )
+ .await
+ .expect_err("resuming an already-completed run must be a clear error, not a silent no-op");
assert!(
err.contains("not pending approval") || err.contains("no paused run"),
"expected a clear non-paused-run error, got: {err}"
diff --git a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs
index 7435e0f0c6..3f4fca0a2f 100644
--- a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs
@@ -110,7 +110,8 @@ async fn flows_run_completes_trigger_only_graph() {
.await
.unwrap();
- let outcome = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "hello": "world" }),
@@ -146,7 +147,8 @@ async fn flows_run_on_trigger_only_graph_surfaces_no_actionable_nodes_note() {
.await
.unwrap();
- let outcome = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -199,7 +201,8 @@ async fn flows_run_on_graph_with_actionable_nodes_has_no_empty_flow_note() {
.await
.unwrap();
- let outcome = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -243,7 +246,8 @@ async fn flows_run_on_graph_with_disconnected_component_still_surfaces_empty_flo
.await
.unwrap();
- let outcome = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -284,7 +288,8 @@ async fn flows_run_reports_pending_approval_and_blocks_downstream() {
.await
.unwrap();
- let outcome = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let outcome = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -317,7 +322,8 @@ async fn flows_get_missing_flow_errors() {
async fn flows_run_missing_flow_errors() {
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);
- let err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
"missing",
json!({}),
@@ -343,7 +349,8 @@ async fn flows_run_threads_declared_inputs_into_the_run() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -389,7 +396,8 @@ async fn flows_run_detached_threads_and_validates_declared_inputs_too() {
.await
.unwrap();
- let err = flows_run_detached(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_run_detached(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -400,7 +408,8 @@ async fn flows_run_detached_threads_and_validates_declared_inputs_too() {
.expect_err("a missing required input must be refused before a run id is handed out");
assert!(err.contains("repo"), "got: {err}");
- let started = flows_run_detached(&crate::core::runtime::DispatchCtx::ambient(),
+ let started = flows_run_detached(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -428,7 +437,8 @@ async fn flows_run_rejects_a_missing_required_input_without_creating_a_run_row()
.await
.unwrap();
- let err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -471,7 +481,8 @@ async fn flows_run_rejects_a_wrongly_typed_or_undeclared_input() {
.await
.unwrap();
- let type_err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let type_err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -482,7 +493,8 @@ async fn flows_run_rejects_a_wrongly_typed_or_undeclared_input() {
.expect_err("a string for a number input must be rejected");
assert!(type_err.contains("depth"), "got: {type_err}");
- let unknown_err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let unknown_err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -514,7 +526,8 @@ async fn flows_run_leaves_a_flow_declaring_no_inputs_unchanged() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "hi": 1 }),
@@ -550,7 +563,8 @@ async fn flows_run_records_failed_status_when_a_node_errors() {
.await
.unwrap();
- let err = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -599,7 +613,8 @@ async fn flows_run_populates_error_when_a_continue_policy_node_errors() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/ops_run_rows_and_notifications_tests.rs b/crates/openhuman-core/src/flows/ops_run_rows_and_notifications_tests.rs
index 7b9f313a9c..db1bb89580 100644
--- a/crates/openhuman-core/src/flows/ops_run_rows_and_notifications_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_run_rows_and_notifications_tests.rs
@@ -8,7 +8,8 @@ async fn flows_resume_with_no_recorded_run_for_thread_id_errors_clearly() {
.await
.unwrap();
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
"thread-that-was-never-started",
@@ -30,7 +31,8 @@ async fn flows_run_persists_a_flow_run_row_queryable_via_list_and_get() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "hello": "world" }),
@@ -70,7 +72,8 @@ async fn flows_list_all_runs_aggregates_across_flows_newest_first() {
.unwrap();
// Run alpha first, then beta — beta's run is the newest.
- flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&a.value.id,
json!({}),
@@ -79,7 +82,8 @@ async fn flows_list_all_runs_aggregates_across_flows_newest_first() {
)
.await
.unwrap();
- let beta_run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let beta_run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&b.value.id,
json!({}),
@@ -128,7 +132,8 @@ async fn flows_run_emits_pending_approval_notification() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -187,7 +192,8 @@ async fn flows_run_does_not_notify_when_run_completes_without_pending_approvals(
.unwrap();
let created_id = created.value.id.clone();
- flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -269,7 +275,8 @@ async fn flows_run_publishes_flow_run_started_with_flow_and_run_id() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -362,7 +369,8 @@ async fn flows_run_finished_event_skips_pending_approval_and_fires_once_on_resum
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -387,9 +395,16 @@ async fn flows_run_finished_event_skips_pending_approval_and_fires_once_on_resum
);
}
- let resumed = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![])
- .await
- .unwrap();
+ let resumed = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await
+ .unwrap();
assert_eq!(resumed.value["pending_approvals"], json!([]));
// The bus is process-global and shared with concurrently-running tests,
@@ -505,7 +520,8 @@ async fn flows_run_persists_live_steps_with_status_and_timing() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -559,7 +575,8 @@ async fn flows_cancel_run_cancels_a_parked_pending_approval_run() {
// Run pauses at the gate → a durable `pending_approval` row with no live
// task (the run future already returned): the not-in-flight cancel path.
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -596,7 +613,8 @@ async fn flows_cancel_run_cancels_a_parked_pending_approval_run() {
assert_eq!(reloaded.value.last_status.as_deref(), Some("cancelled"));
// A cancelled run can no longer be resumed — the status guard rejects it.
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -616,7 +634,8 @@ async fn flows_cancel_run_of_an_already_completed_run_errors() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
diff --git a/crates/openhuman-core/src/flows/ops_triggers_and_resume_tests.rs b/crates/openhuman-core/src/flows/ops_triggers_and_resume_tests.rs
index 045483eea6..20d1671379 100644
--- a/crates/openhuman-core/src/flows/ops_triggers_and_resume_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_triggers_and_resume_tests.rs
@@ -415,7 +415,8 @@ async fn flows_resume_continues_a_paused_run_to_completion() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -429,9 +430,16 @@ async fn flows_resume_continues_a_paused_run_to_completion() {
serde_json::from_value(run.value["pending_approvals"].clone()).unwrap();
assert_eq!(pending, vec!["gate".to_string()]);
- let resumed = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![])
- .await
- .unwrap();
+ let resumed = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await
+ .unwrap();
assert_eq!(resumed.value["pending_approvals"], json!([]));
assert!(
!resumed.value["output"]["nodes"]["downstream"]["items"].is_null(),
@@ -472,7 +480,8 @@ async fn flows_resume_refuses_when_the_graph_changed_after_park() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({ "x": 1 }),
@@ -511,7 +520,8 @@ async fn flows_resume_refuses_when_the_graph_changed_after_park() {
)
.unwrap();
- let error = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let error = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&thread_id,
@@ -545,7 +555,15 @@ async fn flows_resume_refuses_when_the_graph_changed_after_park() {
// A second resume attempt must not succeed either — the checkpoint was
// dropped, and the row is now terminal, not `pending_approval`.
- let second = flows_resume(&crate::core::runtime::DispatchCtx::ambient(), &config, &created.value.id, &thread_id, pending, vec![]).await;
+ let second = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &created.value.id,
+ &thread_id,
+ pending,
+ vec![],
+ )
+ .await;
assert!(
second.is_err(),
"a settled/refused run must not be resumable again"
diff --git a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
index b84c38f4aa..d227305f57 100644
--- a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
@@ -13,7 +13,8 @@ async fn flows_cancel_run_of_a_completed_with_warnings_run_errors() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -54,7 +55,8 @@ async fn flows_cancel_run_of_an_interrupted_run_errors() {
.await
.unwrap();
- let run = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let run = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -129,7 +131,8 @@ async fn parked_run_ttl_sweep_expires_stale_runs_but_spares_fresh_ones() {
.unwrap();
// A genuinely fresh parked run (just paused now) must survive the sweep.
- let fresh = flows_run(&crate::core::runtime::DispatchCtx::ambient(),
+ let fresh = flows_run(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
json!({}),
@@ -157,7 +160,8 @@ async fn parked_run_ttl_sweep_expires_stale_runs_but_spares_fresh_ones() {
);
// The swept run is no longer resumable.
- let err = flows_resume(&crate::core::runtime::DispatchCtx::ambient(),
+ let err = flows_resume(
+ &crate::core::runtime::DispatchCtx::ambient(),
&config,
&created.value.id,
&stale_id,
diff --git a/crates/openhuman-core/src/flows/schemas_handlers.rs b/crates/openhuman-core/src/flows/schemas_handlers.rs
index 15ac092649..378ab2e687 100644
--- a/crates/openhuman-core/src/flows/schemas_handlers.rs
+++ b/crates/openhuman-core/src/flows/schemas_handlers.rs
@@ -222,7 +222,15 @@ fn handle_resume(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFutu
.map_err(|e| format!("invalid 'rejections': {e}"))?
.unwrap_or_default();
to_json(
- ops::flows_resume(&ctx, &config, id.trim(), thread_id.trim(), approvals, rejections).await?,
+ ops::flows_resume(
+ &ctx,
+ &config,
+ id.trim(),
+ thread_id.trim(),
+ approvals,
+ rejections,
+ )
+ .await?,
)
})
}
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
index 327725609c..49f08ec982 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
@@ -268,7 +268,7 @@ impl AgentRunner for OpenHumanAgentRunner {
entry_model.as_deref(),
None,
)
- .await
+ .await
}
AgentRoute::RegistryFallback => {
tracing::info!(
@@ -387,11 +387,9 @@ impl OpenHumanAgentRunner {
let built = match &host {
Some(host) => host.session_host(effective.as_ref(), None),
- None => OpenHumanSessionHost::from_config_for_agent(
- dispatch,
- effective.as_ref(),
- agent_ref,
- ),
+ None => {
+ OpenHumanSessionHost::from_config_for_agent(dispatch, effective.as_ref(), agent_ref)
+ }
};
let mut agent = built.map_err(|e| {
EngineError::Capability(format!(
@@ -528,18 +526,15 @@ impl OpenHumanAgentRunner {
conn: Option<&str>,
) -> Result<Value> {
// Resolve + validate the requested agent kind against the registry.
- let entry = crate::agent::registry::get_agent(
- dispatch,
- agent_ref,
- )
- .await
- .map_err(EngineError::Capability)?
- .ok_or_else(|| {
- EngineError::Capability(format!(
+ let entry = crate::agent::registry::get_agent(dispatch, agent_ref)
+ .await
+ .map_err(EngineError::Capability)?
+ .ok_or_else(|| {
+ EngineError::Capability(format!(
"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!(
"agent node: agent_ref '{agent_ref}' is disabled"