Skip to content

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

test(all): update test assertions for better error handling and type safety

Steven Enamakelda81e694de1b
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
index 94825c57e1..6a365d6417 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/budget_gate_tests.rs
@@ -310,7 +310,7 @@ fn a_call_is_checked_against_its_own_model() {
}];
let gate = OpenHumanBudgetGate::new(Arc::new(config));
// Another call left a different model in the shared attribution.
- *gate.last_model.write() = "other".into();
+ *gate.last_model.write() = Some("other".into());
let policies = gate.live_budgets();
assert!(gate
.check_budgets_against(&estimate_for("planner"), &policies, &tracker)
diff --git a/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs b/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
index 5e15d83e16..f8e78978c6 100644
--- a/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
+++ b/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::config::schema::cloud_providers::CloudProviderCreds;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
fn provider(id: &str, slug: &str, endpoint: &str, auth_style: AuthStyle) -> CloudProviderCreds {
CloudProviderCreds {
diff --git a/crates/openhuman-core/src/inference/registry_tests.rs b/crates/openhuman-core/src/inference/registry_tests.rs
index 0f3f05ce78..cb0dd62a02 100644
--- a/crates/openhuman-core/src/inference/registry_tests.rs
+++ b/crates/openhuman-core/src/inference/registry_tests.rs
@@ -125,7 +125,7 @@ fn a_registered_embedding_factory_builds_the_managed_embedding_model() {
});
let built = crate::inference::embedding_host::create_embedding_provider_with_credentials(
"cloud",
- "any-model",
+ Some("any-model"),
8,
"",
None,
diff --git a/crates/openhuman-core/src/triage/routing_tests.rs b/crates/openhuman-core/src/triage/routing_tests.rs
index d7f4523e0c..f6ed069fdd 100644
--- a/crates/openhuman-core/src/triage/routing_tests.rs
+++ b/crates/openhuman-core/src/triage/routing_tests.rs
@@ -20,7 +20,8 @@ fn openai_entry(id: &str, slug: &str) -> CloudProviderCreds {
fn managed_route_without_a_registered_provider_fails_closed() {
let config = test_config();
let error = build_remote_provider(&crate::core::runtime::DispatchCtx::ambient(), &config)
- .expect_err("bare core has no hosted model source");
+ .err()
+ .expect("bare core has no hosted model source");
assert!(error.to_string().contains("BACKEND_UNAVAILABLE"));
}
@@ -29,7 +30,8 @@ fn managed_route_does_not_invent_a_model_when_provider_policy_is_absent() {
let mut config = test_config();
config.default_model = Some("reasoning-v1".to_string());
let error = build_remote_provider(&crate::core::runtime::DispatchCtx::ambient(), &config)
- .expect_err("retired pin is not a concrete model source");
+ .err()
+ .expect("retired pin is not a concrete model source");
assert!(error.to_string().contains("BACKEND_UNAVAILABLE"));
config.default_model = Some("openrouter/deepseek/deepseek-v4-pro".to_string());