Skip to content

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

test(inference): cover attempt tracking through temperature wrapper

Steven Enamakelb75bbf974a8c
diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
index ef9a0d87fc..466481c27c 100644
--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
@@ -239,6 +239,42 @@ async fn one_shot_chat_models_preserve_factory_temperature_as_request_default()
);
}
+#[test]
+fn default_temperature_wrapper_preserves_physical_attempt_tracking() {
+ use async_trait::async_trait;
+ use std::sync::Arc;
+ use tinyinference_llm::model::{ModelRequest, ModelResponse};
+
+ struct TrackedModel;
+
+ #[async_trait]
+ impl ChatModel<()> for TrackedModel {
+ fn tracks_physical_attempts(&self) -> bool {
+ true
+ }
+
+ async fn invoke(
+ &self,
+ _state: &(),
+ _request: ModelRequest,
+ ) -> tinyinference_llm::Result<ModelResponse> {
+ Ok(ModelResponse::assistant("ok"))
+ }
+ }
+
+ let _guard = crate::inference::inference_test_guard();
+ let _override = test_provider_override::install_model(Arc::new(TrackedModel));
+ let wrapped = create_chat_model_in(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ "chat",
+ &Config::default(),
+ 0.3,
+ )
+ .expect("test override model");
+
+ assert!(wrapped.tracks_physical_attempts());
+}
+
// ── Motion B (#4727): managed-backend crate-native routing ──────────────────
// `create_chat_model` must route the managed OpenHuman backend through the
// crate-native `OpenHumanBackendModel`, whose concrete `managed` profile