Skip to content

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

test(inference): annotate generic provider context in fixtures

Steven Enamakela24815b458e0
diff --git a/crates/openhuman-core/src/inference/registry_tests.rs b/crates/openhuman-core/src/inference/registry_tests.rs
index 3762235c37..96843c578c 100644
--- a/crates/openhuman-core/src/inference/registry_tests.rs
+++ b/crates/openhuman-core/src/inference/registry_tests.rs
@@ -126,11 +126,11 @@ fn a_registered_embedding_factory_builds_the_managed_embedding_model() {
let _guard = crate::inference::inference_test_guard();
let calls = Arc::new(AtomicUsize::new(0));
let counter = Arc::clone(&calls);
- register_embedding(PROVIDER_OPENHUMAN, move |request| {
+ register_embedding(PROVIDER_OPENHUMAN, Arc::new(move |request| {
assert_eq!(request.dimensions, 8);
counter.fetch_add(1, Ordering::SeqCst);
Ok(Box::new(tinyinference_embeddings::NoopEmbeddingModel))
- });
+ }));
let built = crate::inference::embedding_host::create_embedding_provider_with_credentials(
"cloud",
"any-model",
diff --git a/crates/openhuman-core/src/inference/turn_models_tests.rs b/crates/openhuman-core/src/inference/turn_models_tests.rs
index 022e44da7a..f566a863c0 100644
--- a/crates/openhuman-core/src/inference/turn_models_tests.rs
+++ b/crates/openhuman-core/src/inference/turn_models_tests.rs
@@ -31,10 +31,10 @@ use tinyagents_harness::host::PrebuiltModelResolver as TurnModelResolver;
fn scoped_model_entry(
name: &'static str,
supports_vision: bool,
-) -> crate::inference::registry::ChatModelEntry {
+) -> crate::inference::registry::ChatModelEntry::<crate::inference::registry::ProviderContext> {
use crate::inference::registry::ProviderModelMetadata;
- crate::inference::registry::ChatModelEntry {
+ crate::inference::registry::ChatModelEntry::<crate::inference::registry::ProviderContext> {
build: Arc::new(move |_| Ok((Arc::new(NamedModel(name)), name.to_string()))),
probe: None,
models: Some(ProviderModelMetadata {
@@ -192,7 +192,7 @@ async fn role_pins_apply_when_the_primary_uses_config_routing() {
crate::inference::registry::register_chat_model_in(
&extensions,
crate::inference::provider::factory::PROVIDER_OPENHUMAN,
- crate::inference::registry::ChatModelEntry {
+ crate::inference::registry::ChatModelEntry::<crate::inference::registry::ProviderContext> {
build: Arc::new(|_| {
Ok((
Arc::new(NamedModel("managed fixture")),
diff --git a/crates/openhuman-tinyhumans/src/inference/mod.rs b/crates/openhuman-tinyhumans/src/inference/mod.rs
index b16f2d01b0..0523bd636d 100644
--- a/crates/openhuman-tinyhumans/src/inference/mod.rs
+++ b/crates/openhuman-tinyhumans/src/inference/mod.rs
@@ -115,7 +115,7 @@ fn readiness_probe() -> ReadinessProbe {
/// Registers this area's hooks with the core. Idempotent.
pub(crate) fn register(_options: &InstallOptions) {
- let build: ChatModelFactory = Arc::new(build_chat_model);
+ let build: ChatModelFactory<ProviderContext> = Arc::new(build_chat_model);
register_chat_model(
PROVIDER_OPENHUMAN,
ChatModelEntry {