Skip to content

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

chore: files changed crates/openhuman-core/src/tools/ops_tests.rs,crates/openhuman-core/src/tools/op

Steven Enamakel688cb051c55b
diff --git a/crates/openhuman-core/src/tools/ops_tests.rs b/crates/openhuman-core/src/tools/ops_tests.rs
index 99b0e4cbc1..070badc6c8 100644
--- a/crates/openhuman-core/src/tools/ops_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests.rs
@@ -8,9 +8,6 @@ use tempfile::TempDir;
use tinytools::ToolContent;
use tinytools::ToolResult;
-#[path = "../integrations/test_support.rs"]
-mod integration_test_support;
-
fn test_config(tmp: &TempDir) -> Config {
Config {
workspace_dir: tmp.path().join("workspace"),
diff --git a/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs b/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs
index 690a57f64c..3e7b1b6d99 100644
--- a/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_composio_registration_tests.rs
@@ -21,7 +21,6 @@ fn composio_tools_register_in_direct_mode_without_an_app_session() {
let mut cfg = test_config(&tmp);
cfg.composio.mode = crate::config::schema::COMPOSIO_MODE_DIRECT.into();
cfg.composio.api_key = Some("ck_direct_test".into());
- assert!(crate::integrations::build_client(&cfg).is_none());
let names = registry_names_for(&cfg, &tmp);
assert_contains_all(
@@ -41,7 +40,6 @@ fn composio_tools_register_in_direct_mode_without_an_app_session() {
fn composio_tools_stay_unregistered_in_backend_mode_without_an_app_session() {
let tmp = TempDir::new().unwrap();
let cfg = test_config(&tmp);
- assert!(crate::integrations::build_client(&cfg).is_none());
let names = registry_names_for(&cfg, &tmp);
assert!(
diff --git a/crates/openhuman-core/src/tools/ops_tests_default_registry_tests.rs b/crates/openhuman-core/src/tools/ops_tests_default_registry_tests.rs
index 6695e34b93..f54ff9ed6b 100644
--- a/crates/openhuman-core/src/tools/ops_tests_default_registry_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_default_registry_tests.rs
@@ -160,12 +160,11 @@ fn every_packed_tool_name_resolves_to_a_registered_tool() {
// Registered only once the user is signed in: `composio`'s tools come
// from `all_composio_agent_tools`, which returns an empty vec without
// a session (`integrations/composio/tools/registry.rs`), and
- // `storage` / `media` are built behind `integrations::build_client`,
- // which needs a session token (`file_storage/tools/registry.rs`,
- // `media/generation/tools.rs`). Runtime auth state no unit test can
- // satisfy, in any feature configuration. Every name in those three is
- // a real tool in the source it is built from, verified by hand at the
- // time each pack was added — that is the check this skip replaces.
+ // `storage` / `media` are built by a host's registered tool source
+ // (a hosted service the core does not ship), so a bare core has none
+ // of their tools. Every name in those three is a real tool in the
+ // source it is built from, verified by hand at the time each pack was
+ // added — that is the check this skip replaces.
if matches!(pack.id, "composio" | "storage" | "media") {
continue;
}
@@ -183,28 +182,11 @@ fn every_packed_tool_name_resolves_to_a_registered_tool() {
);
}
-// Compile-time `media` feature gate (#4804). The media-generation agent tools
-// (`media_generate_*`) are present only when the `media` feature is compiled
-// in AND an integration client is configured. The disabled build proves the
-// module + its single call site drop out entirely (leaf gate, no stub facade).
-#[cfg(feature = "media")]
+// Compile-time `media` feature gate (#4804). The `media_generate_*` agent tools
+// are built by a host's registered tool source, never by the core itself, so a
+// bare core registers none of them whether or not the `media` feature is on.
#[test]
-fn media_tools_registered_when_feature_on() {
- let tmp = TempDir::new().unwrap();
- let cfg = integration_test_config(&tmp, "http://127.0.0.1:1");
- store_test_session_token(&cfg);
- let tools = integration_tools_for_config(&tmp, &cfg);
- let names: Vec<&str> = tools.iter().map(|t| t.name()).collect();
- assert!(
- names.contains(&"media_generate_image"),
- "media tools must register with the `media` feature on + an integration \
- client; got: {names:?}"
- );
-}
-
-#[cfg(not(feature = "media"))]
-#[test]
-fn media_tools_absent_when_feature_off() {
+fn media_tools_come_only_from_a_registered_tool_source() {
let tmp = TempDir::new().unwrap();
let cfg = integration_test_config(&tmp, "http://127.0.0.1:1");
store_test_session_token(&cfg);
@@ -212,8 +194,7 @@ fn media_tools_absent_when_feature_off() {
let names: Vec<&str> = tools.iter().map(|t| t.name()).collect();
assert!(
!names.iter().any(|n| n.starts_with("media_")),
- "no `media_*` tools may be registered when the `media` feature is off; \
- got: {names:?}"
+ "no `media_*` tools may come from the core itself; got: {names:?}"
);
}
diff --git a/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs b/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs
index 9be8d3cc60..67f02a493f 100644
--- a/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_domain_family_tests.rs
@@ -4,77 +4,6 @@ use crate::tools::BrowserOpenTool;
use crate::tools::{filter_tools_by_user_preference, http_request_tool};
use tinytools_std::filesystem::{ApplyPatchTool, CsvExportTool};
-#[tokio::test]
-async fn all_tools_executes_stock_family_against_fake_backend() {
- let backend = integration_test_support::spawn_fake_integration_backend().await;
- let tmp = TempDir::new().unwrap();
- let cfg = integration_test_config(&tmp, &backend.base_url);
- store_test_session_token(&cfg);
- let tools = integration_tools_for_config(&tmp, &cfg);
-
- let quote = find_tool(&tools, "stock_quote")
- .execute(serde_json::json!({ "symbol": "AAPL" }))
- .await
- .expect("stock_quote execute");
- assert!(quote.output().contains("AAPL"));
- assert!(quote.output().contains("latest trading day 2026-05-16"));
-
- let exchange = find_tool(&tools, "stock_exchange_rate")
- .execute(serde_json::json!({
- "from_currency": "BTC",
- "to_currency": "USD"
- }))
- .await
- .expect("stock_exchange_rate execute");
- assert!(exchange.output().contains("BTC/USD = 42.5"));
-
- let options = find_tool(&tools, "stock_options")
- .execute(serde_json::json!({
- "symbol": "AAPL",
- "require_greeks": true
- }))
- .await
- .expect("stock_options execute");
- assert!(options.output().contains("AAPL options chain"));
- assert!(options.output().contains("call 2026-06-19 @ 250"));
-
- let crypto = find_tool(&tools, "stock_crypto_series")
- .execute(serde_json::json!({
- "symbol": "BTC",
- "market": "USD",
- "limit": 2
- }))
- .await
- .expect("stock_crypto_series execute");
- assert!(crypto.output().contains("BTC/USD"));
- assert!(crypto.output().contains("2026-05-16"));
-
- let commodity = find_tool(&tools, "stock_commodity")
- .execute(serde_json::json!({
- "commodity": "WTI",
- "interval": "weekly",
- "limit": 2
- }))
- .await
- .expect("stock_commodity execute");
- assert!(commodity.output().contains("WTI (weekly)"));
- assert!(commodity.output().contains("2026-05-16 80.1000"));
-
- let requests = backend.requests();
- let paths: Vec<&str> = requests.iter().map(|req| req.path.as_str()).collect();
- assert_eq!(
- paths,
- vec![
- "/agent-integrations/financial-apis/quote",
- "/agent-integrations/financial-apis/exchange-rate",
- "/agent-integrations/financial-apis/options",
- "/agent-integrations/financial-apis/crypto-series",
- "/agent-integrations/financial-apis/commodity",
- ]
- );
- assert_eq!(requests[2].body["requireGreeks"], serde_json::json!(true));
-}
-
/// Every acting tool gates on `can_act()` and returns its own read-only refusal
/// string. Each of those must carry [`POLICY_BLOCKED_MARKER`] so the agent
/// harness recognizes the block as a hard reject and halts on a verbatim repeat
diff --git a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
index 22f0e3a402..b5704a4d47 100644
--- a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
@@ -162,7 +162,7 @@ fn all_tools_excludes_delegate_when_no_agents() {
}
#[test]
-fn all_tools_registers_integration_families_when_enabled_and_signed_in() {
+fn all_tools_registers_no_hosted_integration_families_without_a_tool_source() {
let tmp = TempDir::new().unwrap();
let security = Arc::new(SecurityPolicy::default());
let browser = BrowserConfig::default();
@@ -187,16 +187,29 @@ fn all_tools_registers_integration_families_when_enabled_and_signed_in() {
);
let names = tool_names(&tools);
+ // The hosted families (Google Places, stock data, file storage, managed
+ // media) come from a host's registered tool source, so a bare core offers
+ // none of them even when enabled and signed in.
+ for hosted in [
+ "google_places_search",
+ "google_places_details",
+ "stock_quote",
+ "stock_exchange_rate",
+ "stock_options",
+ "stock_crypto_series",
+ "stock_commodity",
+ "storage_upload_file",
+ "media_generate_image",
+ ] {
+ assert!(
+ !names.iter().any(|n| n == hosted),
+ "`{hosted}` must come from a tool source, not the core; got: {names:?}"
+ );
+ }
+ // Composio registers on the session alone; the route is a host's concern.
assert_contains_all(
&names,
&[
- "google_places_search",
- "google_places_details",
- "stock_quote",
- "stock_exchange_rate",
- "stock_options",
- "stock_crypto_series",
- "stock_commodity",
"composio_list_toolkits",
"composio_list_connections",
"composio_authorize",
@@ -336,36 +349,3 @@ fn all_tools_omits_search_surface_when_search_is_disabled() {
}
}
-#[tokio::test]
-async fn all_tools_executes_google_places_family_against_fake_backend() {
- let backend = integration_test_support::spawn_fake_integration_backend().await;
- let tmp = TempDir::new().unwrap();
- let cfg = integration_test_config(&tmp, &backend.base_url);
- store_test_session_token(&cfg);
- let tools = integration_tools_for_config(&tmp, &cfg);
-
- let search = find_tool(&tools, "google_places_search")
- .execute(serde_json::json!({
- "query": "coffee",
- "max_results": 2
- }))
- .await
- .expect("google_places_search execute");
- assert!(search.output().contains("Found 2 place(s) for: coffee"));
- assert!(search.output().contains("coffee Result 1"));
-
- let details = find_tool(&tools, "google_places_details")
- .execute(serde_json::json!({ "place_id": "place-1-coffee" }))
- .await
- .expect("google_places_details execute");
- assert!(details.output().contains("Details for place-1-coffee"));
- assert!(details.output().contains("OPERATIONAL"));
-
- let requests = backend.requests();
- assert_eq!(requests.len(), 2);
- assert_eq!(requests[0].body["maxResults"], serde_json::json!(2));
- assert_eq!(
- requests[1].body["placeId"],
- serde_json::json!("place-1-coffee")
- );
-}