Skip to content

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

test(tests): update test assertions and remove redundant cfg guards

Steven Enamakel0cb5bcca9cfc
diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
index 9bffba3987..2b9b92a60a 100644
--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
@@ -492,10 +492,6 @@ fn configured_openhuman_jwt_slug_routes_to_managed_chat_model() {
.expect("registered host policy should recognize this route")
.expect("registered model should build");
assert_eq!(pinned_id, "vendor/pinned");
- assert!(
- model.profile().is_none(),
- "the generic fixture has no host profile"
- );
crate::inference::registry::unregister_chat_model(
crate::inference::provider::factory::PROVIDER_OPENHUMAN,
);
diff --git a/crates/openhuman-core/src/inference/provider/factory_tests.rs b/crates/openhuman-core/src/inference/provider/factory_tests.rs
index a1f202dac2..5c837b5d7d 100644
--- a/crates/openhuman-core/src/inference/provider/factory_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_tests.rs
@@ -4,10 +4,8 @@ use crate::config::Config;
use crate::security::credentials::AuthService;
use tempfile::TempDir;
-#[cfg(test)]
struct ManagedRouteFixtureModel;
-#[cfg(test)]
#[async_trait::async_trait]
impl ChatModel<()> for ManagedRouteFixtureModel {
async fn invoke(
@@ -21,7 +19,6 @@ impl ChatModel<()> for ManagedRouteFixtureModel {
}
}
-#[cfg(test)]
fn install_test_managed_provider() -> Arc<std::sync::Mutex<Vec<bool>>> {
use crate::config::schema::cloud_providers::AuthStyle;
use crate::inference::registry::{ChatModelEntry, ProviderModelHooks};
@@ -74,7 +71,6 @@ fn install_test_managed_provider() -> Arc<std::sync::Mutex<Vec<bool>>> {
native_modes
}
-#[cfg(test)]
fn fixture_managed_entry(id: &str) -> CloudProviderCreds {
CloudProviderCreds {
id: id.to_string(),
diff --git a/crates/openhuman-core/src/inference/provider/http_error_tests.rs b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
index b9e2d00e6b..de470691a3 100644
--- a/crates/openhuman-core/src/inference/provider/http_error_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
@@ -449,19 +449,19 @@ mod provider_config_rejection_suppression {
super::install_fixture_backend_classifier();
assert!(!config_rejection_demoted(
&tinyinference_llm::failure::http::classify_http_failure(
- FIXTURE_BACKEND,
+ super::FIXTURE_BACKEND,
reqwest::StatusCode::BAD_REQUEST.as_u16(),
TIER_LEAK_BODY
),
- FIXTURE_BACKEND
+ super::FIXTURE_BACKEND
));
assert!(!config_rejection_demoted(
&tinyinference_llm::failure::http::classify_http_failure(
- FIXTURE_BACKEND,
+ super::FIXTURE_BACKEND,
reqwest::StatusCode::BAD_REQUEST.as_u16(),
TEMP_BODY
),
- FIXTURE_BACKEND
+ super::FIXTURE_BACKEND
));
}
@@ -570,11 +570,11 @@ mod provider_config_rejection_suppression {
assert!(
!config_rejection_demoted(
&tinyinference_llm::failure::http::classify_http_failure(
- FIXTURE_BACKEND,
+ super::FIXTURE_BACKEND,
reqwest::StatusCode::FORBIDDEN.as_u16(),
body
),
- FIXTURE_BACKEND
+ super::FIXTURE_BACKEND
),
"backend 403 subscription phrase must NOT be suppressed (polarity guard)"
);
diff --git a/crates/openhuman-tinyhumans/src/inference/managed_model_tests.rs b/crates/openhuman-tinyhumans/src/inference/managed_model_tests.rs
index 171fd308a0..fa6b4da29d 100644
--- a/crates/openhuman-tinyhumans/src/inference/managed_model_tests.rs
+++ b/crates/openhuman-tinyhumans/src/inference/managed_model_tests.rs
@@ -1,6 +1,6 @@
+use super::*;
use super::super::managed_reasoning::REASONING_OFF_METADATA_KEY;
use super::super::managed_reasoning::{apply_reasoning_hint, with_thread_id};
-use super::*;
use serde_json::Value;
use tinyinference_llm::model::ChatModel;
@@ -47,10 +47,23 @@ fn managed_model_keeps_its_explicit_thread_without_an_ambient_scope() {
fn managed_model_advertises_tool_and_vision_capabilities() {
let model = backend();
let profile = model.profile().expect("managed profile");
+ assert_eq!(profile.provider.as_deref(), Some("managed"));
assert!(profile.tool_calling);
+ assert!(profile.parallel_tool_calls);
+ assert!(profile.streaming_tool_chunks);
assert!(profile.modalities.image_in);
}
+#[test]
+fn managed_model_forced_text_mode_disables_native_tool_capabilities() {
+ let model = backend().with_native_tool_calling(false);
+ let profile = model.profile().expect("managed profile");
+ assert_eq!(profile.provider.as_deref(), Some("managed"));
+ assert!(!profile.tool_calling);
+ assert!(!profile.parallel_tool_calls);
+ assert!(!profile.streaming_tool_chunks);
+}
+
#[test]
fn managed_model_supports_only_serializable_native_media_inputs() {
use tinyinference_llm::model::{InputModality, InputSource};