Skip to content

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

test(inference): update tier tests with explicit config setup

Steven Enamakelc52633908fd0
diff --git a/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs b/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs
index 1a8c53e710..b74913a9d6 100644
--- a/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs
+++ b/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs
@@ -10,20 +10,18 @@ fn normalize_with_hosted_registration(config: &mut Config) -> bool {
fn hosted_normalizer_rewrites_legacy_tiers_and_preserves_concrete_pins() {
let mut config = Config {
default_model: Some("reasoning-v1".to_string()),
- orchestrator: openhuman_embed::__host::config::schema::OrchestratorModelConfig {
- model: Some("custom/orchestrator-model".to_string()),
- },
- agents: std::collections::HashMap::from([(
- "pinned".to_string(),
- openhuman_embed::__host::config::schema::DelegateAgentConfig {
- model: "vendor/model-id".to_string(),
- system_prompt: None,
- temperature: None,
- max_depth: 3,
- },
- )]),
..Config::default()
};
+ config.orchestrator.model = Some("custom/orchestrator-model".to_string());
+ config.agents.insert(
+ "pinned".to_string(),
+ openhuman_embed::__host::config::schema::DelegateAgentConfig {
+ model: "vendor/model-id".to_string(),
+ system_prompt: None,
+ temperature: None,
+ max_depth: 3,
+ },
+ );
assert!(normalize_with_hosted_registration(&mut config));
assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
@@ -39,45 +37,45 @@ fn hosted_normalizer_rewrites_legacy_tiers_and_preserves_concrete_pins() {
fn hosted_normalizer_covers_all_legacy_model_fields_and_preserves_non_tiers() {
let mut config = Config {
default_model: Some(" reasoning-v1 ".to_string()),
- orchestrator: openhuman_embed::__host::config::schema::OrchestratorModelConfig {
- model: Some("reasoning-quick-v1".to_string()),
- },
- teams: std::collections::HashMap::from([(
- "team".to_string(),
- openhuman_embed::__host::config::schema::TeamModelConfig {
- lead_model: Some("chat-v1".to_string()),
- agent_model: Some("burst-v1".to_string()),
- },
- )]),
- agents: std::collections::HashMap::from([(
- "legacy".to_string(),
- openhuman_embed::__host::config::schema::DelegateAgentConfig {
- model: "coding-v1".to_string(),
- system_prompt: None,
- temperature: None,
- max_depth: 3,
- },
- )]),
- model_routes: vec![
- openhuman_embed::__host::config::schema::ModelRouteConfig {
- hint: "summary".to_string(),
- model: "summarization-v1".to_string(),
- },
- openhuman_embed::__host::config::schema::ModelRouteConfig {
- hint: "custom".to_string(),
- model: "vendor/pinned".to_string(),
- },
- openhuman_embed::__host::config::schema::ModelRouteConfig {
- hint: "unknown".to_string(),
- model: "hint:unknown".to_string(),
- },
- openhuman_embed::__host::config::schema::ModelRouteConfig {
- hint: "blank".to_string(),
- model: String::new(),
- },
- ],
..Config::default()
};
+ config.orchestrator.model = Some("reasoning-quick-v1".to_string());
+ config.teams.insert(
+ "team".to_string(),
+ openhuman_embed::__host::config::schema::TeamModelConfig {
+ lead_model: Some("chat-v1".to_string()),
+ agent_model: Some("burst-v1".to_string()),
+ },
+ );
+ config.agents.insert(
+ "legacy".to_string(),
+ openhuman_embed::__host::config::schema::DelegateAgentConfig {
+ model: "coding-v1".to_string(),
+ system_prompt: None,
+ temperature: None,
+ max_depth: 3,
+ },
+ );
+ config
+ .model_routes
+ .push(openhuman_embed::__host::config::schema::ModelRouteConfig {
+ hint: "summary".to_string(),
+ model: "summarization-v1".to_string(),
+ });
+ config.model_routes.extend([
+ openhuman_embed::__host::config::schema::ModelRouteConfig {
+ hint: "custom".to_string(),
+ model: "vendor/pinned".to_string(),
+ },
+ openhuman_embed::__host::config::schema::ModelRouteConfig {
+ hint: "unknown".to_string(),
+ model: "hint:unknown".to_string(),
+ },
+ openhuman_embed::__host::config::schema::ModelRouteConfig {
+ hint: "blank".to_string(),
+ model: String::new(),
+ },
+ ]);
assert!(normalize_with_hosted_registration(&mut config));
assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
@@ -135,18 +133,18 @@ fn hosted_normalizer_selects_existing_managed_entry_for_legacy_managed_endpoint(
let mut config = Config {
primary_cloud: None,
inference_url: Some("https://api.managed.test/v1".into()),
- cloud_providers: vec![
- openhuman_embed::__host::config::schema::cloud_providers::CloudProviderCreds {
- id: "p_existing_openhuman".to_string(),
- slug: "openhuman".into(),
- endpoint: "https://api.managed.test/v1".into(),
- ..Default::default()
- },
- ],
..Config::default()
};
config.resolved_endpoints.managed_hosts = vec![".managed.test".into()];
let managed_id = "p_existing_openhuman".to_string();
+ config.cloud_providers.push(
+ openhuman_embed::__host::config::schema::cloud_providers::CloudProviderCreds {
+ id: managed_id.clone(),
+ slug: "openhuman".into(),
+ endpoint: "https://api.managed.test/v1".into(),
+ ..Default::default()
+ },
+ );
let _ = normalize_with_hosted_registration(&mut config);
assert_eq!(config.primary_cloud.as_deref(), Some(managed_id.as_str()));
@@ -159,16 +157,16 @@ fn hosted_normalizer_leaves_custom_and_explicit_primary_choices_alone() {
let mut custom = Config {
primary_cloud: None,
inference_url: Some("https://custom.example/v1".into()),
- cloud_providers: vec![
- openhuman_embed::__host::config::schema::cloud_providers::CloudProviderCreds {
- id: "p_hosted".into(),
- slug: "openhuman".into(),
- endpoint: "https://api.managed.test/v1".into(),
- ..Default::default()
- },
- ],
..Config::default()
};
+ custom.cloud_providers.push(
+ openhuman_embed::__host::config::schema::cloud_providers::CloudProviderCreds {
+ id: "p_hosted".into(),
+ slug: "openhuman".into(),
+ endpoint: "https://api.managed.test/v1".into(),
+ ..Default::default()
+ },
+ );
assert!(!normalize_with_hosted_registration(&mut custom));
assert_eq!(custom.primary_cloud, None);