Skip to content

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

feat(inference): add timeout to model listing requests

Steven Enamakel19f5777a1d56
diff --git a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
index 8a728419d5..538747d07e 100644
--- a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
+++ b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
@@ -220,7 +220,8 @@ pub async fn list_configured_models_from_config(
let mut request = DiscoveryRequest::new(routing.endpoint.clone(), String::new())
.with_listing_url(models_url.clone())
- .with_single_model_probe(false);
+ .with_single_model_probe(false)
+ .with_timeout(std::time::Duration::from_secs(30));
if routing.using_oauth {
request = request
.with_header(
diff --git a/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs b/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs
index b6e01ffe19..bbf65e35ca 100644
--- a/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs
+++ b/crates/openhuman-tinyhumans/src/inference/managed_catalog.rs
@@ -138,7 +138,8 @@ pub(super) async fn list_models(
String::new(),
)
.with_listing_url(url.clone())
- .with_single_model_probe(false);
+ .with_single_model_probe(false)
+ .with_timeout(std::time::Duration::from_secs(30));
if attach {
discovery = discovery.with_header("Authorization", format!("Bearer {token}"));
if let Ok(headers) = attribution_headers() {