Skip to content

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

fix(subsystem): pass dispatch context into subsystems status

Steven Enamakel06581a21fc16
diff --git a/crates/openhuman-core/src/core/subsystem/schemas.rs b/crates/openhuman-core/src/core/subsystem/schemas.rs
index 82c18bb4d8..959e1851c8 100644
--- a/crates/openhuman-core/src/core/subsystem/schemas.rs
+++ b/crates/openhuman-core/src/core/subsystem/schemas.rs
@@ -82,9 +82,9 @@ pub async fn subsystems_status(ctx: &DispatchCtx) -> Vec<SubsystemStatus> {
}
}
-fn handle_status(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_status(ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
- let rows = subsystems_status().await;
+ let rows = subsystems_status(&ctx).await;
log::debug!("[subsystem] status requested: {} slot(s)", rows.len());
Outcome::new(serde_json::json!({ "subsystems": rows }), vec![]).into_cli_compatible_json()
})
diff --git a/crates/openhuman-core/src/core/subsystems_cli.rs b/crates/openhuman-core/src/core/subsystems_cli.rs
index acfb543e6b..0663e7a948 100644
--- a/crates/openhuman-core/src/core/subsystems_cli.rs
+++ b/crates/openhuman-core/src/core/subsystems_cli.rs
@@ -66,7 +66,8 @@ pub fn run_subsystems_command(args: &[String]) -> Result<()> {
/// The slot table for a standalone CLI invocation: the same rows the
/// `subsystems status` RPC returns, resolved from the on-disk config.
async fn cli_subsystems_status() -> Vec<SubsystemStatus> {
- subsystems_status().await
+ // A standalone CLI call is the host's one context.
+ subsystems_status(&crate::core::runtime::DispatchCtx::host_default()).await
}
fn print_help() {
diff --git a/crates/openhuman-embed/src/turn.rs b/crates/openhuman-embed/src/turn.rs
index b8fe1d5801..058645adaf 100644
--- a/crates/openhuman-embed/src/turn.rs
+++ b/crates/openhuman-embed/src/turn.rs
@@ -589,12 +589,13 @@ async fn dispatch(
}
let ctx = std::sync::Arc::clone(rt.context());
let chat_env = options.chat_env;
+ let dispatch = openhuman_core::core::runtime::DispatchCtx::new(std::sync::Arc::clone(&ctx));
let turn: futures_box::BoxFuture<'_, Result<AgentReply, CoreError>> =
Box::pin(async move {
use openhuman_core::inference::host_runtime::ops::{
agent_chat_reply_for, AgentChatTarget,
};
- let mut config = openhuman_core::core::runtime::DispatchCtx::new(ctx.clone())
+ let mut config = dispatch
.load_config()
.await
.map_err(|raw| CoreError::from_rpc_string(AGENT_CHAT, raw))?;