Skip to content

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

fix(test): correct test expectations for model pin schema

Steven Enamakel2e29dd0aef68
diff --git a/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs b/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs
index 5de7364145..cf67e391a7 100644
--- a/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs
+++ b/crates/openhuman-core/src/config/schema/types_model_pin_tests.rs
@@ -124,3 +124,26 @@ fn empty_model_pin_values_fall_back_to_auto_routing() {
assert_eq!(config.configured_agent_model("orchestrator", true), None);
assert_eq!(config.configured_agent_model("tools_agent", false), None);
}
+
+#[test]
+fn workload_local_model_trims_and_only_honours_ollama_providers() {
+ let mut config = Config::default();
+ config.chat_provider = Some(" ollama:chat-local ".into());
+ config.reasoning_provider = Some("cloud".into());
+ config.agentic_provider = Some("ollama:agent-local".into());
+ config.coding_provider = Some("ollama:code-local".into());
+ config.memory_provider = Some("ollama:memory-local".into());
+ config.embeddings_provider = Some("ollama:embed-local".into());
+ config.learning_provider = Some("ollama:learning-local".into());
+ assert_eq!(
+ config.workload_local_model("chat").as_deref(),
+ Some("chat-local")
+ );
+ assert_eq!(config.workload_local_model("reasoning"), None);
+ for workload in ["agentic", "coding", "memory", "embeddings", "learning"] {
+ assert!(config.workload_uses_local(workload), "{workload}");
+ }
+ assert!(!config.workload_uses_local("unknown"));
+ config.chat_provider = Some("ollama: ".into());
+ assert_eq!(config.workload_local_model("chat"), None);
+}