The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(core): capture dispatch context by move in async blocks
Steven Enamakel35660d50a6e6
diff --git a/crates/openhuman-core/src/agent/schemas.rs b/crates/openhuman-core/src/agent/schemas.rsindex a93d7d11d4..3263e98fd5 100644--- a/crates/openhuman-core/src/agent/schemas.rs+++ b/crates/openhuman-core/src/agent/schemas.rs@@ -578,7 +578,7 @@ fn local_catalog_models_from_config(}fn handle_registry_snapshot(ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {use tinyagents_registry::{ComponentKind, ComponentMetadata, RegistrySnapshot};let mut components: Vec<ComponentMetadata> = Vec::new();diff --git a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs b/crates/openhuman-core/src/config/schemas/controllers/workspace.rsindex e8e2df3748..742cc01795 100644--- a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs@@ -72,7 +72,7 @@ pub(super) fn handle_get_user_timezone(ctx: DispatchCtx,_params: Map<String, Value>,) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(crate::core::Outcome::single_log(config_rpc::user_timezone_json(&config),@@ -85,7 +85,7 @@ pub(super) fn handle_get_analytics_settings(ctx: DispatchCtx,_params: Map<String, Value>,) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {use crate::core::Outcome;let config = ctx.load_config().await?;let result = serde_json::json!({diff --git a/crates/openhuman-core/src/cron/schemas.rs b/crates/openhuman-core/src/cron/schemas.rsindex 44659ff0fa..43263405ff 100644--- a/crates/openhuman-core/src/cron/schemas.rs+++ b/crates/openhuman-core/src/cron/schemas.rs@@ -404,7 +404,7 @@ fn handle_add(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture}fn handle_list(ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(crate::cron::rpc::cron_list(&config).await?)})diff --git a/crates/openhuman-core/src/desktop/control/schemas.rs b/crates/openhuman-core/src/desktop/control/schemas.rsindex 3acaa28b78..879757f9c6 100644--- a/crates/openhuman-core/src/desktop/control/schemas.rs+++ b/crates/openhuman-core/src/desktop/control/schemas.rs@@ -77,7 +77,7 @@ fn schema(function: &'static str) -> ControllerSchema {}fn status(ctx: DispatchCtx, _: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await.map_err(|error| format!("config unavailable: {error}"))?;@@ -102,7 +102,7 @@ fn set_enabled(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture}fn probe(ctx: DispatchCtx, _: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await.map_err(|error| format!("config unavailable: {error}"))?;@@ -112,7 +112,7 @@ fn probe(ctx: DispatchCtx, _: Map<String, Value>) -> ControllerFuture {}fn pending(ctx: DispatchCtx, _: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await.map_err(|error| format!("config unavailable: {error}"))?;diff --git a/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs b/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rsindex 6e07a8b9ef..486b65c58c 100644--- a/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs+++ b/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs@@ -16,7 +16,7 @@ pub(super) fn handle_list_toolkits(ctx: DispatchCtx,_params: Map<String, Value>,) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(ops::composio_list_toolkits(&config).await?)})@@ -26,7 +26,7 @@ pub(super) fn handle_list_capabilities(ctx: DispatchCtx,_params: Map<String, Value>,) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(ops::composio_list_capabilities(&config).await?)})@@ -36,7 +36,7 @@ pub(super) fn handle_list_agent_ready_toolkits(ctx: DispatchCtx,_params: Map<String, Value>,) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(ops::composio_list_agent_ready_toolkits(&config).await?)})@@ -46,7 +46,7 @@ pub(super) fn handle_list_connections(ctx: DispatchCtx,_params: Map<String, Value>,) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(ops::composio_list_connections(&config).await?)})diff --git a/crates/openhuman-core/src/integrations/task_sources/schemas.rs b/crates/openhuman-core/src/integrations/task_sources/schemas.rsindex 0ba638f635..a1cffe525f 100644--- a/crates/openhuman-core/src/integrations/task_sources/schemas.rs+++ b/crates/openhuman-core/src/integrations/task_sources/schemas.rs@@ -408,7 +408,7 @@ pub fn schemas(function: &str) -> ControllerSchema {}fn handle_list(ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(ops::list(&config).await?)})@@ -516,7 +516,7 @@ fn handle_list_databases(ctx: DispatchCtx, params: Map<String, Value>) -> Contro}fn handle_status(ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {let config = ctx.load_config().await?;to_json(ops::status(&config).await?)})diff --git a/crates/openhuman-core/src/sandbox/schemas.rs b/crates/openhuman-core/src/sandbox/schemas.rsindex 3366c01082..ab82bed476 100644--- a/crates/openhuman-core/src/sandbox/schemas.rs+++ b/crates/openhuman-core/src/sandbox/schemas.rs@@ -285,7 +285,7 @@ fn handle_resolve_policy(ctx: DispatchCtx, params: Map<String, Value>) -> Contro}fn handle_cleanup_orphans(ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {+ Box::pin(async move {gate()?;let config = match ctx.load_config().await {Ok(config) => config,