Skip to content

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

test(tinyflows): add coverage for tier gating and timeouts

Steven Enamakel0e04519eb719
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
index 1bd0e527ee..678b46f156 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
@@ -76,6 +76,7 @@ async fn http_adapter_blocks_under_readonly_tier() {
security: Arc::new(policy(AutonomyLevel::ReadOnly)),
http_config: HttpRequestConfig::default(),
http_creds: Arc::new(creds),
+ approval: Default::default(),
};
let request = json!({ "method": "GET", "url": "https://example.com" });
@@ -106,6 +107,7 @@ async fn composio_tool_call_blocks_under_readonly_tier() {
let tools = OpenHumanTools {
config: Arc::new(Config::default()),
security: Arc::new(policy(AutonomyLevel::ReadOnly)),
+ approval: Default::default(),
};
let err = tools
@@ -151,6 +153,7 @@ async fn composio_read_action_allowed_under_readonly_tier() {
let tools = OpenHumanTools {
config: Arc::new(Config::default()),
security: Arc::new(policy(AutonomyLevel::ReadOnly)),
+ approval: Default::default(),
};
let err = tools
.invoke("TWITTER_RECENT_SEARCH", json!({}), None)
@@ -187,6 +190,7 @@ async fn composio_read_action_does_not_prompt_under_supervised_tier() {
let tools = OpenHumanTools {
config: Arc::new(Config::default()),
security: Arc::new(policy(AutonomyLevel::Supervised)),
+ approval: Default::default(),
};
let err = tools
.invoke("TWITTER_RECENT_SEARCH", json!({}), None)
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
index 9875bc76f9..7c7442f071 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
@@ -31,6 +31,7 @@ fn adapter(autonomy: AutonomyLevel) -> (TempDir, OpenHumanMemory) {
OpenHumanMemory {
config,
security: security(autonomy),
+ approval: Default::default(),
},
)
}
diff --git a/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs b/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs
index a49ef3eeb3..e18d24992f 100644
--- a/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs
@@ -109,7 +109,11 @@ async fn code_adapter_javascript_runs_when_isolated_and_refuses_when_isolation_i
&config.workspace_dir,
&config.action_dir,
));
- let runner = OpenHumanCode { config, security };
+ let runner = OpenHumanCode {
+ config,
+ security,
+ approval: Default::default(),
+ };
let input = json!([{ "json": { "n": 7 } }]);
match runner
diff --git a/crates/openhuman-core/src/flows/tinyflows/tinyflows_tests.rs b/crates/openhuman-core/src/flows/tinyflows/tinyflows_tests.rs
index a3ba70f4ba..66dabfdfef 100644
--- a/crates/openhuman-core/src/flows/tinyflows/tinyflows_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/tinyflows_tests.rs
@@ -87,6 +87,7 @@ fn http_adapter(allowed_domains: Vec<String>) -> OpenHumanHttp {
http_creds: Arc::new(
crate::security::credentials::HttpCredentialsStore::from_config(&config),
),
+ approval: Default::default(),
}
}
@@ -104,7 +105,11 @@ fn tools_adapter(config: Arc<Config>) -> OpenHumanTools {
&config.workspace_dir,
&config.action_dir,
));
- OpenHumanTools { config, security }
+ OpenHumanTools {
+ config,
+ security,
+ approval: Default::default(),
+ }
}
/// Minimal seeded [`ToolContract`](super::caps::ToolContract) for the tests