Skip to content

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

refactor(config): route config loads through dispatch context

Steven Enamakel981e185f6532
diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rs
index 48ffdfb894..d70ba5fb3e 100644
--- a/crates/openhuman-core/src/core/runtime/services.rs
+++ b/crates/openhuman-core/src/core/runtime/services.rs
@@ -257,7 +257,7 @@ pub fn spawn_cron_service(
) -> tokio::task::JoinHandle<()> {
let dispatch = crate::core::runtime::DispatchCtx::new(ctx.clone());
tokio::spawn(crate::core::runtime::CoreContext::scope(ctx, async move {
- match crate::config::ops::load_config_with_timeout().await {
+ match dispatch.load_config().await {
Ok(config) => {
if !config.cron.enabled {
log::info!("[cron] scheduler disabled via config; skipping");
diff --git a/crates/openhuman-core/src/core/subsystem/schemas.rs b/crates/openhuman-core/src/core/subsystem/schemas.rs
index ae5b1d1b20..82c18bb4d8 100644
--- a/crates/openhuman-core/src/core/subsystem/schemas.rs
+++ b/crates/openhuman-core/src/core/subsystem/schemas.rs
@@ -72,8 +72,8 @@ pub fn schemas(function: &str) -> ControllerSchema {
///
/// Memory is the only occupant today. This is also what
/// [`crate::core::subsystems_cli`] renders as a table.
-pub async fn subsystems_status() -> Vec<SubsystemStatus> {
- match crate::config::rpc::load_config_with_timeout().await {
+pub async fn subsystems_status(ctx: &DispatchCtx) -> Vec<SubsystemStatus> {
+ match ctx.load_config().await {
Ok(config) => vec![crate::memory::status::subsystem_status(&config).await],
Err(error) => {
log::warn!("[subsystems] config unavailable for status: {error}");
diff --git a/crates/openhuman-embed/src/turn.rs b/crates/openhuman-embed/src/turn.rs
index 38d29c98a0..b8fe1d5801 100644
--- a/crates/openhuman-embed/src/turn.rs
+++ b/crates/openhuman-embed/src/turn.rs
@@ -594,7 +594,8 @@ async fn dispatch(
use openhuman_core::inference::host_runtime::ops::{
agent_chat_reply_for, AgentChatTarget,
};
- let mut config = openhuman_core::config::rpc::load_config_with_timeout()
+ let mut config = openhuman_core::core::runtime::DispatchCtx::new(ctx.clone())
+ .load_config()
.await
.map_err(|raw| CoreError::from_rpc_string(AGENT_CHAT, raw))?;
let target = match request.agent_id.as_deref().map(str::trim) {