Skip to content

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

refactor(flows): route binding validation through tinyflows gates

Steven Enamakel32f16083b9c2
diff --git a/crates/openhuman-core/src/flows/builder_tools/persistence.rs b/crates/openhuman-core/src/flows/builder_tools/persistence.rs
index fc633195cf..6179416f25 100644
--- a/crates/openhuman-core/src/flows/builder_tools/persistence.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/persistence.rs
@@ -356,7 +356,7 @@ impl Tool for SaveWorkflowTool {
// inside `ops::flows_update`, which the UI/RPC also call for a
// human's own edits and which must stay permissive) — so an agent
// can never persist a graph with an unresolvable `tool_call` binding
- // either. See `ops::validate_binding_resolvability`.
+ // either. See `tinyflows::gates::failures`.
let graph = match validate_and_migrate_graph(graph_json.clone()) {
Ok(graph) => graph,
Err(e) => {
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.rs
index 9507627a2f..23a95660fa 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
@@ -244,6 +244,16 @@ fn connection_refs_fail_open_on_unavailable_connections_but_keep_mismatch() {
assert!(errors[0].contains("tiktok"), "{}", errors[0]);
}
+/// The mock-run argument preflight as `run_builder_gates` invokes it: the
+/// analysis is `tinyflows::preflight`'s, this pins the host's native slug prefix.
+async fn validate_required_arg_resolvability(graph: &WorkflowGraph) -> Vec<String> {
+ tinyflows::preflight::unresolvable_tool_args(
+ graph,
+ &[crate::flows::tinyflows::caps::NATIVE_TOOL_PREFIX],
+ )
+ .await
+}
+
// ── validate_required_arg_resolvability (issue B18) ─────────────────────────
//
// `validate_tool_contracts`'s `missing_required_args` only proves an arg is
@@ -347,7 +357,7 @@ async fn mock_opaque_tool_call_upstream_ref_matches_native_and_composio_upstream
],
"edges": []
}));
- let up = |expr: &str| mock_opaque_tool_call_upstream_ref(expr, &g, "sink").map(str::to_string);
+ let up = |expr: &str| tinyflows::preflight::mock_opaque_tool_call_upstream_ref(expr, &g, "sink").map(str::to_string);
assert_eq!(
up("=nodes.native_up.item.json.url").as_deref(),
Some("native_up")
diff --git a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
index 66f810614f..fcca7c3cc1 100644
--- a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
@@ -98,7 +98,7 @@ fn agent_prompt_binding_unaffected() {
],
"edges": [ { "from_node": "t", "to_node": "summarize" } ]
}));
- assert!(validate_binding_resolvability(&g).is_empty());
+ assert!(tinyflows::gates::failures(&g).is_empty());
}
/// Regression for issue #4593 (widened for #4881's `resume_flow_run`/