Skip to content

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

fix(caps_host): apply agent timeout and init definition registry

Steven Enamakelfb4bbc291556
diff --git a/crates/openhuman-core/src/flows/caps_host/agent.rs b/crates/openhuman-core/src/flows/caps_host/agent.rs
index ce0865651b..6cb4770ee1 100644
--- a/crates/openhuman-core/src/flows/caps_host/agent.rs
+++ b/crates/openhuman-core/src/flows/caps_host/agent.rs
@@ -420,7 +420,6 @@ impl OpenHumanAgentRunner {
node_model = node_model.as_deref().unwrap_or("<definition-default>"),
default_model = effective.default_model.as_deref().unwrap_or("<config-default>"),
effective_iteration_cap,
- explicit_timeout_secs = requested_timeout_secs.is_some(),
base_timeout_secs,
timeout_secs,
prompt_len = prompt.len(),
diff --git a/crates/openhuman-core/src/flows/caps_host/service.rs b/crates/openhuman-core/src/flows/caps_host/service.rs
index 6330619918..3e2bfa2329 100644
--- a/crates/openhuman-core/src/flows/caps_host/service.rs
+++ b/crates/openhuman-core/src/flows/caps_host/service.rs
@@ -56,6 +56,13 @@ impl CapsHostService {
});
let mut config = request.config.clone();
+ if let Some(object) = config.as_object_mut()
+ && object.get("timeout_secs").and_then(Value::as_u64).is_none()
+ {
+ if let Some(timeout) = request.agent.limits.agent_timeout_secs {
+ object.insert("timeout_secs".to_owned(), Value::from(timeout));
+ }
+ }
if let (Some(model), Some(object)) = (
request
.model
@@ -346,6 +353,10 @@ impl CapsHostService {
let binding = Arc::clone(&self.0);
binding
.within(async move {
+ crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global(
+ &binding.config.workspace_dir,
+ )
+ .map_err(|error| error.to_string())?;
let registry = crate::agent::harness::host_definition::AgentDefinitionRegistry::current();
registry
.and_then(|registry| registry.get(&id).cloned())
@@ -360,6 +371,10 @@ impl CapsHostService {
let binding = Arc::clone(&self.0);
binding
.within(async move {
+ crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global(
+ &binding.config.workspace_dir,
+ )
+ .map_err(|error| error.to_string())?;
let registry = crate::agent::harness::host_definition::AgentDefinitionRegistry::current();
registry
.map(|registry| registry.list().into_iter().cloned().map(to_bus_agent_definition).collect())