Skip to content

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

test(flows): add test for tool node without id

Steven Enamakel5965bf8f76a5
diff --git a/crates/openhuman-core/src/flows/authoring_host_tests.rs b/crates/openhuman-core/src/flows/authoring_host_tests.rs
index 5a58e9e502..4dfbead21b 100644
--- a/crates/openhuman-core/src/flows/authoring_host_tests.rs
+++ b/crates/openhuman-core/src/flows/authoring_host_tests.rs
@@ -26,6 +26,51 @@ fn nested_conditional_fan_in() -> Value {
})
}
+#[tokio::test]
+async fn check_gate_rejects_a_tool_node_without_its_id() {
+ let tmp = tempfile::tempdir().expect("temporary workspace");
+ let mut config = Config::default();
+ config.workspace_dir = tmp.path().join("workspace");
+ config.action_dir = config.workspace_dir.clone();
+ config.config_path = tmp.path().join("config.toml");
+ std::fs::create_dir_all(&config.workspace_dir).unwrap();
+
+ let _registration = register(
+ Arc::new(config.clone()),
+ crate::core::runtime::DispatchCtx::ambient(),
+ )
+ .await
+ .unwrap();
+ let proxy = crate::modules::tinyflows::authoring_proxy(&config)
+ .await
+ .unwrap();
+
+ let result = proxy
+ .call::<Vec<String>>(
+ tinyflows_bus::host::CHECK_GATE,
+ (
+ tinyflows_bus::host::TOOL_POLICY,
+ json!({
+ "nodes": [{
+ "kind": "tool_call",
+ "name": "Upload",
+ "config": {
+ "slug": "oh:storage_upload_file",
+ "args": {"path": "/tmp/report.html"}
+ }
+ }],
+ "edges": []
+ }),
+ ),
+ )
+ .await;
+
+ assert!(
+ result.is_err(),
+ "a node without an id is malformed: {result:?}"
+ );
+}
+
#[tokio::test]
async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {
use crate::core::runtime::{ContextOverlay, CoreContext, DispatchCtx, DomainSet};