Skip to content

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

fix(core): route otlp client through proxy and correct slot and tts lookups

Steven Enamakel2a6c338253e3
diff --git a/crates/openhuman-core/src/agent/progress_tracing/otlp.rs b/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
index e8a5080b87..62a6238a46 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/otlp.rs
@@ -20,7 +20,7 @@ pub(super) const OTLP_SERVICE_KEY: &str = "telemetry.otlp";
/// the underlying client is cached per service key, so every push reuses one
/// connection pool.
pub(super) fn otlp_client() -> reqwest::Client {
- reqwest::Client::new()
+ crate::config::build_runtime_proxy_client_with_timeouts(OTLP_SERVICE_KEY, 10, 10)
}
pub(super) async fn push_spans(config: &Config, spans: &[TraceSpan]) -> Result<(), String> {
diff --git a/crates/openhuman-core/src/core/slots.rs b/crates/openhuman-core/src/core/slots.rs
index 695c1c3676..8b93a5b169 100644
--- a/crates/openhuman-core/src/core/slots.rs
+++ b/crates/openhuman-core/src/core/slots.rs
@@ -329,7 +329,7 @@ impl<V: Clone + Send + Sync + 'static> HookSlot<V> {
/// The winning registration: the first of
/// [`entries_context_first`](Self::entries_context_first).
pub fn first(&self) -> Option<V> {
- self.entries()
+ self.entries_context_first()
.into_iter()
.next()
.map(|(_, value)| value)
diff --git a/crates/openhuman-core/src/tools/ops.rs b/crates/openhuman-core/src/tools/ops.rs
index 41cbcae67c..a3f33ec2db 100644
--- a/crates/openhuman-core/src/tools/ops.rs
+++ b/crates/openhuman-core/src/tools/ops.rs
@@ -403,6 +403,21 @@ pub fn all_tools_with_runtime(
tools.extend(crate::search::build_search_tools(root_config));
+ // Media generation roots. The `media_generate_*` tools themselves come from
+ // a host's registered tool source (the core ships no media generators);
+ // this records the files roots their reference policy reads, ahead of
+ // every source so one that reads them while it builds sees them. Gated by the
+ // `media` compile-time feature (#4804); absent from slim builds. Runtime
+ // `DomainSet::media` (#4796) still gates the tools when compiled.
+ #[cfg(feature = "media")]
+ {
+ *security
+ .media_files_roots
+ .lock()
+ .unwrap_or_else(std::sync::PoisonError::into_inner) =
+ Some(crate::agent::artifacts::FileRoots::from_config(root_config));
+ }
+
// What every registered tool source can see (`tools::sources`).
let source_ctx = crate::tools::sources::ToolSourceCtx {
config: &config,
@@ -424,21 +439,6 @@ pub fn all_tools_with_runtime(
Some(crate::tools::sources::ANCHOR_AFTER_SEARCH),
));
- // Media generation roots. The `media_generate_*` tools themselves come from
- // a host's registered tool source (the core ships no media generators);
- // this records the files roots their reference policy reads, ahead of
- // every source so one that reads them while it builds sees them. Gated by the
- // `media` compile-time feature (#4804); absent from slim builds. Runtime
- // `DomainSet::media` (#4796) still gates the tools when compiled.
- #[cfg(feature = "media")]
- {
- *security
- .media_files_roots
- .lock()
- .unwrap_or_else(std::sync::PoisonError::into_inner) =
- Some(crate::agent::artifacts::FileRoots::from_config(root_config));
- }
-
// Hosting tools — deploy a workspace directory through the compiled
// TinyHosts module. Registered only once a credential
// actually resolves (`[hosting].api_key`, else the provider's environment
diff --git a/crates/openhuman-core/src/voice/factory/helpers.rs b/crates/openhuman-core/src/voice/factory/helpers.rs
index 1952255ebe..938eccb639 100644
--- a/crates/openhuman-core/src/voice/factory/helpers.rs
+++ b/crates/openhuman-core/src/voice/factory/helpers.rs
@@ -97,7 +97,7 @@ pub fn effective_tts_provider(config: &Config) -> String {
/// it carries the shared unavailable sentinel the reporter filters on rather
/// than reading as a misconfigured slug.
fn missing_provider_error(slug: &str) -> anyhow::Error {
- if false {
+ if !slug.trim().is_empty() && defers_to_engine(slug) {
return anyhow::anyhow!(
"{} no '{slug}' speech provider is registered in this build",
crate::core::observability::BACKEND_UNAVAILABLE_PREFIX