Skip to content

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

refactor(config): remove redundant validation from apply_agent_settings

Steven Enamakel49a0e56b29c6
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rs
index e04d3430a4..7dfad275f2 100644
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@ -246,43 +246,6 @@ pub async fn apply_agent_settings(
.map(super::tool_dispatcher::normalize_tool_dispatcher)
.transpose()?;
- if let Some(timeout_secs) = update.agent_timeout_secs {
- if !(MIN_TIMEOUT_SECS..=MAX_TIMEOUT_SECS).contains(&timeout_secs) {
- log::warn!(
- "[config][agent] rejected agent_timeout_secs={timeout_secs} (valid {MIN_TIMEOUT_SECS}..={MAX_TIMEOUT_SECS})"
- );
- return Err(format!(
- "agent_timeout_secs must be between {MIN_TIMEOUT_SECS} and {MAX_TIMEOUT_SECS} seconds (got {timeout_secs})"
- ));
- }
- }
-
- if let Some(chat_agent_id) = update.chat_agent_id.as_deref() {
- let trimmed = chat_agent_id.trim();
- if !trimmed.is_empty()
- && !crate::agent::OpenHumanSessionHost::is_runnable_agent_id(config, trimmed)
- {
- return Err(format!(
- "chat_agent_id '{trimmed}' is not a runnable agent definition"
- ));
- }
- }
-
- let tool_dispatcher = match update.tool_dispatcher.as_deref() {
- Some(raw) => {
- let normalized = raw.trim().to_ascii_lowercase();
- if !TOOL_DISPATCHER_CHOICES.contains(&normalized.as_str()) {
- log::warn!("[config][agent] rejected tool_dispatcher={normalized:?}");
- return Err(format!(
- "invalid tool_dispatcher '{normalized}' (expected {})",
- TOOL_DISPATCHER_CHOICES.join(" | ")
- ));
- }
- Some(normalized)
- }
- None => None,
- };
-
if let Some(timeout_secs) = update.agent_timeout_secs {
config.agent.agent_timeout_secs = timeout_secs;
}
diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rs
index 3719f14a22..07cc8033ce 100644
--- a/crates/openhuman-core/src/config/ops/mod.rs
+++ b/crates/openhuman-core/src/config/ops/mod.rs
@@ -5,8 +5,8 @@ mod loader;
mod model;
mod privacy;
mod sandbox;
-mod tool_dispatcher;
mod search;
+mod tool_dispatcher;
mod ui;
// ── Public re-exports (preserving the flat external API) ─────────────────────