Skip to content

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

fix(ci): gate tests on the features their fixtures need

M3gA-Mind71be2f24193f
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs
index 31b8dc5cc2..775d15d9cf 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_juice_tests.rs
@@ -321,8 +321,12 @@ async fn juice_off_turn_loads_no_module_and_passes_tool_output_through() {
// The module was never asked for: the refusal is typed and nothing was
// downloaded (downloads are off, so a claim would have ended in Failed).
- let err = crate::modules::ensure_loaded_within(&config, "tinyjuice", None)
- .await
- .unwrap_err();
- assert_eq!(err, crate::modules::LoadError::Disabled("juice"));
+ // The loader only exists with the `modules` feature.
+ #[cfg(feature = "modules")]
+ {
+ let err = crate::modules::ensure_loaded_within(&config, "tinyjuice", None)
+ .await
+ .unwrap_err();
+ assert_eq!(err, crate::modules::LoadError::Disabled("juice"));
+ }
}
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
index a10bc384d4..d48777c017 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
@@ -342,6 +342,8 @@ fn juice_off_drops_handles_summaries_and_companion_tools() {
assert!(companion_tool_names("orchestrator", &off).is_empty());
}
+// The module listing only exists with the `modules` feature.
+#[cfg(feature = "modules")]
#[tokio::test]
async fn juice_off_install_never_touches_the_module() {
let off = juice_off();
diff --git a/crates/openhuman-core/src/mcp/server/tools/mod.rs b/crates/openhuman-core/src/mcp/server/tools/mod.rs
index 5139273bf2..a17c2cf2f7 100644
--- a/crates/openhuman-core/src/mcp/server/tools/mod.rs
+++ b/crates/openhuman-core/src/mcp/server/tools/mod.rs
@@ -44,7 +44,7 @@ pub use types::McpToolSpec;
pub use crate::config::rpc as config_rpc;
#[cfg(all(test, feature = "mcp"))]
pub use crate::core::all;
-#[cfg(test)]
+#[cfg(all(test, feature = "mcp"))]
pub(crate) use params::build_rpc_params_for_test;
#[cfg(all(test, feature = "mcp"))]
pub use serde_json::{json, Value};
diff --git a/crates/openhuman-core/src/modules/client.rs b/crates/openhuman-core/src/modules/client.rs
index 4e33edb467..523df63afc 100644
--- a/crates/openhuman-core/src/modules/client.rs
+++ b/crates/openhuman-core/src/modules/client.rs
@@ -65,7 +65,7 @@ impl ModuleClient {
}
}
- #[cfg(test)]
+ #[cfg(all(test, feature = "modules"))]
pub(crate) fn fixture_proxy(&self) -> Option<tinybus::Proxy> {
self.fixture.clone()
}
diff --git a/crates/openhuman-core/src/threads/store/bus.rs b/crates/openhuman-core/src/threads/store/bus.rs
index f02a11583c..9e8db8430a 100644
--- a/crates/openhuman-core/src/threads/store/bus.rs
+++ b/crates/openhuman-core/src/threads/store/bus.rs
@@ -351,9 +351,10 @@ async fn persist_channel_turn(
workspace_dir: &Path,
descriptor: ChannelTurnDescriptor<'_>,
) -> Result<(), String> {
- #[cfg(test)]
+ // The fixture exists only where both features compile it (channels/mod.rs).
+ #[cfg(all(test, feature = "channels", feature = "modules"))]
let client = crate::channels::module_fixture::client().await;
- #[cfg(not(test))]
+ #[cfg(not(all(test, feature = "channels", feature = "modules")))]
let client = {
let config = crate::config::rpc::load_config_with_timeout().await?;
if config.workspace_dir != workspace_dir {