Skip to content

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

test(tinyflows): cover copilot tool catalog and disabled component

Steven Enamakelf2960a950df9
diff --git a/crates/openhuman-core/src/modules/tinyflows_tests.rs b/crates/openhuman-core/src/modules/tinyflows_tests.rs
index 15cb3ba63b..c32bbce105 100644
--- a/crates/openhuman-core/src/modules/tinyflows_tests.rs
+++ b/crates/openhuman-core/src/modules/tinyflows_tests.rs
@@ -26,6 +26,8 @@ async fn a_switched_off_component_never_loads_the_module() {
assert!(error.starts_with("COMPONENT_DISABLED:tinyflows"), "{error}");
let error = run_proxy(&config).await.unwrap_err();
assert!(error.starts_with("COMPONENT_DISABLED:tinyflows"), "{error}");
+ let error = copilot_proxy(&config).await.unwrap_err();
+ assert!(error.starts_with("COMPONENT_DISABLED:tinyflows"), "{error}");
}
#[tokio::test]
@@ -41,3 +43,47 @@ async fn the_schedule_object_answers_on_the_contracts_names() {
.unwrap();
assert_eq!(millis, 30 * 60 * 1000);
}
+
+#[tokio::test]
+async fn the_copilot_object_answers_tool_catalog_over_its_bus_contract() {
+ let config = Config::default();
+ let proxy = copilot_proxy(&config)
+ .await
+ .expect("module copilot interface attaches");
+ let tools: Vec<tinyflows_bus::copilot::ToolDescriptor> = proxy
+ .call(
+ "ToolCatalog",
+ (tinyflows_bus::copilot::ToolCatalogRequest::default(),),
+ )
+ .await
+ .expect("copilot catalogue call succeeds");
+ let names: Vec<_> = tools.iter().map(|tool| tool.name.as_str()).collect();
+ assert_eq!(
+ names,
+ [
+ "propose_workflow",
+ "revise_workflow",
+ "edit_workflow",
+ "validate_workflow",
+ "get_flow_history",
+ "list_flow_runs",
+ "resume_flow_run",
+ "cancel_flow_run",
+ "create_workflow",
+ "duplicate_flow",
+ "list_flows",
+ "get_flow",
+ "get_flow_run",
+ "list_agent_definitions",
+ "list_node_kinds",
+ "get_node_kind_contract",
+ "dry_run_workflow",
+ "run_flow",
+ "save_workflow",
+ "suggest_workflows",
+ ]
+ );
+ let run_flow = tools.iter().find(|tool| tool.name == "run_flow").unwrap();
+ assert_eq!(run_flow.permission, "Write");
+ assert!(run_flow.external_effect);
+}