The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(host): add test modules for host components
Steven Enamakel6c9663e30bd6
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/agent_memory_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/agent_memory_tests.rsindex 327e7d553f..21ccc04e83 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/agent_memory_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/agent_memory_tests.rs@@ -594,17 +594,6 @@ async fn thread_summary_is_none_and_never_synthesized_from_recall() {.is_none());}-#[tokio::test]-async fn usable_behind_a_trait_object() {- let (mem, _) = adapter(StubMemory::default());- let boxed: Box<dyn AgentMemory> = Box::new(mem);- boxed.remember(NewMemory::new("dyn safe")).await.unwrap();- assert_eq!(- boxed.recall(RecallRequest::new("dyn")).await.unwrap().len(),- 1- );-}-#[test]fn a_blank_namespace_is_refused_rather_than_silently_widening_scope() {let (mem, _) = adapter(StubMemory::default());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.rsindex 0607fec4f3..03a2279397 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@@ -173,18 +173,3 @@ fn this_gate_never_asks_for_compression() {let gate = gate(AgentTokenjuiceCompression::Full);assert_eq!(gate.compression_hint(&crowded()), CompressionHint::None);}--#[tokio::test]-async fn is_usable_as_a_trait_object() {- // Pins object safety: the harness stores this as `Arc<dyn BudgetGate>`.- let gate: Arc<dyn BudgetGate> = Arc::new(gate(AgentTokenjuiceCompression::Auto));- let permit = gate- .acquire(&CallEstimate::new("m", 1, 1).with_agent("lead"))- .await- .expect("grants");- drop(permit);- assert_eq!(- gate.compression_hint(&ContextState::default()),- CompressionHint::None- );-}diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rsindex 7b6fdb897d..bfbca12dec 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer_tests.rs@@ -157,14 +157,3 @@ fn the_model_name_falls_back_to_the_crate_default() {let pinned = OpenHumanContextComposer::new(config_in(dir.path())).with_model_name("haiku");assert_eq!(pinned.model_name, "haiku");}--#[tokio::test]-async fn usable_as_a_trait_object() {- // Pins object safety — the harness stores this as- // `Arc<dyn ContextComposer>`, so a non-dyn-safe impl would only fail- // at the wiring site, not here.- let dir = tempfile::tempdir().expect("tempdir");- let composer: Arc<dyn ContextComposer> =- Arc::new(OpenHumanContextComposer::new(config_in(dir.path())));- assert!(composer.compose_system_prompt(&request()).await.is_ok());-}diff --git a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rsindex 2be8379bbb..d2119e4073 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry_tests.rs@@ -457,16 +457,6 @@ async fn list_is_stable_across_calls() {assert_eq!(first, second);}-#[tokio::test]-async fn is_usable_as_a_trait_object() {- let registry: Box<dyn DefinitionRegistry> = Box::new(builtins());- assert!(registry- .resolve("orchestrator")- .await- .expect("resolve")- .is_some());-}-#[tokio::test]async fn an_empty_catalogue_misses_everything_without_erroring() {let registry = registry_of(Vec::new());diff --git a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rsindex dfe0036e2c..263a200896 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink_tests.rs@@ -488,14 +488,3 @@ async fn a_closed_channel_is_survivable() {.await;assert_eq!(sink.dropped(), 2);}--#[tokio::test]-async fn works_through_an_arc_trait_object() {- let (tx, mut rx) = mpsc::channel(8);- let dynamic: Arc<dyn ProgressSink> = Arc::new(OpenHumanProgressSink::new(tx));- dynamic.emit(started()).await;- assert!(matches!(- rx.try_recv().expect("event forwarded"),- AgentProgress::TurnStarted- ));-}diff --git a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rsindex cc8efcba97..ddf9dbb7ee 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs@@ -312,13 +312,3 @@ fn the_dispatched_name_changes_the_verdict_only_for_timeouts() {"a timeout must distinguish an external-effect tool from a safe one");}--#[test]-fn usable_as_a_trait_object() {- let classifier: std::sync::Arc<dyn ToolOutcomeClassifier> =- std::sync::Arc::new(OpenHumanToolOutcomeClassifier::default());- assert_eq!(- classifier.classify("shell", &result(Some("503"), "")),- OutcomeClass::RetryableFailure- );-}