Skip to content

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

test(agent): cover flows feature gate for builtin registration

Steven Enamakel57f877995903
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
index 620605c050..005327d313 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
@@ -11,6 +11,18 @@ fn all_builtins_parse() {
assert_eq!(defs.len(), expected);
}
+#[test]
+fn flow_builtin_entries_follow_the_flows_feature_gate() {
+ let definitions = load_builtins().expect("built-in TOML must parse");
+ for id in ["workflow_builder", "flow_discovery"] {
+ assert_eq!(
+ definitions.iter().any(|definition| definition.id == id),
+ cfg!(feature = "flows"),
+ "builtin `{id}` registration must follow the `flows` feature"
+ );
+ }
+}
+
/// Pins the `presentation_agent` compile-time gate, both directions: it is
/// registered under the `documents` feature (its `generate_presentation`
/// deck tool lives there) and filtered out of the registry without it, so
diff --git a/crates/openhuman-core/src/mcp/server/resources_tests.rs b/crates/openhuman-core/src/mcp/server/resources_tests.rs
index 99a4950aea..74930e2bbc 100644
--- a/crates/openhuman-core/src/mcp/server/resources_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/resources_tests.rs
@@ -74,6 +74,16 @@ fn list_resources_includes_core_and_agent_uris() {
] {
assert!(uris.contains(&expected), "missing URI {expected}");
}
+ for flow_uri in [
+ "openhuman://prompts/agents/workflow_builder",
+ "openhuman://prompts/agents/flow_discovery",
+ ] {
+ assert_eq!(
+ uris.contains(&flow_uri),
+ cfg!(feature = "flows"),
+ "flow prompt resource feature gate mismatch for {flow_uri}"
+ );
+ }
}
#[test]
@@ -97,6 +107,7 @@ fn read_resource_returns_minus_32002_for_unknown_uri() {
#[tokio::test]
async fn read_resource_returns_content_for_each_subagent() {
use crate::agent::registry::agents::BUILTINS;
+ #[cfg(feature = "flows")]
let config = crate::config::Config::default();
for b in BUILTINS {
let uri = format!("openhuman://prompts/agents/{}", b.id);