Skip to content

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

chore: apply rustfmt formatting across core, rpc, and tinyhumans crates

Steven Enamakela433bae5cf2f
diff --git a/crates/openhuman-core/src/agent/orchestration/command_center/schemas_tests.rs b/crates/openhuman-core/src/agent/orchestration/command_center/schemas_tests.rs
index 798debc8a4..d126a26f92 100644
--- a/crates/openhuman-core/src/agent/orchestration/command_center/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/command_center/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn registered_controllers_match_schemas() {
@@ -59,24 +59,38 @@ fn params(value: Value) -> Map<String, Value> {
#[tokio::test]
async fn listing_work_on_an_empty_ledger_answers() {
- let v = with_scratch_workspace(|| handle_agent_work_list(DispatchCtx::process_default(), params(serde_json::json!({ "limit": 5 }))))
- .await
- .expect("an empty ledger lists as an empty view");
+ let v = with_scratch_workspace(|| {
+ handle_agent_work_list(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({ "limit": 5 })),
+ )
+ })
+ .await
+ .expect("an empty ledger lists as an empty view");
assert_eq!(v["total"], 0, "{v}");
assert!(
- v["groups"].as_array().unwrap().iter().all(|g| g["rows"] == serde_json::json!([])),
+ v["groups"]
+ .as_array()
+ .unwrap()
+ .iter()
+ .all(|g| g["rows"] == serde_json::json!([])),
"{v}"
);
}
#[tokio::test]
async fn control_requires_a_run_id_and_action() {
- let err = with_scratch_workspace(|| handle_agent_work_control(DispatchCtx::process_default(), Map::new()))
- .await
- .unwrap_err();
+ let err = with_scratch_workspace(|| {
+ handle_agent_work_control(DispatchCtx::process_default(), Map::new())
+ })
+ .await
+ .unwrap_err();
assert_eq!(err, "missing required param: runId");
let err = with_scratch_workspace(|| {
- handle_agent_work_control(DispatchCtx::process_default(), params(serde_json::json!({ "runId": "r1" })))
+ handle_agent_work_control(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({ "runId": "r1" })),
+ )
})
.await
.unwrap_err();
@@ -86,9 +100,10 @@ async fn control_requires_a_run_id_and_action() {
#[tokio::test]
async fn control_refuses_an_unknown_action() {
let err = with_scratch_workspace(|| {
- handle_agent_work_control(DispatchCtx::process_default(), params(
- serde_json::json!({ "runId": "r1", "action": "explode" }),
- ))
+ handle_agent_work_control(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({ "runId": "r1", "action": "explode" })),
+ )
})
.await
.unwrap_err();
@@ -98,9 +113,12 @@ async fn control_refuses_an_unknown_action() {
#[tokio::test]
async fn control_of_an_unknown_run_is_an_error_not_a_panic() {
let err = with_scratch_workspace(|| {
- handle_agent_work_control(DispatchCtx::process_default(), params(
- serde_json::json!({ "runId": "no-such-run", "action": "stop", "reason": "test" }),
- ))
+ handle_agent_work_control(
+ DispatchCtx::process_default(),
+ params(
+ serde_json::json!({ "runId": "no-such-run", "action": "stop", "reason": "test" }),
+ ),
+ )
})
.await
.unwrap_err();
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
index 80e2f81380..fd17f341fe 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tenant_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet, Mode};
use crate::tools::toolpacks::ToolGroups;
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
index 7b8b2d464b..4779fe5fec 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn registered_controllers_match_schemas() {
@@ -31,7 +31,9 @@ async fn cancel_unknown_task_is_a_noop_false() {
let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let mut params = Map::new();
params.insert("taskId".into(), json!("sub-does-not-exist"));
- let out = handle_subagent_cancel(DispatchCtx::process_default(), params).await.expect("handler ok");
+ let out = handle_subagent_cancel(DispatchCtx::process_default(), params)
+ .await
+ .expect("handler ok");
// Outcome wraps the payload under `data`.
let cancelled = out
.get("data")
@@ -126,7 +128,9 @@ async fn cancel_of_a_finished_run_reports_its_outcome_and_rewrites_nothing() {
let mut params = Map::new();
params.insert("taskId".into(), json!(task_id));
- let out = handle_subagent_cancel(DispatchCtx::process_default(), params).await.expect("handler ok");
+ let out = handle_subagent_cancel(DispatchCtx::process_default(), params)
+ .await
+ .expect("handler ok");
assert_eq!(field(&out, "cancelled"), Some(json!(false)), "{task_id}");
assert_eq!(field(&out, "outcome"), Some(json!(outcome)), "{task_id}");
}
@@ -143,7 +147,9 @@ async fn steer_unknown_task_is_a_noop_false() {
let mut params = Map::new();
params.insert("taskId".into(), json!("sub-does-not-exist"));
params.insert("message".into(), json!("redirect"));
- let out = handle_subagent_steer(DispatchCtx::process_default(), params).await.expect("handler ok");
+ let out = handle_subagent_steer(DispatchCtx::process_default(), params)
+ .await
+ .expect("handler ok");
let data = out.get("data").unwrap_or(&out);
assert_eq!(data.get("steered").and_then(Value::as_bool), Some(false));
assert_eq!(data.get("reason").and_then(Value::as_str), Some("unknown"));
diff --git a/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs b/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
index 9529093c94..d52bd017ec 100644
--- a/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use std::process::Command;
use tinyagents_harness::workspace::{create_git_worktree, GitWorktreeBaseRef, GitWorktreeStatus};
diff --git a/crates/openhuman-core/src/agent/schemas_tests.rs b/crates/openhuman-core/src/agent/schemas_tests.rs
index cc6daacc75..7f4b7ca17d 100644
--- a/crates/openhuman-core/src/agent/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use crate::core::TypeSchema;
use serde_json::json;
@@ -143,10 +143,13 @@ async fn reload_and_definition_handlers_cover_missing_registry_paths() {
Err(err) => assert!(err.contains("AgentDefinitionRegistry not initialised")),
}
- let get_err = handle_get_definition(DispatchCtx::process_default(), Map::from_iter([(
- "id".into(),
- Value::String("__definitely_missing_definition__".into()),
- )]))
+ let get_err = handle_get_definition(
+ DispatchCtx::process_default(),
+ Map::from_iter([(
+ "id".into(),
+ Value::String("__definitely_missing_definition__".into()),
+ )]),
+ )
.await
.expect_err("missing or unknown definition should error");
assert!(
@@ -157,11 +160,14 @@ async fn reload_and_definition_handlers_cover_missing_registry_paths() {
#[tokio::test]
async fn triage_handler_rejects_unknown_source_and_to_json_maps_outcome() {
- let err = handle_triage_evaluate(DispatchCtx::process_default(), Map::from_iter([
- ("source".into(), Value::String("__unknown_source__".into())),
- ("display_label".into(), Value::String("lbl".into())),
- ("payload".into(), json!({})),
- ]))
+ let err = handle_triage_evaluate(
+ DispatchCtx::process_default(),
+ Map::from_iter([
+ ("source".into(), Value::String("__unknown_source__".into())),
+ ("display_label".into(), Value::String("lbl".into())),
+ ("payload".into(), json!({})),
+ ]),
+ )
.await
.expect_err("unsupported source should fail before runtime dispatch");
assert!(err.contains("unsupported trigger source"));
diff --git a/crates/openhuman-core/src/agent/session_db/schemas_tests.rs b/crates/openhuman-core/src/agent/session_db/schemas_tests.rs
index df14a1c1d9..6204a3ed35 100644
--- a/crates/openhuman-core/src/agent/session_db/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/session_db/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn all_controller_schemas_lists_registered_functions() {
@@ -103,9 +103,11 @@ fn params(value: Value) -> Map<String, Value> {
#[tokio::test]
async fn listing_an_empty_ledger_returns_no_runs() {
- let value = with_scratch_workspace(|| handle_run_ledger_list(DispatchCtx::process_default(), Map::new()))
- .await
- .expect("list answers on an empty ledger");
+ let value = with_scratch_workspace(|| {
+ handle_run_ledger_list(DispatchCtx::process_default(), Map::new())
+ })
+ .await
+ .expect("list answers on an empty ledger");
let text = value.to_string();
assert_eq!(value["runs"], serde_json::json!([]), "{text}");
assert_eq!(value["count"], 0, "{text}");
@@ -114,7 +116,10 @@ async fn listing_an_empty_ledger_returns_no_runs() {
#[tokio::test]
async fn listing_rejects_malformed_params() {
let err = with_scratch_workspace(|| {
- handle_run_ledger_list(DispatchCtx::process_default(), params(serde_json::json!({ "limit": "many" })))
+ handle_run_ledger_list(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({ "limit": "many" })),
+ )
})
.await
.expect_err("a non-numeric limit is refused");
@@ -124,7 +129,10 @@ async fn listing_rejects_malformed_params() {
#[tokio::test]
async fn getting_an_unknown_run_answers_null() {
let value = with_scratch_workspace(|| {
- handle_run_ledger_get(DispatchCtx::process_default(), params(serde_json::json!({ "id": "no-such-run" })))
+ handle_run_ledger_get(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({ "id": "no-such-run" })),
+ )
})
.await
.expect("get answers for an unknown id");
@@ -133,16 +141,21 @@ async fn getting_an_unknown_run_answers_null() {
#[tokio::test]
async fn getting_a_run_requires_an_id() {
- let err = with_scratch_workspace(|| handle_run_ledger_get(DispatchCtx::process_default(), Map::new()))
- .await
- .expect_err("id is required");
+ let err = with_scratch_workspace(|| {
+ handle_run_ledger_get(DispatchCtx::process_default(), Map::new())
+ })
+ .await
+ .expect_err("id is required");
assert!(err.contains("missing required param: id"), "{err}");
}
#[tokio::test]
async fn events_of_an_unknown_run_are_empty() {
let value = with_scratch_workspace(|| {
- handle_run_ledger_events(DispatchCtx::process_default(), params(serde_json::json!({ "runId": "no-such-run" })))
+ handle_run_ledger_events(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({ "runId": "no-such-run" })),
+ )
})
.await
.expect("events answer for an unknown run");
@@ -152,8 +165,10 @@ async fn events_of_an_unknown_run_are_empty() {
#[tokio::test]
async fn events_reject_malformed_params() {
- let err = with_scratch_workspace(|| handle_run_ledger_events(DispatchCtx::process_default(), Map::new()))
- .await
- .expect_err("runId is required");
+ let err = with_scratch_workspace(|| {
+ handle_run_ledger_events(DispatchCtx::process_default(), Map::new())
+ })
+ .await
+ .expect_err("runId is required");
assert!(err.contains("invalid run ledger events params"), "{err}");
}
diff --git a/crates/openhuman-core/src/agent/session_import/schemas_tests.rs b/crates/openhuman-core/src/agent/session_import/schemas_tests.rs
index 1b051b77a6..704f4a2993 100644
--- a/crates/openhuman-core/src/agent/session_import/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/session_import/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn controller_schema_inventory_is_stable() {
@@ -23,7 +23,9 @@ async fn handler_runs_dry_against_explicit_workspace() {
Value::String(tmp.path().to_string_lossy().to_string()),
);
- let result = handle_session_import_run(DispatchCtx::process_default(), params).await.expect("handler ok");
+ let result = handle_session_import_run(DispatchCtx::process_default(), params)
+ .await
+ .expect("handler ok");
assert_eq!(result["dry_run"], Value::Bool(true));
assert_eq!(result["sources"]["sessions_db"], Value::Bool(false));
assert_eq!(result["imports"], json!([]));
@@ -40,7 +42,9 @@ async fn dry_run_reports_the_legacy_sources_a_workspace_holds() {
Value::String(tmp.path().to_string_lossy().to_string()),
);
- let result = handle_session_import_run(DispatchCtx::process_default(), params).await.expect("handler ok");
+ let result = handle_session_import_run(DispatchCtx::process_default(), params)
+ .await
+ .expect("handler ok");
assert_eq!(result["sources"]["session_raw"], Value::Bool(true));
assert_eq!(result["sources"]["turn_states"], Value::Bool(false));
}
@@ -49,7 +53,9 @@ async fn dry_run_reports_the_legacy_sources_a_workspace_holds() {
async fn handler_rejects_invalid_params() {
let mut params = Map::new();
params.insert("dry_run".into(), Value::String("yes".into())); // wrong type
- let err = handle_session_import_run(DispatchCtx::process_default(), params).await.unwrap_err();
+ let err = handle_session_import_run(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err();
assert!(err.contains("invalid params"), "{err}");
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/replay/schemas_tests.rs b/crates/openhuman-core/src/agent/tinyagents/replay/schemas_tests.rs
index 6d92b925c2..d96fdd6bd1 100644
--- a/crates/openhuman-core/src/agent/tinyagents/replay/schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/replay/schemas_tests.rs
@@ -1,8 +1,10 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[tokio::test]
async fn run_events_rejects_missing_run_id() {
- let err = handle_run_events(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_run_events(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(err.contains("invalid params"), "{err}");
}
diff --git a/crates/openhuman-core/src/channels/controllers/schemas.rs b/crates/openhuman-core/src/channels/controllers/schemas.rs
index 24362618fa..6bcc7a2c78 100644
--- a/crates/openhuman-core/src/channels/controllers/schemas.rs
+++ b/crates/openhuman-core/src/channels/controllers/schemas.rs
@@ -353,7 +353,10 @@ fn handle_discord_list_channels(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-fn handle_discord_check_permissions(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_discord_check_permissions(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<DiscordCheckPermissionsParams>(params)?;
diff --git a/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs b/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs
index 5757dd1f5e..555179bc7b 100644
--- a/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs
+++ b/crates/openhuman-core/src/channels/providers/relay/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn the_controller_is_channel_relay_inbound() {
diff --git a/crates/openhuman-core/src/commands/ops_tests.rs b/crates/openhuman-core/src/commands/ops_tests.rs
index 6723dbd107..d43591bc86 100644
--- a/crates/openhuman-core/src/commands/ops_tests.rs
+++ b/crates/openhuman-core/src/commands/ops_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use serde_json::json;
#[test]
@@ -65,7 +65,9 @@ async fn commands_list_always_includes_every_builtin_even_if_catalogs_fail() {
// end (no config override) — the important assertion is that whatever
// they do, every builtin is still present and the call itself never
// errors.
- let outcome = commands_list(&DispatchCtx::process_default()).await.expect("commands_list must not fail");
+ let outcome = commands_list(&DispatchCtx::process_default())
+ .await
+ .expect("commands_list must not fail");
let ids: Vec<&str> = outcome
.value
.commands
diff --git a/crates/openhuman-core/src/commands/schemas_tests.rs b/crates/openhuman-core/src/commands/schemas_tests.rs
index 890ab4956c..a345f5d06e 100644
--- a/crates/openhuman-core/src/commands/schemas_tests.rs
+++ b/crates/openhuman-core/src/commands/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn controller_schema_inventory_is_stable() {
diff --git a/crates/openhuman-core/src/config/schemas/controllers/agent.rs b/crates/openhuman-core/src/config/schemas/controllers/agent.rs
index d51857a46a..fa96ab7ef6 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/agent.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/agent.rs
@@ -12,11 +12,17 @@ use super::super::helpers::{
SetBrowserAllowAllParams,
};
-pub(crate) fn handle_get_autonomy_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_get_autonomy_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move { to_json(config_rpc::get_autonomy_settings().await?) })
}
-pub(crate) fn handle_update_autonomy_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_update_autonomy_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<AutonomySettingsUpdate>(params)?;
let patch = config_rpc::AutonomySettingsPatch {
@@ -35,11 +41,17 @@ pub(crate) fn handle_update_autonomy_settings(_ctx: DispatchCtx, params: Map<Str
})
}
-pub(super) fn handle_get_privacy_mode(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_privacy_mode(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move { to_json(config_rpc::get_privacy_mode().await?) })
}
-pub(super) fn handle_set_privacy_mode(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_set_privacy_mode(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<PrivacyModeUpdate>(params)?;
let patch = config_rpc::PrivacySettingsPatch { mode: update.mode };
@@ -47,7 +59,10 @@ pub(super) fn handle_set_privacy_mode(_ctx: DispatchCtx, params: Map<String, Val
})
}
-pub(super) fn handle_get_agent_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_agent_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
log::debug!("[config][rpc] get_agent_settings enter");
match config_rpc::get_agent_settings().await {
@@ -63,7 +78,10 @@ pub(super) fn handle_get_agent_settings(_ctx: DispatchCtx, _params: Map<String,
})
}
-pub(super) fn handle_update_agent_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_agent_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
log::debug!("[config][rpc] update_agent_settings enter");
let update = match deserialize_params::<AgentSettingsUpdate>(params) {
@@ -91,7 +109,10 @@ pub(super) fn handle_update_agent_settings(_ctx: DispatchCtx, params: Map<String
})
}
-pub(super) fn handle_update_browser_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_browser_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<BrowserSettingsUpdate>(params)?;
let patch = config_rpc::BrowserSettingsPatch {
@@ -112,7 +133,10 @@ pub(super) fn handle_update_browser_settings(_ctx: DispatchCtx, params: Map<Stri
})
}
-pub(super) fn handle_update_computer_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_computer_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<ComputerSettingsUpdate>(params)?;
let patch = config_rpc::ComputerSettingsPatch {
@@ -126,18 +150,27 @@ pub(super) fn handle_update_computer_settings(_ctx: DispatchCtx, params: Map<Str
})
}
-pub(super) fn handle_set_browser_allow_all(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_set_browser_allow_all(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<SetBrowserAllowAllParams>(params)?;
to_json(config_rpc::set_browser_allow_all(payload.enabled)?)
})
}
-pub(super) fn handle_get_sandbox_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_sandbox_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move { to_json(config_rpc::get_sandbox_settings().await?) })
}
-pub(super) fn handle_update_sandbox_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_sandbox_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<SandboxSettingsUpdate>(params)?;
let patch = config_rpc::SandboxSettingsPatch {
diff --git a/crates/openhuman-core/src/config/schemas/controllers/inference.rs b/crates/openhuman-core/src/config/schemas/controllers/inference.rs
index 2df27e41ac..8521ff62fd 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/inference.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/inference.rs
@@ -11,11 +11,17 @@ use super::super::helpers::{
RuntimeSettingsUpdate,
};
-pub(super) fn handle_get_config(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_config(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::load_and_get_config_snapshot().await?) })
}
-pub(super) fn handle_get_client_config(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_client_config(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
log::debug!("[config][rpc] get_client_config enter");
match config_rpc::load_and_get_client_config_snapshot().await {
@@ -28,7 +34,10 @@ pub(super) fn handle_get_client_config(_ctx: DispatchCtx, _params: Map<String, V
})
}
-pub(super) fn handle_update_model_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_model_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<ModelSettingsUpdate>(params)?;
let cloud_provider_ca_certs = update
@@ -168,7 +177,10 @@ pub(super) fn handle_update_model_settings(_ctx: DispatchCtx, params: Map<String
})
}
-pub(super) fn handle_update_memory_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_memory_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<MemorySettingsUpdate>(params)?;
let patch = config_rpc::MemorySettingsPatch {
@@ -180,7 +192,10 @@ pub(super) fn handle_update_memory_settings(_ctx: DispatchCtx, params: Map<Strin
})
}
-pub(super) fn handle_update_runtime_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_runtime_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<RuntimeSettingsUpdate>(params)?;
let patch = config_rpc::RuntimeSettingsPatch {
@@ -193,7 +208,10 @@ pub(super) fn handle_update_runtime_settings(_ctx: DispatchCtx, params: Map<Stri
})
}
-pub(super) fn handle_update_local_ai_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_local_ai_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<LocalAiSettingsUpdate>(params)?;
let base_url = match update.base_url {
@@ -216,10 +234,16 @@ pub(super) fn handle_update_local_ai_settings(_ctx: DispatchCtx, params: Map<Str
})
}
-pub(super) fn handle_resolve_api_url(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_resolve_api_url(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::load_and_resolve_api_url().await?) })
}
-pub(super) fn handle_get_runtime_flags(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_runtime_flags(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::get_runtime_flags()) })
}
diff --git a/crates/openhuman-core/src/config/schemas/controllers/integrations.rs b/crates/openhuman-core/src/config/schemas/controllers/integrations.rs
index ac760f1d49..6ca50df047 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/integrations.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/integrations.rs
@@ -8,7 +8,10 @@ use crate::core::all::ControllerFuture;
use super::super::helpers::{deserialize_params, to_json, ComposioTriggerSettingsUpdate};
-pub(super) fn handle_update_search_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_search_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
log::debug!("[config][rpc] update_search_settings enter");
let patch = match deserialize_params::<config_rpc::SearchSettingsPatch>(params) {
@@ -31,7 +34,10 @@ pub(super) fn handle_update_search_settings(_ctx: DispatchCtx, params: Map<Strin
})
}
-pub(super) fn handle_get_search_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_search_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
log::debug!("[config][rpc] get_search_settings enter");
match config_rpc::get_search_settings().await {
@@ -47,7 +53,8 @@ pub(super) fn handle_get_search_settings(_ctx: DispatchCtx, _params: Map<String,
})
}
-pub(super) fn handle_update_composio_trigger_settings(_ctx: DispatchCtx,
+pub(super) fn handle_update_composio_trigger_settings(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -76,7 +83,8 @@ pub(super) fn handle_update_composio_trigger_settings(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_get_composio_trigger_settings(_ctx: DispatchCtx,
+pub(super) fn handle_get_composio_trigger_settings(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async {
diff --git a/crates/openhuman-core/src/config/schemas/controllers/voice.rs b/crates/openhuman-core/src/config/schemas/controllers/voice.rs
index 7434887a49..4dddde119b 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/voice.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/voice.rs
@@ -10,11 +10,17 @@ use super::super::helpers::{
deserialize_params, to_json, DictationSettingsUpdate, VoiceServerSettingsUpdate,
};
-pub(super) fn handle_get_dictation_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_dictation_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::get_dictation_settings().await?) })
}
-pub(super) fn handle_update_dictation_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_dictation_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<DictationSettingsUpdate>(params)?;
let patch = config_rpc::DictationSettingsPatch {
@@ -29,11 +35,17 @@ pub(super) fn handle_update_dictation_settings(_ctx: DispatchCtx, params: Map<St
})
}
-pub(super) fn handle_get_voice_server_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_voice_server_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::get_voice_server_settings().await?) })
}
-pub(super) fn handle_update_voice_server_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_voice_server_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<VoiceServerSettingsUpdate>(params)?;
let patch = config_rpc::VoiceServerSettingsPatch {
diff --git a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs
index 26d470d4f9..c04b46d7f1 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs
@@ -12,7 +12,8 @@ use super::super::helpers::{
WorkspaceOnboardingFlagSetParams, DEFAULT_ONBOARDING_FLAG_NAME,
};
-pub(super) fn handle_workspace_onboarding_flag_exists(_ctx: DispatchCtx,
+pub(super) fn handle_workspace_onboarding_flag_exists(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -27,7 +28,10 @@ pub(super) fn handle_workspace_onboarding_flag_exists(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_workspace_onboarding_flag_set(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_workspace_onboarding_flag_set(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkspaceOnboardingFlagSetParams>(params)?;
to_json(
@@ -41,7 +45,10 @@ pub(super) fn handle_workspace_onboarding_flag_set(_ctx: DispatchCtx, params: Ma
})
}
-pub(super) fn handle_update_analytics_settings(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_analytics_settings(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<AnalyticsSettingsUpdate>(params)?;
let patch = config_rpc::AnalyticsSettingsPatch {
@@ -51,14 +58,20 @@ pub(super) fn handle_update_analytics_settings(_ctx: DispatchCtx, params: Map<St
})
}
-pub(super) fn handle_update_user_timezone(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_user_timezone(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let update = deserialize_params::<UserTimezoneUpdate>(params)?;
to_json(config_rpc::load_and_apply_user_timezone(update.timezone).await?)
})
}
-pub(super) fn handle_get_user_timezone(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_user_timezone(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::core::Outcome::single_log(
@@ -68,7 +81,10 @@ pub(super) fn handle_get_user_timezone(_ctx: DispatchCtx, _params: Map<String, V
})
}
-pub(super) fn handle_get_analytics_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_analytics_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
use crate::core::Outcome;
let config = config_rpc::load_config_with_timeout().await?;
@@ -82,19 +98,31 @@ pub(super) fn handle_get_analytics_settings(_ctx: DispatchCtx, _params: Map<Stri
})
}
-pub(super) fn handle_get_dashboard_settings(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_dashboard_settings(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::get_dashboard_settings().await?) })
}
-pub(super) fn handle_agent_server_status(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_agent_server_status(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::agent_server_status()) })
}
-pub(super) fn handle_reset_local_data(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_reset_local_data(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::reset_local_data().await?) })
}
-pub(crate) fn handle_get_data_paths(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_get_data_paths(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
log::debug!("[config][rpc] get_data_paths enter");
match resolve_data_paths(params).await {
@@ -135,7 +163,10 @@ async fn resolve_data_paths(
}
}
-pub(crate) fn handle_get_agent_paths(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_get_agent_paths(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
log::debug!("[config][rpc] get_agent_paths enter");
match config_rpc::get_agent_paths().await {
@@ -151,7 +182,10 @@ pub(crate) fn handle_get_agent_paths(_ctx: DispatchCtx, _params: Map<String, Val
})
}
-pub(super) fn handle_update_agent_paths(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_agent_paths(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
log::debug!("[config][rpc] update_agent_paths enter");
let update = match deserialize_params::<AgentPathsUpdate>(params) {
@@ -178,11 +212,17 @@ pub(super) fn handle_update_agent_paths(_ctx: DispatchCtx, params: Map<String, V
})
}
-pub(super) fn handle_get_onboarding_completed(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_onboarding_completed(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async { to_json(config_rpc::get_onboarding_completed().await?) })
}
-pub(super) fn handle_set_onboarding_completed(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_set_onboarding_completed(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<OnboardingCompletedSetParams>(params)?;
to_json(config_rpc::set_onboarding_completed(payload.value).await?)
diff --git a/crates/openhuman-core/src/config/schemas/controllers_tests.rs b/crates/openhuman-core/src/config/schemas/controllers_tests.rs
index 5abb0facbd..69f68d9ec9 100644
--- a/crates/openhuman-core/src/config/schemas/controllers_tests.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
// ── get_data_paths user scoping (#4950) ─────────────────────
@@ -15,7 +15,9 @@ async fn handle_get_data_paths_scopes_to_explicit_user_id() {
Value::String("clear-me-4950".to_string()),
);
- let value = handle_get_data_paths(DispatchCtx::process_default(), params).await.unwrap();
+ let value = handle_get_data_paths(DispatchCtx::process_default(), params)
+ .await
+ .unwrap();
// `get_data_paths_for_user` attaches a log, so the outcome is wrapped as
// `{ "result": <paths>, "logs": [...] }`.
let current = value
diff --git a/crates/openhuman-core/src/config/schemas_tests.rs b/crates/openhuman-core/src/config/schemas_tests.rs
index 3d1e5fc68e..fd0618c6bf 100644
--- a/crates/openhuman-core/src/config/schemas_tests.rs
+++ b/crates/openhuman-core/src/config/schemas_tests.rs
@@ -1,6 +1,6 @@
-use crate::core::runtime::DispatchCtx;
use super::schema_defs::schemas;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn all_schemas_use_config_namespace_and_have_descriptions() {
@@ -307,9 +307,10 @@ async fn handle_get_autonomy_settings_returns_current_value() {
.await
.expect("seed");
- let out = super::handle_get_autonomy_settings(DispatchCtx::process_default(), serde_json::Map::new())
- .await
- .expect("handler");
+ let out =
+ super::handle_get_autonomy_settings(DispatchCtx::process_default(), serde_json::Map::new())
+ .await
+ .expect("handler");
// into_cli_compatible_json wraps data under "result" when logs are present.
let inner = out.get("result").unwrap_or(&out);
let value = inner.get("max_actions_per_hour").and_then(|v| v.as_u64());
diff --git a/crates/openhuman-core/src/core/all_extensions_tests.rs b/crates/openhuman-core/src/core/all_extensions_tests.rs
index 7c05976181..257becf6e5 100644
--- a/crates/openhuman-core/src/core/all_extensions_tests.rs
+++ b/crates/openhuman-core/src/core/all_extensions_tests.rs
@@ -39,10 +39,14 @@ async fn registry_extension_is_visible_to_every_lookup_and_dispatches() {
Some("Registry extension probe.")
);
- let result = try_invoke_registered_rpc(DispatchCtx::ambient(), "openhuman.ext_probe_ping", Map::new())
- .await
- .expect("extension method is dispatchable")
- .expect("handler succeeds");
+ let result = try_invoke_registered_rpc(
+ DispatchCtx::ambient(),
+ "openhuman.ext_probe_ping",
+ Map::new(),
+ )
+ .await
+ .expect("extension method is dispatchable")
+ .expect("handler succeeds");
assert_eq!(result, serde_json::json!({"ext": true}));
}
@@ -97,9 +101,13 @@ async fn registry_extension_is_gated_by_its_domain_group() {
let ctx = CoreContext::for_test(domains, None);
let hidden = CoreContext::scope(ctx, async {
(
- try_invoke_registered_rpc(DispatchCtx::ambient(), "openhuman.ext_gate_ping", Map::new())
- .await
- .is_none(),
+ try_invoke_registered_rpc(
+ DispatchCtx::ambient(),
+ "openhuman.ext_gate_ping",
+ Map::new(),
+ )
+ .await
+ .is_none(),
schema_for_rpc_method("openhuman.ext_gate_ping").is_none(),
)
})
diff --git a/crates/openhuman-core/src/core/all_tests.rs b/crates/openhuman-core/src/core/all_tests.rs
index 5f960be4f8..7feae8a338 100644
--- a/crates/openhuman-core/src/core/all_tests.rs
+++ b/crates/openhuman-core/src/core/all_tests.rs
@@ -800,7 +800,12 @@ fn validate_registry_rejects_duplicate_registered_controllers() {
#[tokio::test]
async fn try_invoke_registered_rpc_returns_none_for_unknown_method() {
- let out = try_invoke_registered_rpc(DispatchCtx::ambient(), "openhuman.not_a_real_method_xyz_123", Map::new()).await;
+ let out = try_invoke_registered_rpc(
+ DispatchCtx::ambient(),
+ "openhuman.not_a_real_method_xyz_123",
+ Map::new(),
+ )
+ .await;
assert!(out.is_none(), "unknown methods must return None");
}
@@ -808,7 +813,12 @@ async fn try_invoke_registered_rpc_returns_none_for_unknown_method() {
async fn try_invoke_registered_rpc_returns_some_for_known_method() {
// `openhuman.health_snapshot` is registered at startup and takes no
// required params — it must route and produce Some(_).
- let out = try_invoke_registered_rpc(DispatchCtx::ambient(), "openhuman.health_snapshot", Map::new()).await;
+ let out = try_invoke_registered_rpc(
+ DispatchCtx::ambient(),
+ "openhuman.health_snapshot",
+ Map::new(),
+ )
+ .await;
assert!(out.is_some(), "known method must route");
}
@@ -822,7 +832,11 @@ async fn try_invoke_registered_rpc_routes_security_policy_info() {
let ctx = CoreContext::for_test_with_config(DomainSet::full(), config);
let out = CoreContext::scope(
ctx,
- try_invoke_registered_rpc(DispatchCtx::ambient(), "openhuman.security_policy_info", Map::new()),
+ try_invoke_registered_rpc(
+ DispatchCtx::ambient(),
+ "openhuman.security_policy_info",
+ Map::new(),
+ ),
)
.await
.expect("security policy info should be registered")
@@ -967,7 +981,11 @@ async fn dispatch_returns_none_for_gated_method() {
.expect("a flows.* method exists in the full registry");
let ctx = CoreContext::for_test(DomainSet::harness(), None);
- let out = CoreContext::scope(ctx, try_invoke_registered_rpc(DispatchCtx::ambient(), &gated_method, Map::new())).await;
+ let out = CoreContext::scope(
+ ctx,
+ try_invoke_registered_rpc(DispatchCtx::ambient(), &gated_method, Map::new()),
+ )
+ .await;
assert!(
out.is_none(),
"gated method `{gated_method}` must dispatch as None under harness()"
@@ -978,7 +996,11 @@ async fn dispatch_returns_none_for_gated_method() {
let ctx = CoreContext::for_test(DomainSet::harness(), None);
let out = CoreContext::scope(
ctx,
- try_invoke_registered_rpc(DispatchCtx::ambient(), "openhuman.security_policy_info", Map::new()),
+ try_invoke_registered_rpc(
+ DispatchCtx::ambient(),
+ "openhuman.security_policy_info",
+ Map::new(),
+ ),
)
.await;
assert!(
diff --git a/crates/openhuman-core/src/core/cli.rs b/crates/openhuman-core/src/core/cli.rs
index 43e7a72fb8..23a3045356 100644
--- a/crates/openhuman-core/src/core/cli.rs
+++ b/crates/openhuman-core/src/core/cli.rs
@@ -415,7 +415,15 @@ fn run_call_command(args: &[String]) -> Result<()> {
.max_blocking_threads(crate::core::runtime::MAX_BLOCKING_THREADS)
.build()?;
let value = rt
- .block_on(async { invoke_method(DispatchCtx::process_default(), default_state(), &method, params).await })
+ .block_on(async {
+ invoke_method(
+ DispatchCtx::process_default(),
+ default_state(),
+ &method,
+ params,
+ )
+ .await
+ })
.map_err(anyhow::Error::msg)?;
// Output the result as pretty-printed JSON to stdout.
@@ -478,7 +486,15 @@ fn run_namespace_command(
.max_blocking_threads(crate::core::runtime::MAX_BLOCKING_THREADS)
.build()?;
let value = rt
- .block_on(async { invoke_method(DispatchCtx::process_default(), default_state(), &method, Value::Object(params)).await })
+ .block_on(async {
+ invoke_method(
+ DispatchCtx::process_default(),
+ default_state(),
+ &method,
+ Value::Object(params),
+ )
+ .await
+ })
.map_err(anyhow::Error::msg)?;
println!("{}", serde_json::to_string_pretty(&value)?);
diff --git a/crates/openhuman-core/src/core/dispatch.rs b/crates/openhuman-core/src/core/dispatch.rs
index 0c4d1f328a..02dc9b2381 100644
--- a/crates/openhuman-core/src/core/dispatch.rs
+++ b/crates/openhuman-core/src/core/dispatch.rs
@@ -3,9 +3,9 @@
//! This module coordinates the routing of incoming requests to either the
//! core subsystem or the OpenHuman domain-specific handlers.
-use crate::core::runtime::DispatchCtx;
use crate::core::legacy_aliases::resolve_legacy;
use crate::core::rpc_log;
+use crate::core::runtime::DispatchCtx;
use crate::core::types::{AppState, InvocationResult};
use serde_json::{json, Map, Value};
diff --git a/crates/openhuman-core/src/core/dispatch_tests.rs b/crates/openhuman-core/src/core/dispatch_tests.rs
index e16d125e65..0f6324b71c 100644
--- a/crates/openhuman-core/src/core/dispatch_tests.rs
+++ b/crates/openhuman-core/src/core/dispatch_tests.rs
@@ -1,6 +1,6 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
use crate::config::test_env::EnvVarGuard;
+use crate::core::runtime::DispatchCtx;
use serde_json::json;
fn test_state() -> AppState {
@@ -11,26 +11,41 @@ fn test_state() -> AppState {
#[tokio::test]
async fn dispatch_core_ping_returns_ok_true() {
- let out = dispatch(DispatchCtx::process_default(), test_state(), "core.ping", json!({}))
- .await
- .expect("core.ping should succeed");
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "core.ping",
+ json!({}),
+ )
+ .await
+ .expect("core.ping should succeed");
assert_eq!(out, json!({ "ok": true }));
}
#[tokio::test]
async fn dispatch_core_version_returns_state_version() {
- let out = dispatch(DispatchCtx::process_default(), test_state(), "core.version", json!({}))
- .await
- .expect("core.version should succeed");
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "core.version",
+ json!({}),
+ )
+ .await
+ .expect("core.version should succeed");
assert_eq!(out, json!({ "version": "9.9.9-test" }));
}
#[tokio::test]
async fn dispatch_core_ignores_params() {
// Params must be tolerated even when the method takes none.
- let out = dispatch(DispatchCtx::process_default(), test_state(), "core.ping", json!({ "extra": 1 }))
- .await
- .expect("core.ping should ignore extra params");
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "core.ping",
+ json!({ "extra": 1 }),
+ )
+ .await
+ .expect("core.ping should ignore extra params");
assert_eq!(out, json!({ "ok": true }));
}
@@ -40,17 +55,27 @@ async fn dispatch_rewrites_legacy_alias_before_lookup() {
// alias table. Going through the dispatcher must rewrite it and
// route successfully to Tier 1 instead of falling through to the
// unknown-method error path.
- let out = dispatch(DispatchCtx::process_default(), test_state(), "openhuman.ping", json!({}))
- .await
- .expect("legacy alias openhuman.ping must resolve to core.ping");
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "openhuman.ping",
+ json!({}),
+ )
+ .await
+ .expect("legacy alias openhuman.ping must resolve to core.ping");
assert_eq!(out, json!({ "ok": true }));
}
#[tokio::test]
async fn dispatch_unknown_method_returns_error() {
- let err = dispatch(DispatchCtx::process_default(), test_state(), "does.not.exist", json!({}))
- .await
- .expect_err("unknown methods must error");
+ let err = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "does.not.exist",
+ json!({}),
+ )
+ .await
+ .expect_err("unknown methods must error");
assert!(err.contains("unknown method"));
assert!(err.contains("does.not.exist"));
}
@@ -69,9 +94,14 @@ async fn dispatch_delegates_to_tier2_for_domain_method() {
// it must succeed and return a policy object.
let workspace = tempfile::tempdir().expect("temporary workspace");
let _workspace_env = EnvVarGuard::workspace_async(workspace.path()).await;
- let out = dispatch(DispatchCtx::process_default(), test_state(), "openhuman.security_policy_info", json!({}))
- .await
- .expect("security_policy_info should route via tier 2");
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "openhuman.security_policy_info",
+ json!({}),
+ )
+ .await
+ .expect("security_policy_info should route via tier 2");
// With logs present, payload is wrapped as { result, logs }.
assert!(out.get("result").is_some() || out.get("autonomy").is_some());
}
@@ -107,9 +137,14 @@ fn try_core_dispatch_version_reflects_appstate() {
#[tokio::test]
async fn dispatch_legacy_ping_rewrites_and_succeeds() {
- let out = dispatch(DispatchCtx::process_default(), test_state(), "openhuman.ping", json!({}))
- .await
- .expect("openhuman.ping should be rewritten to core.ping and succeed");
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "openhuman.ping",
+ json!({}),
+ )
+ .await
+ .expect("openhuman.ping should be rewritten to core.ping and succeed");
assert_eq!(out, json!({ "ok": true }));
}
@@ -143,9 +178,14 @@ fn is_known_probe_method_matches_allow_list_exactly() {
#[cfg(feature = "channels")]
async fn dispatch_dotted_channel_list_aliases_route_to_registry() {
for method in ["channels.list", "openhuman.channels.list"] {
- let out = dispatch(DispatchCtx::process_default(), test_state(), method, json!({}))
- .await
- .unwrap_or_else(|err| panic!("{method} should route via channels_list: {err}"));
+ let out = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ method,
+ json!({}),
+ )
+ .await
+ .unwrap_or_else(|err| panic!("{method} should route via channels_list: {err}"));
assert!(
out.is_array() || out.get("result").is_some(),
"expected {method} to return the channels_list payload, got {out}"
@@ -168,9 +208,14 @@ async fn dispatch_probe_method_still_returns_unknown_method_error() {
// Allow-listed probe names must not be silently "handled" — the caller
// still gets a method-not-found error. Only the Sentry severity (in the
// transport layer) changes; the dispatch contract is unchanged.
- let err = dispatch(DispatchCtx::process_default(), test_state(), "rpc.discover", json!({}))
- .await
- .expect_err("probe methods are still unknown to the dispatcher");
+ let err = dispatch(
+ DispatchCtx::process_default(),
+ test_state(),
+ "rpc.discover",
+ json!({}),
+ )
+ .await
+ .expect_err("probe methods are still unknown to the dispatcher");
assert_eq!(unknown_method_name(&err), Some("rpc.discover"));
assert!(is_known_probe_method(
unknown_method_name(&err).expect("unknown-method error")
diff --git a/crates/openhuman-core/src/core/invoke.rs b/crates/openhuman-core/src/core/invoke.rs
index 776da91564..ecf05a9fdc 100644
--- a/crates/openhuman-core/src/core/invoke.rs
+++ b/crates/openhuman-core/src/core/invoke.rs
@@ -116,7 +116,8 @@ async fn invoke_method_inner(
let params_obj = crate::core::params::params_to_object(params.clone())?;
// Validate inputs against the schema before calling the handler.
all::validate_params(&schema, &params_obj)?;
- if let Some(result) = all::try_invoke_registered_rpc(ctx.clone(), method, params_obj).await {
+ if let Some(result) = all::try_invoke_registered_rpc(ctx.clone(), method, params_obj).await
+ {
return result;
}
log::debug!(
diff --git a/crates/openhuman-core/src/core/invoke_tests.rs b/crates/openhuman-core/src/core/invoke_tests.rs
index 0a6214aafa..8e3a09ac10 100644
--- a/crates/openhuman-core/src/core/invoke_tests.rs
+++ b/crates/openhuman-core/src/core/invoke_tests.rs
@@ -8,17 +8,27 @@ use super::{
#[tokio::test]
async fn invoke_health_snapshot_via_registry() {
- let result = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.health_snapshot", json!({}))
- .await
- .expect("health snapshot should succeed");
+ let result = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.health_snapshot",
+ json!({}),
+ )
+ .await
+ .expect("health snapshot should succeed");
assert!(result.get("result").is_some());
}
#[tokio::test]
async fn invoke_encrypt_secret_missing_required_param_fails_validation() {
- let err = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.encrypt_secret", json!({}))
- .await
- .expect_err("missing plaintext should fail");
+ let err = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.encrypt_secret",
+ json!({}),
+ )
+ .await
+ .expect_err("missing plaintext should fail");
assert!(err.contains("missing required param 'plaintext'"));
}
@@ -60,7 +70,12 @@ async fn gated_method_is_unknown_at_transport_even_with_malformed_params() {
let ctx = CoreContext::for_test(DomainSet::harness(), None);
let err = CoreContext::scope(
ctx,
- invoke_method(DispatchCtx::ambient(), default_state(), &gated_method, params.clone()),
+ invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ &gated_method,
+ params.clone(),
+ ),
)
.await
.expect_err("gated flows method must error under harness()");
@@ -90,9 +105,14 @@ async fn invoke_config_get_runtime_flags_via_registry() {
#[tokio::test]
async fn invoke_auth_store_session_missing_token_fails_validation() {
- let err = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.auth_store_session", json!({}))
- .await
- .expect_err("missing token should fail");
+ let err = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.auth_store_session",
+ json!({}),
+ )
+ .await
+ .expect_err("missing token should fail");
assert!(err.contains("missing required param 'token'"));
}
@@ -114,7 +134,13 @@ async fn invoke_memory_init_accepts_empty_params() {
// jwt_token is optional (accepted for backward compat but ignored).
// The call may still fail for workspace reasons in test, but must NOT
// fail with a missing-param error for jwt_token.
- let result = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.memory_init", json!({})).await;
+ let result = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.memory_init",
+ json!({}),
+ )
+ .await;
if let Err(ref e) = result {
assert!(
!e.contains("missing required param") || !e.contains("jwt_token"),
@@ -205,9 +231,14 @@ async fn invoke_method_rejects_array_params_for_registered_method() {
#[tokio::test]
async fn invoke_method_rejects_string_params_for_registered_method() {
- let err = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.health_snapshot", json!("oops"))
- .await
- .expect_err("string params should be rejected");
+ let err = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.health_snapshot",
+ json!("oops"),
+ )
+ .await
+ .expect_err("string params should be rejected");
assert!(err.contains("invalid params"));
assert!(err.contains("string"));
}
@@ -215,7 +246,13 @@ async fn invoke_method_rejects_string_params_for_registered_method() {
#[tokio::test]
async fn invoke_method_accepts_null_params_for_registered_method() {
// JSON-RPC 2.0 allows omitting params; null must be treated like {}.
- let result = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.health_snapshot", json!(null)).await;
+ let result = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.health_snapshot",
+ json!(null),
+ )
+ .await;
// Call should succeed or fail for domain reasons — but must NOT
// fail with the "invalid params" shape error.
if let Err(e) = result {
@@ -228,18 +265,28 @@ async fn invoke_method_accepts_null_params_for_registered_method() {
#[tokio::test]
async fn invoke_method_unknown_method_returns_unknown_error() {
- let err = invoke_method(DispatchCtx::ambient(), default_state(), "openhuman.totally_made_up_xyz", json!({}))
- .await
- .expect_err("unknown methods must error");
+ let err = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "openhuman.totally_made_up_xyz",
+ json!({}),
+ )
+ .await
+ .expect_err("unknown methods must error");
assert!(err.contains("unknown method"));
}
#[tokio::test]
async fn invoke_method_core_ping_via_tier1() {
// core.* methods aren't in the registry; they route through tier 1.
- let result = invoke_method(DispatchCtx::ambient(), default_state(), "core.ping", json!({}))
- .await
- .expect("core.ping should succeed via tier 1");
+ let result = invoke_method(
+ DispatchCtx::ambient(),
+ default_state(),
+ "core.ping",
+ json!({}),
+ )
+ .await
+ .expect("core.ping should succeed via tier 1");
assert_eq!(result, json!({ "ok": true }));
}
diff --git a/crates/openhuman-core/src/core/runtime/context.rs b/crates/openhuman-core/src/core/runtime/context.rs
index 63eb9e7425..beef7d1a38 100644
--- a/crates/openhuman-core/src/core/runtime/context.rs
+++ b/crates/openhuman-core/src/core/runtime/context.rs
@@ -538,7 +538,9 @@ impl CoreContext {
/// it would turn a labelled turn into an unlabelled one the approval gate
/// refuses.
pub async fn scope<F: Future>(ctx: Arc<CoreContext>, fut: F) -> F::Output {
- CURRENT_CONTEXT.scope(Self::keeping_turn_origin(ctx), fut).await
+ CURRENT_CONTEXT
+ .scope(Self::keeping_turn_origin(ctx), fut)
+ .await
}
/// [`scope`](Self::scope) for a synchronous closure.
diff --git a/crates/openhuman-core/src/core/runtime/context_test_support.rs b/crates/openhuman-core/src/core/runtime/context_test_support.rs
index e9d610fce7..741aca0b3a 100644
--- a/crates/openhuman-core/src/core/runtime/context_test_support.rs
+++ b/crates/openhuman-core/src/core/runtime/context_test_support.rs
@@ -35,9 +35,12 @@ impl CoreContext {
/// Test-only: given `[components]` switches.
pub(crate) fn for_test_with_components(c: crate::core::runtime::ComponentSet) -> Arc<Self> {
- let mut ctx = Arc::try_unwrap(Self::for_test(crate::core::runtime::DomainSet::full(), None))
- .ok()
- .unwrap();
+ let mut ctx = Arc::try_unwrap(Self::for_test(
+ crate::core::runtime::DomainSet::full(),
+ None,
+ ))
+ .ok()
+ .unwrap();
ctx.components = c;
Arc::new(ctx)
}
diff --git a/crates/openhuman-core/src/core/subsystem/schemas_tests.rs b/crates/openhuman-core/src/core/subsystem/schemas_tests.rs
index 0e52c11ee9..20e7d38361 100644
--- a/crates/openhuman-core/src/core/subsystem/schemas_tests.rs
+++ b/crates/openhuman-core/src/core/subsystem/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn status_schema_shape() {
@@ -24,7 +24,9 @@ fn schemas_and_controllers_line_up() {
#[tokio::test]
async fn handler_returns_a_subsystems_array_containing_the_memory_slot() {
- let value = handle_status(DispatchCtx::process_default(), Map::new()).await.expect("handler succeeds");
+ let value = handle_status(DispatchCtx::process_default(), Map::new())
+ .await
+ .expect("handler succeeds");
let rows = value["subsystems"].as_array().expect("array");
assert_eq!(rows.len(), 1);
assert_eq!(rows[0]["slot"], "memory");
diff --git a/crates/openhuman-core/src/desktop/control/schemas_tests.rs b/crates/openhuman-core/src/desktop/control/schemas_tests.rs
index 2ea3528105..5466dd8347 100644
--- a/crates/openhuman-core/src/desktop/control/schemas_tests.rs
+++ b/crates/openhuman-core/src/desktop/control/schemas_tests.rs
@@ -1,6 +1,6 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
use crate::core::runtime::context::CoreContext;
+use crate::core::runtime::DispatchCtx;
use crate::core::runtime::DomainSet;
fn controller(name: &str) -> RegisteredController {
@@ -37,7 +37,9 @@ fn scoped_context(computer: bool) -> (tempfile::TempDir, std::sync::Arc<CoreCont
async fn pending_lists_actions_while_the_computer_component_is_on() {
let (_dir, context) = scoped_context(true);
CoreContext::scope(context, async {
- let value = (controller("pending").handler)(DispatchCtx::process_default(), Map::new()).await.unwrap();
+ let value = (controller("pending").handler)(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap();
assert!(value.is_array());
})
.await;
@@ -65,7 +67,9 @@ async fn every_desktop_controller_answers_component_disabled_when_computer_is_of
let mut params = Map::new();
params.insert("confirmation_id".to_owned(), Value::String("id".to_owned()));
params.insert("approve".to_owned(), Value::Bool(true));
- let error = (controller("confirm").handler)(DispatchCtx::process_default(), params).await.unwrap_err();
+ let error = (controller("confirm").handler)(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err();
assert!(error.contains("COMPONENT_DISABLED:computer"), "{error}");
})
.await;
@@ -91,14 +95,18 @@ async fn malformed_controller_inputs_fail_before_loading_config_or_acting() {
params.insert("confirmation_id".to_owned(), Value::String(String::new()));
params.insert("approve".to_owned(), Value::Bool(true));
assert_eq!(
- (controller("confirm").handler)(DispatchCtx::process_default(), params).await.unwrap_err(),
+ (controller("confirm").handler)(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err(),
"confirmation_id is required"
);
let mut params = Map::new();
params.insert("confirmation_id".to_owned(), Value::String("id".to_owned()));
params.insert("approve".to_owned(), Value::String("yes".to_owned()));
assert_eq!(
- (controller("confirm").handler)(DispatchCtx::process_default(), params).await.unwrap_err(),
+ (controller("confirm").handler)(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err(),
"approve must be a boolean"
);
}
@@ -112,16 +120,22 @@ async fn controllers_use_scoped_config_for_disabled_desktop_and_reject_unknown_c
let context = CoreContext::for_test_with_config(DomainSet::full(), config);
CoreContext::scope(context, async {
- let status = (controller("status").handler)(DispatchCtx::process_default(), Map::new()).await.unwrap();
+ let status = (controller("status").handler)(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap();
assert_eq!(status["enabled"], false);
- let probe = (controller("probe").handler)(DispatchCtx::process_default(), Map::new()).await.unwrap();
+ let probe = (controller("probe").handler)(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap();
assert_eq!(probe["ok"], false);
assert!(probe["reason"].as_str().unwrap().contains("disabled"));
let mut params = Map::new();
params.insert("enabled".to_owned(), Value::Bool(false));
- let disabled = (controller("set_enabled").handler)(DispatchCtx::process_default(), params).await.unwrap();
+ let disabled = (controller("set_enabled").handler)(DispatchCtx::process_default(), params)
+ .await
+ .unwrap();
assert_eq!(disabled["enabled"], false);
let mut params = Map::new();
@@ -130,7 +144,9 @@ async fn controllers_use_scoped_config_for_disabled_desktop_and_reject_unknown_c
Value::String("missing".to_owned()),
);
params.insert("approve".to_owned(), Value::Bool(true));
- let error = (controller("confirm").handler)(DispatchCtx::process_default(), params).await.unwrap_err();
+ let error = (controller("confirm").handler)(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err();
assert!(error.contains("missing or expired"));
})
.await;
diff --git a/crates/openhuman-core/src/desktop/dashboard/schemas.rs b/crates/openhuman-core/src/desktop/dashboard/schemas.rs
index 39827ed226..10d5159529 100644
--- a/crates/openhuman-core/src/desktop/dashboard/schemas.rs
+++ b/crates/openhuman-core/src/desktop/dashboard/schemas.rs
@@ -163,7 +163,10 @@ fn model_health_config_fields() -> Vec<FieldSchema> {
]
}
-fn handle_dashboard_model_health(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_dashboard_model_health(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
log::debug!("[dashboard] model_health request received");
let cfg = crate::config::rpc::load_config_with_timeout()
diff --git a/crates/openhuman-core/src/desktop/provider_surfaces/schemas.rs b/crates/openhuman-core/src/desktop/provider_surfaces/schemas.rs
index 644902bfe2..cfe91b4b78 100644
--- a/crates/openhuman-core/src/desktop/provider_surfaces/schemas.rs
+++ b/crates/openhuman-core/src/desktop/provider_surfaces/schemas.rs
@@ -84,14 +84,20 @@ pub fn schemas(function: &str) -> ControllerSchema {
}
}
-fn handle_ingest_event(_ctx: DispatchCtx, params: Map<String, Value>) -> crate::core::all::ControllerFuture {
+fn handle_ingest_event(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> crate::core::all::ControllerFuture {
Box::pin(async move {
let payload: ProviderEvent = parse_params(params)?;
ops::ingest_event(payload).await?.into_cli_compatible_json()
})
}
-fn handle_list_queue(_ctx: DispatchCtx, params: Map<String, Value>) -> crate::core::all::ControllerFuture {
+fn handle_list_queue(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> crate::core::all::ControllerFuture {
Box::pin(async move {
let payload: EmptyRequest = parse_params(params)?;
ops::list_queue(payload).await?.into_cli_compatible_json()
diff --git a/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs b/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs
index 3310cd2954..5938378d3f 100644
--- a/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn all_schemas_count() {
diff --git a/crates/openhuman-core/src/inference/host_runtime/schemas.rs b/crates/openhuman-core/src/inference/host_runtime/schemas.rs
index f60b7714e0..32e88edd21 100644
--- a/crates/openhuman-core/src/inference/host_runtime/schemas.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/schemas.rs
@@ -278,7 +278,10 @@ fn handle_local_ai_transcribe(_ctx: DispatchCtx, params: Map<String, Value>) ->
})
}
-fn handle_local_ai_transcribe_bytes(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_local_ai_transcribe_bytes(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<LocalAiTranscribeBytesParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -308,7 +311,10 @@ fn handle_local_ai_tts(_ctx: DispatchCtx, params: Map<String, Value>) -> Control
})
}
-fn handle_local_ai_test_connection(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_local_ai_test_connection(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<LocalAiTestConnectionParams>(params)?;
let result = tinyinference_local::service::test_ollama_connection(&p.url).await?;
diff --git a/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs b/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs
index c47bf63a9d..58e5bcf1f3 100644
--- a/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/claude_code_handlers.rs
@@ -17,7 +17,10 @@ pub(super) struct InferenceClaudeCodeSetFullAccessParams {
enabled: bool,
}
-pub(super) fn handle_inference_claude_code_status(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_claude_code_status(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let status = tokio::task::spawn_blocking(
tinyagents_harness::providers::claude_code::version_check::probe,
@@ -28,7 +31,8 @@ pub(super) fn handle_inference_claude_code_status(_ctx: DispatchCtx, _params: Ma
})
}
-pub(super) fn handle_inference_claude_code_auth_status(_ctx: DispatchCtx,
+pub(super) fn handle_inference_claude_code_auth_status(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -41,7 +45,8 @@ pub(super) fn handle_inference_claude_code_auth_status(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_claude_code_settings(_ctx: DispatchCtx,
+pub(super) fn handle_inference_claude_code_settings(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
use tinyagents_harness::providers::claude_code::settings;
@@ -57,7 +62,8 @@ pub(super) fn handle_inference_claude_code_settings(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_claude_code_set_full_access(_ctx: DispatchCtx,
+pub(super) fn handle_inference_claude_code_set_full_access(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
use tinyagents_harness::providers::claude_code::settings;
diff --git a/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs b/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs
index 8bbf40644c..fbe2ae16d6 100644
--- a/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/oauth_handlers.rs
@@ -15,14 +15,18 @@ pub(super) struct InferenceOpenAiOAuthCompleteParams {
callback_url: String,
}
-pub(super) fn handle_inference_openai_oauth_start(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_openai_oauth_start(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::inference::rpc::inference_openai_oauth_start(&config).await?)
})
}
-pub(super) fn handle_inference_openai_oauth_complete(_ctx: DispatchCtx,
+pub(super) fn handle_inference_openai_oauth_complete(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -38,7 +42,8 @@ pub(super) fn handle_inference_openai_oauth_complete(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_openai_oauth_import_codex_cli(_ctx: DispatchCtx,
+pub(super) fn handle_inference_openai_oauth_import_codex_cli(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -47,7 +52,8 @@ pub(super) fn handle_inference_openai_oauth_import_codex_cli(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_openai_oauth_status(_ctx: DispatchCtx,
+pub(super) fn handle_inference_openai_oauth_status(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -56,7 +62,8 @@ pub(super) fn handle_inference_openai_oauth_status(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_openai_oauth_disconnect(_ctx: DispatchCtx,
+pub(super) fn handle_inference_openai_oauth_disconnect(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
diff --git a/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs b/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
index 2b09ad8d06..cf079b7b8d 100644
--- a/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
@@ -41,7 +41,10 @@ pub(super) struct InferenceAnalyzeSentimentParams {
message: String,
}
-pub(super) fn handle_inference_summarize(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_summarize(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferenceSummarizeParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -49,7 +52,10 @@ pub(super) fn handle_inference_summarize(_ctx: DispatchCtx, params: Map<String,
})
}
-pub(super) fn handle_inference_prompt(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_prompt(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferencePromptParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -60,7 +66,10 @@ pub(super) fn handle_inference_prompt(_ctx: DispatchCtx, params: Map<String, Val
})
}
-pub(super) fn handle_inference_vision_prompt(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_vision_prompt(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferenceVisionPromptParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -76,7 +85,10 @@ pub(super) fn handle_inference_vision_prompt(_ctx: DispatchCtx, params: Map<Stri
})
}
-pub(super) fn handle_inference_test_provider_model(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_test_provider_model(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferenceTestChatModelParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -92,7 +104,10 @@ pub(super) fn handle_inference_test_provider_model(_ctx: DispatchCtx, params: Ma
})
}
-pub(super) fn handle_inference_analyze_sentiment(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_analyze_sentiment(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferenceAnalyzeSentimentParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
diff --git a/crates/openhuman-core/src/inference/schemas/settings_handlers.rs b/crates/openhuman-core/src/inference/schemas/settings_handlers.rs
index ccd75d0f13..39f89e475a 100644
--- a/crates/openhuman-core/src/inference/schemas/settings_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/settings_handlers.rs
@@ -81,7 +81,10 @@ pub(super) struct InferenceListModelsParams {
provider_id: String,
}
-pub(super) fn handle_inference_resolve_model(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_resolve_model(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferenceResolveModelParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -101,18 +104,25 @@ pub(super) fn handle_inference_resolve_model(_ctx: DispatchCtx, params: Map<Stri
})
}
-pub(super) fn handle_inference_status(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_status(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::inference::rpc::inference_status(&config).await?)
})
}
-pub(super) fn handle_inference_get_client_config(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_get_client_config(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move { to_json(crate::inference::rpc::inference_get_client_config().await?) })
}
-pub(super) fn handle_inference_update_model_settings(_ctx: DispatchCtx,
+pub(super) fn handle_inference_update_model_settings(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -249,7 +259,8 @@ pub(super) fn handle_inference_update_model_settings(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_update_local_settings(_ctx: DispatchCtx,
+pub(super) fn handle_inference_update_local_settings(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -274,20 +285,27 @@ pub(super) fn handle_inference_update_local_settings(_ctx: DispatchCtx,
})
}
-pub(super) fn handle_inference_list_models(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_list_models(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let request = deserialize_params::<InferenceListModelsParams>(params)?;
to_json(crate::inference::rpc::inference_list_models(&request.provider_id).await?)
})
}
-pub(super) fn handle_inference_provider_auth_errors(_ctx: DispatchCtx,
+pub(super) fn handle_inference_provider_auth_errors(
+ _ctx: DispatchCtx,
_params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move { to_json(crate::inference::rpc::inference_provider_auth_errors().await?) })
}
-pub(super) fn handle_inference_diagnostics(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_inference_diagnostics(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::inference::rpc::inference_diagnostics(&config).await?)
diff --git a/crates/openhuman-core/src/inference/schemas_tests.rs b/crates/openhuman-core/src/inference/schemas_tests.rs
index 2f829df5eb..2e11e195ad 100644
--- a/crates/openhuman-core/src/inference/schemas_tests.rs
+++ b/crates/openhuman-core/src/inference/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use crate::core::TypeSchema;
#[test]
diff --git a/crates/openhuman-core/src/inference/tokenjuice/schemas_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/schemas_tests.rs
index ba7a0a2728..9a920a0008 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/schemas_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn all_schemas_have_namespace() {
@@ -207,7 +207,9 @@ async fn tokenjuice_methods_are_not_gated_when_juice_is_on() {
);
crate::core::runtime::context::CoreContext::scope(ctx, async {
// Gate passes; the handler then fails on its own missing param.
- let err = handle_detect(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_detect(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(!err.contains("COMPONENT_DISABLED"), "{err}");
})
.await;
diff --git a/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs b/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs
index 191cddffe4..e68c2ea695 100644
--- a/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs
+++ b/crates/openhuman-core/src/integrations/composio/schemas/handlers_connections.rs
@@ -12,28 +12,40 @@ use crate::integrations::composio::ops;
use super::util::{read_optional, read_required_non_empty, to_json};
-pub(super) fn handle_list_toolkits(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_toolkits(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
let config = config_rpc::load_config_with_timeout().await?;
to_json(ops::composio_list_toolkits(&config).await?)
})
}
-pub(super) fn handle_list_capabilities(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_capabilities(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
let config = config_rpc::load_config_with_timeout().await?;
to_json(ops::composio_list_capabilities(&config).await?)
})
}
-pub(super) fn handle_list_agent_ready_toolkits(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_agent_ready_toolkits(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
let config = config_rpc::load_config_with_timeout().await?;
to_json(ops::composio_list_agent_ready_toolkits(&config).await?)
})
}
-pub(super) fn handle_list_connections(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_connections(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async {
let config = config_rpc::load_config_with_timeout().await?;
to_json(ops::composio_list_connections(&config).await?)
@@ -49,7 +61,10 @@ pub(super) fn handle_authorize(_ctx: DispatchCtx, params: Map<String, Value>) ->
})
}
-pub(super) fn handle_delete_connection(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_delete_connection(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let connection_id = read_required_non_empty(&params, "connection_id")?;
@@ -65,7 +80,10 @@ pub(super) fn handle_get_mode(_ctx: DispatchCtx, _params: Map<String, Value>) ->
})
}
-pub(super) fn handle_set_api_key(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_set_api_key(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
tracing::debug!("[composio-direct] rpc set_api_key entry");
let config = config_rpc::load_config_with_timeout().await?;
@@ -75,7 +93,10 @@ pub(super) fn handle_set_api_key(_ctx: DispatchCtx, params: Map<String, Value>)
})
}
-pub(super) fn handle_clear_api_key(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_clear_api_key(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
tracing::debug!("[composio-direct] rpc clear_api_key entry");
let config = config_rpc::load_config_with_timeout().await?;
diff --git a/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs b/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs
index 082b170638..1c9cbfcfa9 100644
--- a/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs
+++ b/crates/openhuman-core/src/integrations/composio/schemas/handlers_identity.rs
@@ -11,7 +11,10 @@ use crate::integrations::composio::{contract, ops};
use super::util::{read_required, read_required_non_empty, to_json};
-pub(super) fn handle_get_user_profile(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_user_profile(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let connection_id = read_required_non_empty(&params, "connection_id")?;
@@ -19,14 +22,20 @@ pub(super) fn handle_get_user_profile(_ctx: DispatchCtx, params: Map<String, Val
})
}
-pub(super) fn handle_refresh_all_identities(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_refresh_all_identities(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(ops::composio_refresh_all_identities(&config).await?)
})
}
-pub(super) fn handle_get_user_scopes(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_get_user_scopes(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let toolkit = match read_required_non_empty(&params, "toolkit") {
Ok(v) => v,
@@ -78,7 +87,10 @@ pub(super) fn handle_get_user_scopes(_ctx: DispatchCtx, params: Map<String, Valu
})
}
-pub(super) fn handle_set_user_scopes(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_set_user_scopes(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let toolkit = match read_required_non_empty(&params, "toolkit") {
Ok(v) => v,
diff --git a/crates/openhuman-core/src/integrations/composio/schemas/handlers_triggers.rs b/crates/openhuman-core/src/integrations/composio/schemas/handlers_triggers.rs
index 30f8615c56..4eab5e2e87 100644
--- a/crates/openhuman-core/src/integrations/composio/schemas/handlers_triggers.rs
+++ b/crates/openhuman-core/src/integrations/composio/schemas/handlers_triggers.rs
@@ -15,7 +15,10 @@ use super::params::{
};
use super::util::{read_required_non_empty, to_json};
-pub(super) fn handle_list_github_repos(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_github_repos(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload: ListGithubReposParams = serde_json::from_value(Value::Object(params))
@@ -24,7 +27,10 @@ pub(super) fn handle_list_github_repos(_ctx: DispatchCtx, params: Map<String, Va
})
}
-pub(super) fn handle_create_trigger(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_create_trigger(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload: CreateTriggerParams = serde_json::from_value(Value::Object(params))
@@ -45,7 +51,10 @@ pub(super) fn handle_create_trigger(_ctx: DispatchCtx, params: Map<String, Value
})
}
-pub(super) fn handle_list_trigger_history(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_trigger_history(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload: TriggerHistoryParams = serde_json::from_value(Value::Object(params))
@@ -54,7 +63,10 @@ pub(super) fn handle_list_trigger_history(_ctx: DispatchCtx, params: Map<String,
})
}
-pub(super) fn handle_list_available_triggers(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_available_triggers(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload: ListAvailableTriggersParams = serde_json::from_value(Value::Object(params))
@@ -69,7 +81,10 @@ pub(super) fn handle_list_available_triggers(_ctx: DispatchCtx, params: Map<Stri
})
}
-pub(super) fn handle_list_triggers(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_list_triggers(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload: ListTriggersParams = serde_json::from_value(Value::Object(params))
@@ -78,7 +93,10 @@ pub(super) fn handle_list_triggers(_ctx: DispatchCtx, params: Map<String, Value>
})
}
-pub(super) fn handle_enable_trigger(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_enable_trigger(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload: EnableTriggerParams = serde_json::from_value(Value::Object(params))
@@ -98,7 +116,10 @@ pub(super) fn handle_enable_trigger(_ctx: DispatchCtx, params: Map<String, Value
})
}
-pub(super) fn handle_disable_trigger(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_disable_trigger(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let trigger_id = read_required_non_empty(&params, "trigger_id")?;
diff --git a/crates/openhuman-core/src/mcp/audit/schemas_tests.rs b/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
index f5dabb2506..54ec78f892 100644
--- a/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
+++ b/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use serde_json::json;
#[test]
@@ -48,7 +48,9 @@ async fn handle_list_returns_persisted_audit_records() {
.await
.expect("record write");
- let value = handle_list(DispatchCtx::process_default(), Map::new()).await.expect("handle list");
+ let value = handle_list(DispatchCtx::process_default(), Map::new())
+ .await
+ .expect("handle list");
let records = value["records"].as_array().expect("records array");
assert_eq!(records.len(), 1);
assert_eq!(records[0]["tool_name"], "memory.store");
diff --git a/crates/openhuman-core/src/mcp/registry/schemas/handlers.rs b/crates/openhuman-core/src/mcp/registry/schemas/handlers.rs
index bb6afb242b..52c565b017 100644
--- a/crates/openhuman-core/src/mcp/registry/schemas/handlers.rs
+++ b/crates/openhuman-core/src/mcp/registry/schemas/handlers.rs
@@ -13,7 +13,10 @@ use super::params::{
// ── Handler implementations ──────────────────────────────────────────────────
-pub(super) fn handle_registry_search(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_registry_search(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let query = read_optional_string(&params, "query")?;
@@ -29,7 +32,10 @@ pub(super) fn handle_registry_search(_ctx: DispatchCtx, params: Map<String, Valu
})
}
-pub(super) fn handle_registry_get(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_registry_get(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let qualified_name = read_required::<String>(&params, "qualified_name")?;
@@ -37,7 +43,10 @@ pub(super) fn handle_registry_get(_ctx: DispatchCtx, params: Map<String, Value>)
})
}
-pub(super) fn handle_installed_list(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_installed_list(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let _ = params;
let config = config_rpc::load_config_with_timeout().await?;
@@ -62,7 +71,10 @@ pub(super) fn handle_uninstall(_ctx: DispatchCtx, params: Map<String, Value>) ->
})
}
-pub(super) fn handle_detect_auth(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_detect_auth(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let server_id = read_required::<String>(&params, "server_id")?;
@@ -70,7 +82,10 @@ pub(super) fn handle_detect_auth(_ctx: DispatchCtx, params: Map<String, Value>)
})
}
-pub(super) fn handle_oauth_begin(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_oauth_begin(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let server_id = read_required::<String>(&params, "server_id")?;
@@ -94,7 +109,10 @@ pub(super) fn handle_disconnect(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-pub(super) fn handle_set_enabled(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_set_enabled(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let server_id = read_required::<String>(&params, "server_id")?;
@@ -165,7 +183,10 @@ pub(super) fn handle_config_set(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-pub(super) fn handle_registry_settings_get(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_registry_settings_get(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let _ = params;
let config = config_rpc::load_config_with_timeout().await?;
@@ -173,7 +194,10 @@ pub(super) fn handle_registry_settings_get(_ctx: DispatchCtx, params: Map<String
})
}
-pub(super) fn handle_registry_settings_set(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_registry_settings_set(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let smithery_api_key = read_optional::<String>(&params, "smithery_api_key")?;
let mcp_official_base = read_optional::<String>(&params, "mcp_official_base")?;
diff --git a/crates/openhuman-core/src/mcp/ui/schemas_tests.rs b/crates/openhuman-core/src/mcp/ui/schemas_tests.rs
index aaaf9fd659..82a050b838 100644
--- a/crates/openhuman-core/src/mcp/ui/schemas_tests.rs
+++ b/crates/openhuman-core/src/mcp/ui/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn every_registered_controller_is_in_the_mcp_ui_namespace() {
@@ -36,17 +36,21 @@ fn params(value: Value) -> Map<String, Value> {
#[tokio::test]
async fn resource_read_handler_rejects_a_missing_server() {
- let error = with_workspace(handle_resource_read(DispatchCtx::process_default(), params(serde_json::json!({}))))
- .await
- .unwrap_err();
+ let error = with_workspace(handle_resource_read(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({})),
+ ))
+ .await
+ .unwrap_err();
assert!(error.contains("server_id"));
}
#[tokio::test]
async fn resource_read_handler_rejects_an_unknown_inline_id() {
- let error = with_workspace(handle_resource_read(DispatchCtx::process_default(), params(
- serde_json::json!({"inline_id": "absent"}),
- )))
+ let error = with_workspace(handle_resource_read(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({"inline_id": "absent"})),
+ ))
.await
.unwrap_err();
assert!(error.contains("no longer available"));
@@ -54,17 +58,21 @@ async fn resource_read_handler_rejects_an_unknown_inline_id() {
#[tokio::test]
async fn tool_call_handler_rejects_a_missing_server() {
- let error = with_workspace(handle_tool_call(DispatchCtx::process_default(), params(serde_json::json!({}))))
- .await
- .unwrap_err();
+ let error = with_workspace(handle_tool_call(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({})),
+ ))
+ .await
+ .unwrap_err();
assert!(error.contains("server_id"));
}
#[tokio::test]
async fn tool_call_handler_refuses_an_unavailable_server() {
- let result = with_workspace(handle_tool_call(DispatchCtx::process_default(), params(
- serde_json::json!({"server_id": "nowhere", "tool_name": "order"}),
- )))
+ let result = with_workspace(handle_tool_call(
+ DispatchCtx::process_default(),
+ params(serde_json::json!({"server_id": "nowhere", "tool_name": "order"})),
+ ))
.await;
assert!(result.is_err());
}
diff --git a/crates/openhuman-core/src/memory/schemas/handlers.rs b/crates/openhuman-core/src/memory/schemas/handlers.rs
index e762364829..1b27be12e7 100644
--- a/crates/openhuman-core/src/memory/schemas/handlers.rs
+++ b/crates/openhuman-core/src/memory/schemas/handlers.rs
@@ -161,14 +161,20 @@ pub(super) fn agents_list(_ctx: DispatchCtx, params: Map<String, Value>) -> Cont
})
}
-pub(super) fn conversations_backfill_status(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn conversations_backfill_status(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
parse::<EmptyParams>(params)?;
finish(backfill::status(&load().await?).await)
})
}
-pub(super) fn conversations_backfill_start(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn conversations_backfill_start(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let params = parse::<backfill::BackfillStartParams>(params)?;
finish(backfill::start(&load().await?, params).await)
@@ -294,7 +300,10 @@ pub(super) fn import_status(_ctx: DispatchCtx, params: Map<String, Value>) -> Co
})
}
-pub(super) fn import_retry_failed(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn import_retry_failed(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
parse::<EmptyParams>(params)?;
let config = load().await?;
diff --git a/crates/openhuman-core/src/memory/schemas_tests.rs b/crates/openhuman-core/src/memory/schemas_tests.rs
index 24cbedd1ef..16570d2dc9 100644
--- a/crates/openhuman-core/src/memory/schemas_tests.rs
+++ b/crates/openhuman-core/src/memory/schemas_tests.rs
@@ -1,7 +1,7 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
use crate::config::Config;
use crate::core::runtime::context::CoreContext;
+use crate::core::runtime::DispatchCtx;
use crate::core::runtime::DomainSet;
use crate::memory::test_fixtures::{bind_reference, config_in};
use serde_json::{json, Map, Value};
@@ -57,7 +57,10 @@ fn object(value: Value) -> Map<String, Value> {
async fn call(config: &Config, function: &str, params: Value) -> Result<Value, String> {
let handler = handler_for(function);
let ctx = CoreContext::for_test_with_config(DomainSet::full(), config.clone());
- CoreContext::scope(ctx, async move { handler(DispatchCtx::process_default(), object(params)).await }).await
+ CoreContext::scope(ctx, async move {
+ handler(DispatchCtx::process_default(), object(params)).await
+ })
+ .await
}
#[test]
diff --git a/crates/openhuman-core/src/modules/schemas.rs b/crates/openhuman-core/src/modules/schemas.rs
index 14ea84cab4..aa3b92d4c7 100644
--- a/crates/openhuman-core/src/modules/schemas.rs
+++ b/crates/openhuman-core/src/modules/schemas.rs
@@ -200,7 +200,10 @@ fn readiness_error(detail: &str) -> String {
}
}
-fn handle_browser_check_readiness(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_browser_check_readiness(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let mut config = config_rpc::load_config_with_timeout().await?;
crate::core::runtime::components::require_config(&config, "computer")?;
diff --git a/crates/openhuman-core/src/modules/schemas_tests.rs b/crates/openhuman-core/src/modules/schemas_tests.rs
index f8121ffb2d..2d0f650ce6 100644
--- a/crates/openhuman-core/src/modules/schemas_tests.rs
+++ b/crates/openhuman-core/src/modules/schemas_tests.rs
@@ -1,8 +1,8 @@
-use crate::core::runtime::DispatchCtx;
use super::{
all_controller_schemas, all_registered_controllers, controller_value, schemas, string_param,
};
use crate::core::runtime::context::CoreContext;
+use crate::core::runtime::DispatchCtx;
use crate::core::runtime::DomainSet;
use serde_json::{Map, Value};
@@ -88,7 +88,10 @@ async fn forgetting_sites_reports_how_many_went() {
Value::String("https://www.shop.test/cart".to_string()),
);
let one = super::handle_browser_forget_sites(DispatchCtx::process_default(), one).await;
- (one, super::handle_browser_forget_sites(DispatchCtx::process_default(), Map::new()).await)
+ (
+ one,
+ super::handle_browser_forget_sites(DispatchCtx::process_default(), Map::new()).await,
+ )
})
.await;
diff --git a/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs b/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs
index 84f5bedbdb..09a912d2eb 100644
--- a/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/connectivity/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn lists_single_diag_controller() {
@@ -31,6 +31,8 @@ fn diag_schema_outputs_a_diag_payload_field() {
#[tokio::test]
async fn handle_diag_returns_json_object() {
- let value = handle_diag(DispatchCtx::process_default(), Map::new()).await.expect("diag handler ok");
+ let value = handle_diag(DispatchCtx::process_default(), Map::new())
+ .await
+ .expect("diag handler ok");
assert!(value.is_object(), "payload should be a JSON object");
}
diff --git a/crates/openhuman-core/src/platform/cost/schemas.rs b/crates/openhuman-core/src/platform/cost/schemas.rs
index 187d2d941c..44e2ae5e88 100644
--- a/crates/openhuman-core/src/platform/cost/schemas.rs
+++ b/crates/openhuman-core/src/platform/cost/schemas.rs
@@ -242,7 +242,10 @@ fn handle_cost_get_dashboard(_ctx: DispatchCtx, _params: Map<String, Value>) ->
})
}
-fn handle_cost_get_daily_history(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_cost_get_daily_history(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let cid = new_correlation_id();
log::debug!(target: "cost_rpc", "[cost_rpc][{cid}] cost_get_daily_history.entry");
diff --git a/crates/openhuman-core/src/platform/health/schemas_tests.rs b/crates/openhuman-core/src/platform/health/schemas_tests.rs
index e0c7bc90c2..d38542956f 100644
--- a/crates/openhuman-core/src/platform/health/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/health/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn all_schemas_returns_two() {
diff --git a/crates/openhuman-core/src/platform/socket/schemas_tests.rs b/crates/openhuman-core/src/platform/socket/schemas_tests.rs
index 419e1221b7..12492c0da8 100644
--- a/crates/openhuman-core/src/platform/socket/schemas_tests.rs
+++ b/crates/openhuman-core/src/platform/socket/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn catalog_lists_all_five_controllers() {
@@ -101,16 +101,24 @@ async fn handlers_error_without_initialized_manager() {
return;
}
- let err = handle_disconnect(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_disconnect(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(err.contains("SocketManager not initialized"));
- let err = handle_state(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_state(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(err.contains("SocketManager not initialized"));
- let err = handle_connect(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_connect(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(err.contains("SocketManager not initialized"));
- let err = handle_emit(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_emit(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(err.contains("SocketManager not initialized"));
}
diff --git a/crates/openhuman-core/src/profiles/schemas_tests.rs b/crates/openhuman-core/src/profiles/schemas_tests.rs
index 6be61293dc..c539e6869c 100644
--- a/crates/openhuman-core/src/profiles/schemas_tests.rs
+++ b/crates/openhuman-core/src/profiles/schemas_tests.rs
@@ -39,6 +39,8 @@ async fn outside_saas_the_controllers_refuse() {
.iter()
.find(|c| c.schema.function == "list")
.unwrap();
- let err = (list.handler)(DispatchCtx::process_default(), Default::default()).await.unwrap_err();
+ let err = (list.handler)(DispatchCtx::process_default(), Default::default())
+ .await
+ .unwrap_err();
assert!(err.contains("SaaS"), "{err}");
}
diff --git a/crates/openhuman-core/src/sandbox/schemas_tests.rs b/crates/openhuman-core/src/sandbox/schemas_tests.rs
index 52f9f7b352..eb257662ed 100644
--- a/crates/openhuman-core/src/sandbox/schemas_tests.rs
+++ b/crates/openhuman-core/src/sandbox/schemas_tests.rs
@@ -1,6 +1,6 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
use crate::core::runtime::context::CoreContext;
+use crate::core::runtime::DispatchCtx;
use crate::core::runtime::DomainSet;
/// Scope a `Config` onto the embedder-config seam that `load_config_with_timeout()`
@@ -30,7 +30,10 @@ fn registered_controllers_match_schemas() {
#[tokio::test]
async fn handle_status_returns_json() {
let ctx = scoped_ctx(crate::config::Config::default());
- let result = CoreContext::scope(ctx, async { handle_status(DispatchCtx::process_default(), Map::new()).await }).await;
+ let result = CoreContext::scope(ctx, async {
+ handle_status(DispatchCtx::process_default(), Map::new()).await
+ })
+ .await;
assert!(result.is_ok());
}
@@ -39,7 +42,10 @@ async fn handle_resolve_policy_none() {
let mut params = Map::new();
params.insert("sandbox_mode".into(), Value::String("none".into()));
let ctx = scoped_ctx(crate::config::Config::default());
- let result = CoreContext::scope(ctx, async { handle_resolve_policy(DispatchCtx::process_default(), params).await }).await;
+ let result = CoreContext::scope(ctx, async {
+ handle_resolve_policy(DispatchCtx::process_default(), params).await
+ })
+ .await;
assert!(result.is_ok());
}
@@ -49,7 +55,10 @@ async fn handle_resolve_policy_sandboxed_remote() {
params.insert("sandbox_mode".into(), Value::String("sandboxed".into()));
params.insert("is_remote".into(), Value::Bool(true));
let ctx = scoped_ctx(crate::config::Config::default());
- let result = CoreContext::scope(ctx, async { handle_resolve_policy(DispatchCtx::process_default(), params).await }).await;
+ let result = CoreContext::scope(ctx, async {
+ handle_resolve_policy(DispatchCtx::process_default(), params).await
+ })
+ .await;
assert!(result.is_ok());
let val = result.unwrap();
let backend = val.get("backend").and_then(|b| b.as_str());
@@ -81,9 +90,11 @@ async fn handle_resolve_policy_honors_loaded_docker_runtime() {
params.insert("sandbox_mode".into(), Value::String("sandboxed".into()));
params.insert("is_remote".into(), Value::Bool(false));
- let val = CoreContext::scope(ctx, async { handle_resolve_policy(DispatchCtx::process_default(), params).await })
- .await
- .expect("resolve_policy should succeed under the scoped config");
+ let val = CoreContext::scope(ctx, async {
+ handle_resolve_policy(DispatchCtx::process_default(), params).await
+ })
+ .await
+ .expect("resolve_policy should succeed under the scoped config");
// Consequence #1: the backend follows `[runtime] kind`, not the default.
assert_eq!(
@@ -119,9 +130,11 @@ async fn handle_status_honors_loaded_docker_runtime() {
params.insert("backend".into(), Value::String("local".into()));
params.insert("is_remote".into(), Value::Bool(false));
- let val = CoreContext::scope(ctx, async { handle_status(DispatchCtx::process_default(), params).await })
- .await
- .expect("status should succeed under the scoped config");
+ let val = CoreContext::scope(ctx, async {
+ handle_status(DispatchCtx::process_default(), params).await
+ })
+ .await
+ .expect("status should succeed under the scoped config");
assert_eq!(
val.get("kind").and_then(|k| k.as_str()),
@@ -150,9 +163,11 @@ async fn handle_resolve_policy_uses_loaded_action_dir() {
let mut params = Map::new();
params.insert("sandbox_mode".into(), Value::String("none".into()));
- let val = CoreContext::scope(ctx, async { handle_resolve_policy(DispatchCtx::process_default(), params).await })
- .await
- .expect("resolve_policy should succeed under the scoped config");
+ let val = CoreContext::scope(ctx, async {
+ handle_resolve_policy(DispatchCtx::process_default(), params).await
+ })
+ .await
+ .expect("resolve_policy should succeed under the scoped config");
assert_eq!(
val.get("workspace_root").and_then(|w| w.as_str()),
@@ -182,7 +197,9 @@ fn docker_policy_params(workspace: &str) -> Map<String, Value> {
async fn handle_validate_policy_rejects_a_malformed_policy() {
let mut params = Map::new();
params.insert("policy".into(), Value::String("not a policy".into()));
- let err = handle_validate_policy(DispatchCtx::process_default(), params).await.unwrap_err();
+ let err = handle_validate_policy(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err();
assert!(err.contains("Invalid policy"), "{err}");
}
@@ -232,7 +249,9 @@ async fn sandbox_methods_are_not_gated_when_sandbox_is_on() {
crate::core::runtime::ComponentSet::all(),
);
crate::core::runtime::context::CoreContext::scope(ctx, async {
- let err = handle_validate_policy(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_validate_policy(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(!err.contains("COMPONENT_DISABLED"), "{err}");
})
.await;
diff --git a/crates/openhuman-core/src/security/credentials/schemas.rs b/crates/openhuman-core/src/security/credentials/schemas.rs
index d950942d8c..e65134d714 100644
--- a/crates/openhuman-core/src/security/credentials/schemas.rs
+++ b/crates/openhuman-core/src/security/credentials/schemas.rs
@@ -229,14 +229,20 @@ fn handle_auth_get_state(_ctx: DispatchCtx, _params: Map<String, Value>) -> Cont
})
}
-fn handle_auth_get_session_token(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_get_session_token(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::security::credentials::rpc::auth_get_session_token_json(&config).await?)
})
}
-fn handle_auth_store_provider_credentials(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_store_provider_credentials(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<AuthStoreProviderCredentialsParams>(params)?;
@@ -254,7 +260,10 @@ fn handle_auth_store_provider_credentials(_ctx: DispatchCtx, params: Map<String,
})
}
-fn handle_auth_remove_provider_credentials(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_remove_provider_credentials(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<AuthRemoveProviderCredentialsParams>(params)?;
@@ -269,7 +278,10 @@ fn handle_auth_remove_provider_credentials(_ctx: DispatchCtx, params: Map<String
})
}
-fn handle_auth_list_provider_credentials(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_list_provider_credentials(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = if params.is_empty() {
diff --git a/crates/openhuman-core/src/security/credentials/tools.rs b/crates/openhuman-core/src/security/credentials/tools.rs
index 5018153639..08fafc410d 100644
--- a/crates/openhuman-core/src/security/credentials/tools.rs
+++ b/crates/openhuman-core/src/security/credentials/tools.rs
@@ -29,7 +29,8 @@ async fn invoke_hosted(
method: &str,
params: serde_json::Map<String, Value>,
) -> anyhow::Result<Value> {
- match crate::core::all::try_invoke_registered_rpc(DispatchCtx::ambient(), method, params).await {
+ match crate::core::all::try_invoke_registered_rpc(DispatchCtx::ambient(), method, params).await
+ {
Some(Ok(value)) => Ok(strip_log_envelope(value)),
Some(Err(err)) => Err(anyhow::anyhow!("{err}")),
None => {
diff --git a/crates/openhuman-core/src/skills/schemas/handlers.rs b/crates/openhuman-core/src/skills/schemas/handlers.rs
index 4798a05946..60d7c72963 100644
--- a/crates/openhuman-core/src/skills/schemas/handlers.rs
+++ b/crates/openhuman-core/src/skills/schemas/handlers.rs
@@ -31,7 +31,10 @@ use super::wire_types::{
WorkflowsRunParams, WorkflowsUninstallResult,
};
-pub(super) fn handle_skills_list(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_list(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let params = deserialize_params::<WorkflowsListParams>(params)?;
let include_skills = params.include_skills;
@@ -74,7 +77,10 @@ pub(super) fn handle_skills_list(_ctx: DispatchCtx, params: Map<String, Value>)
/// predates `[[inputs]]`); on the user picking one we fetch the full
/// `WorkflowDefinition` (which carries inputs) and project the small,
/// FE-shaped subset they need.
-pub(super) fn handle_skills_describe(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_describe(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsDescribeParams>(params)?;
let workspace = resolve_workspace_dir().await;
@@ -112,7 +118,10 @@ pub(super) fn handle_skills_describe(_ctx: DispatchCtx, params: Map<String, Valu
/// FE Skills Runner panel uses this to render the streaming log inline
/// when the user clicks a Recent Runs row, and tails it every 2s while
/// `complete` is false.
-pub(super) fn handle_skills_read_run_log(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_read_run_log(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsReadRunLogParams>(params)?;
let workspace = resolve_workspace_dir().await;
@@ -134,7 +143,10 @@ pub(super) fn handle_skills_read_run_log(_ctx: DispatchCtx, params: Map<String,
/// (most-recent first), optionally filtered to one skill, capped by `limit`.
/// Powers the Skills Runner panel's "Recent runs" section + future live-log
/// tail. Delegates the actual scan + parse to `run_log::scan_runs`.
-pub(super) fn handle_skills_recent_runs(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_recent_runs(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsRecentRunsParams>(params)?;
let limit = payload.limit.unwrap_or(20).min(100) as usize;
@@ -180,7 +192,10 @@ pub(super) fn handle_skills_run(_ctx: DispatchCtx, params: Map<String, Value>) -
/// Fires the run's cancellation token; the run stops at its next await and
/// writes a `CANCELLED` footer. Returns `cancelled: false` when the run id is
/// unknown (already finished or never existed).
-pub(super) fn handle_skills_cancel(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_cancel(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsCancelParams>(params)?;
let cancelled = run_log::cancel_run(&payload.run_id);
@@ -192,7 +207,10 @@ pub(super) fn handle_skills_cancel(_ctx: DispatchCtx, params: Map<String, Value>
})
}
-pub(super) fn handle_skills_read_resource(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_read_resource(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsReadResourceParams>(params)?;
tracing::debug!(
@@ -226,7 +244,10 @@ pub(super) fn handle_skills_read_resource(_ctx: DispatchCtx, params: Map<String,
})
}
-pub(super) fn handle_skills_create(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_create(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsCreateParams>(params)?;
tracing::debug!(
@@ -260,7 +281,10 @@ pub(super) fn handle_skills_create(_ctx: DispatchCtx, params: Map<String, Value>
/// `openhuman.skills_update` — edit an existing workflow. Same payload as
/// create, but overwrites the workflow at the resolved slug (frontmatter +
/// workflow.toml rewritten; the hand-authored body is preserved).
-pub(super) fn handle_skills_update(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_update(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<WorkflowsCreateParams>(params)?;
tracing::debug!(
@@ -286,7 +310,10 @@ pub(super) fn handle_skills_update(_ctx: DispatchCtx, params: Map<String, Value>
})
}
-pub(super) fn handle_skills_install_from_url(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_install_from_url(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let wire = deserialize_params::<WorkflowsInstallFromUrlParamsWire>(params)?;
tracing::debug!(
@@ -319,7 +346,10 @@ pub(super) fn handle_skills_install_from_url(_ctx: DispatchCtx, params: Map<Stri
})
}
-pub(super) fn handle_skills_uninstall(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_skills_uninstall(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let payload = deserialize_params::<UninstallWorkflowParams>(params)?;
tracing::debug!(name = %payload.name, "[skills][rpc] uninstall");
diff --git a/crates/openhuman-core/src/threads/schemas/handlers.rs b/crates/openhuman-core/src/threads/schemas/handlers.rs
index 8b9bdc4014..469ac26448 100644
--- a/crates/openhuman-core/src/threads/schemas/handlers.rs
+++ b/crates/openhuman-core/src/threads/schemas/handlers.rs
@@ -45,49 +45,70 @@ pub(super) fn handle_create_new(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-pub(super) fn handle_messages_list(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_messages_list(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<ConversationMessagesRequest>(params)?;
to_json(ops::messages_list(p).await?)
})
}
-pub(super) fn handle_message_append(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_message_append(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<AppendConversationMessageRequest>(params)?;
to_json(ops::message_append(p).await?)
})
}
-pub(super) fn handle_generate_title(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_generate_title(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<GenerateConversationThreadTitleRequest>(params)?;
to_json(ops::thread_generate_title(p).await?)
})
}
-pub(super) fn handle_update_labels(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_labels(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<UpdateConversationThreadLabelsRequest>(params)?;
to_json(ops::thread_update_labels(p).await?)
})
}
-pub(super) fn handle_update_title(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_title(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<UpdateConversationThreadTitleRequest>(params)?;
to_json(ops::thread_update_title(p).await?)
})
}
-pub(super) fn handle_update_working_dir(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_update_working_dir(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<UpdateConversationThreadWorkingDirRequest>(params)?;
to_json(ops::thread_update_working_dir(p).await?)
})
}
-pub(super) fn handle_message_update(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_message_update(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<UpdateConversationMessageRequest>(params)?;
to_json(ops::message_update(p).await?)
@@ -105,46 +126,67 @@ pub(super) fn handle_purge(_ctx: DispatchCtx, _params: Map<String, Value>) -> Co
Box::pin(async move { to_json(ops::threads_purge(EmptyRequest {}).await?) })
}
-pub(super) fn handle_turn_state_get(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_turn_state_get(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<GetTurnStateRequest>(params)?;
to_json(ops::turn_state_get(p).await?)
})
}
-pub(super) fn handle_turn_state_list(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_turn_state_list(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move { to_json(ops::turn_state_list(EmptyRequest {}).await?) })
}
-pub(super) fn handle_turn_state_history(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_turn_state_history(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<GetTurnStateRequest>(params)?;
to_json(ops::turn_state_history(p).await?)
})
}
-pub(super) fn handle_turn_state_get_turn(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_turn_state_get_turn(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<GetTurnStateForRequestRequest>(params)?;
to_json(ops::turn_state_get_turn(p).await?)
})
}
-pub(super) fn handle_turn_state_clear(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_turn_state_clear(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<ClearTurnStateRequest>(params)?;
to_json(ops::turn_state_clear(p).await?)
})
}
-pub(super) fn handle_token_usage(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_token_usage(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<ops::ThreadTokenUsageRequest>(params)?;
to_json(ops::token_usage(p).await?)
})
}
-pub(super) fn handle_transcript_get(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_transcript_get(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<ops::TranscriptGetRequest>(params)?;
to_json(ops::transcript_get(p).await?)
@@ -172,7 +214,10 @@ pub(super) fn handle_search(_ctx: DispatchCtx, params: Map<String, Value>) -> Co
})
}
-pub(super) fn handle_edit_message(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_edit_message(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = parse::<ops::EditMessageRequest>(params)?;
to_json(ops::edit_message(p).await.map_err(|e| e.to_string())?)
diff --git a/crates/openhuman-core/src/tools/registry/schemas_tests.rs b/crates/openhuman-core/src/tools/registry/schemas_tests.rs
index 30be0194b7..def6a1b9a6 100644
--- a/crates/openhuman-core/src/tools/registry/schemas_tests.rs
+++ b/crates/openhuman-core/src/tools/registry/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use serde_json::json;
#[test]
@@ -50,7 +50,9 @@ fn required_tool_id_rejects_wrong_type() {
#[tokio::test]
async fn handle_list_returns_registry_object() {
- let value = handle_list(DispatchCtx::process_default(), Map::new()).await.expect("list json");
+ let value = handle_list(DispatchCtx::process_default(), Map::new())
+ .await
+ .expect("list json");
let tools = value
.get("tools")
.and_then(Value::as_array)
@@ -75,7 +77,9 @@ async fn handle_get_returns_one_registry_entry() {
let mut params = Map::new();
params.insert("tool_id".to_string(), json!("tools.web_search"));
- let value = handle_get(DispatchCtx::process_default(), params).await.expect("get json");
+ let value = handle_get(DispatchCtx::process_default(), params)
+ .await
+ .expect("get json");
assert_eq!(
value.get("tool_id").and_then(Value::as_str),
Some("tools.web_search")
diff --git a/crates/openhuman-core/src/tools/schemas/composio.rs b/crates/openhuman-core/src/tools/schemas/composio.rs
index f56a14abd6..847625ddae 100644
--- a/crates/openhuman-core/src/tools/schemas/composio.rs
+++ b/crates/openhuman-core/src/tools/schemas/composio.rs
@@ -7,7 +7,10 @@ use crate::config::rpc as config_rpc;
use crate::core::all::ControllerFuture;
use crate::core::Outcome;
-pub(super) fn handle_composio_execute(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_composio_execute(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let action = params
.get("action")
diff --git a/crates/openhuman-core/src/tools/schemas/web_search.rs b/crates/openhuman-core/src/tools/schemas/web_search.rs
index 0cf28259b5..14d5404b11 100644
--- a/crates/openhuman-core/src/tools/schemas/web_search.rs
+++ b/crates/openhuman-core/src/tools/schemas/web_search.rs
@@ -158,7 +158,10 @@ pub(super) fn handle_web_search(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-pub(super) fn handle_searxng_search(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_searxng_search(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let arguments = search_arguments(&params, Some("searxng"))?;
run_role_tool(
@@ -191,7 +194,10 @@ pub(super) fn handle_web_answer(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-pub(super) fn handle_web_contents(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(super) fn handle_web_contents(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let urls = optional_string_array(&params, "urls")?;
if urls.is_empty() {
diff --git a/crates/openhuman-core/src/voice/live/schemas_tests.rs b/crates/openhuman-core/src/voice/live/schemas_tests.rs
index d6a97935c3..8f8650ea09 100644
--- a/crates/openhuman-core/src/voice/live/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/live/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
#[test]
fn registers_four_live_controllers_in_the_voice_namespace() {
@@ -27,12 +27,15 @@ fn registers_four_live_controllers_in_the_voice_namespace() {
#[tokio::test]
async fn handlers_reject_bad_params() {
let bad = |v: serde_json::Value| v.as_object().unwrap().clone();
- assert!(handle_live_test_provider(DispatchCtx::process_default(), bad(serde_json::json!({})))
- .await
- .is_err());
assert!(
- handle_live_settings_set(DispatchCtx::process_default(), bad(serde_json::json!({"gemini": 5})))
+ handle_live_test_provider(DispatchCtx::process_default(), bad(serde_json::json!({})))
.await
.is_err()
);
+ assert!(handle_live_settings_set(
+ DispatchCtx::process_default(),
+ bad(serde_json::json!({"gemini": 5}))
+ )
+ .await
+ .is_err());
}
diff --git a/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs b/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
index 2b72d67b1d..a37d8dc7fe 100644
--- a/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
+++ b/crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
@@ -19,7 +19,10 @@ use crate::voice::schemas::params::{
// Provider configuration handlers
// ---------------------------------------------------------------------------
-pub(crate) fn handle_voice_set_providers(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_set_providers(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<SetProvidersParams>(params)?;
let mut config = config_rpc::load_config_with_timeout().await?;
@@ -79,7 +82,8 @@ pub(crate) fn handle_voice_set_providers(_ctx: DispatchCtx, params: Map<String,
})
}
-pub(crate) fn handle_voice_update_provider_settings(_ctx: DispatchCtx,
+pub(crate) fn handle_voice_update_provider_settings(
+ _ctx: DispatchCtx,
params: Map<String, Value>,
) -> ControllerFuture {
Box::pin(async move {
@@ -233,7 +237,10 @@ pub(crate) fn handle_voice_update_provider_settings(_ctx: DispatchCtx,
})
}
-pub(crate) fn handle_voice_list_models(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_list_models(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<VoiceListModelsParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -298,7 +305,10 @@ pub(crate) fn handle_voice_list_models(_ctx: DispatchCtx, params: Map<String, Va
})
}
-pub(crate) fn handle_voice_test_provider(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_test_provider(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<VoiceTestProviderParams>(params)?;
let config = config_rpc::load_config_with_timeout().await?;
@@ -414,7 +424,10 @@ pub(crate) fn handle_voice_test_provider(_ctx: DispatchCtx, params: Map<String,
// Voice server lifecycle handlers
// ---------------------------------------------------------------------------
-pub(crate) fn handle_voice_server_start(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_server_start(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
use crate::voice::server::{global_server, VoiceServerConfig};
use tinyvoice_bus::hotkey::ActivationMode;
@@ -500,7 +513,10 @@ pub(crate) fn handle_voice_server_start(_ctx: DispatchCtx, params: Map<String, V
})
}
-pub(crate) fn handle_voice_server_stop(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_server_stop(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
if let Some(server) = crate::voice::server::try_global_server() {
server.stop().await;
@@ -521,7 +537,10 @@ pub(crate) fn handle_voice_server_stop(_ctx: DispatchCtx, _params: Map<String, V
})
}
-pub(crate) fn handle_voice_server_status(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_server_status(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
if let Some(server) = crate::voice::server::try_global_server() {
let status = server.status().await;
@@ -543,7 +562,10 @@ pub(crate) fn handle_voice_server_status(_ctx: DispatchCtx, _params: Map<String,
// Overlay STT notify handler
// ---------------------------------------------------------------------------
-pub(crate) fn handle_overlay_stt_notify(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_overlay_stt_notify(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<OverlaySttNotifyParams>(params)?;
log::debug!(
diff --git a/crates/openhuman-core/src/voice/schemas/handlers/transcribe_tts.rs b/crates/openhuman-core/src/voice/schemas/handlers/transcribe_tts.rs
index 2f0c4c6d96..c5b0514ae2 100644
--- a/crates/openhuman-core/src/voice/schemas/handlers/transcribe_tts.rs
+++ b/crates/openhuman-core/src/voice/schemas/handlers/transcribe_tts.rs
@@ -14,7 +14,10 @@ use crate::voice::schemas::params::{
TranscribeParams, TtsDispatchParams, TtsParams,
};
-pub(crate) fn handle_voice_status(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_status(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::voice::voice_status(&config).await?)
@@ -23,14 +26,20 @@ pub(crate) fn handle_voice_status(_ctx: DispatchCtx, _params: Map<String, Value>
/// Mint a realtime voice-agent signed WebSocket URL (#5399). Takes no params —
/// the agent is server-configured; the desktop only asks for a fresh signed URL.
-pub(crate) fn handle_voice_agent_signed_url(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_agent_signed_url(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::voice::realtime::mint_voice_agent_signed_url(&config).await?)
})
}
-pub(crate) fn handle_voice_transcribe(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_transcribe(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<TranscribeParams>(params)?;
@@ -46,7 +55,10 @@ pub(crate) fn handle_voice_transcribe(_ctx: DispatchCtx, params: Map<String, Val
})
}
-pub(crate) fn handle_voice_transcribe_bytes(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_transcribe_bytes(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<TranscribeBytesParams>(params)?;
@@ -71,7 +83,10 @@ pub(crate) fn handle_voice_tts(_ctx: DispatchCtx, params: Map<String, Value>) ->
})
}
-pub(crate) fn handle_voice_reply_synthesize(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_reply_synthesize(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<ReplySynthesizeParams>(params)?;
@@ -116,7 +131,10 @@ pub(crate) fn handle_voice_reply_synthesize(_ctx: DispatchCtx, params: Map<Strin
})
}
-pub(crate) fn handle_voice_cloud_transcribe(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_cloud_transcribe(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<CloudTranscribeParams>(params)?;
@@ -133,7 +151,10 @@ pub(crate) fn handle_voice_cloud_transcribe(_ctx: DispatchCtx, params: Map<Strin
})
}
-pub(crate) fn handle_voice_stt_dispatch(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_stt_dispatch(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<SttDispatchParams>(params)?;
@@ -174,7 +195,10 @@ pub(crate) fn handle_voice_stt_dispatch(_ctx: DispatchCtx, params: Map<String, V
})
}
-pub(crate) fn handle_voice_tts_dispatch(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+pub(crate) fn handle_voice_tts_dispatch(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let p = deserialize_params::<TtsDispatchParams>(params)?;
diff --git a/crates/openhuman-core/src/voice/schemas_tests.rs b/crates/openhuman-core/src/voice/schemas_tests.rs
index 03acdb7f85..0f93e1eb32 100644
--- a/crates/openhuman-core/src/voice/schemas_tests.rs
+++ b/crates/openhuman-core/src/voice/schemas_tests.rs
@@ -1,5 +1,5 @@
-use crate::core::runtime::DispatchCtx;
use super::*;
+use crate::core::runtime::DispatchCtx;
use serde_json::json;
#[test]
@@ -240,7 +240,9 @@ async fn overlay_notify_cancelled_publishes_released() {
use crate::voice::dictation_listener::subscribe_dictation_events;
let mut rx = subscribe_dictation_events();
let params = Map::from_iter([("state".to_string(), json!("cancelled"))]);
- let result = handle_overlay_stt_notify(DispatchCtx::process_default(), params).await.expect("ok");
+ let result = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
+ .await
+ .expect("ok");
assert_eq!(result["ok"], true);
let mut saw_release = false;
while let Ok(evt) = rx.try_recv() {
@@ -255,7 +257,9 @@ async fn overlay_notify_cancelled_publishes_released() {
#[tokio::test]
async fn overlay_notify_unknown_state_errors() {
let params = Map::from_iter([("state".to_string(), json!("mystery"))]);
- let err = handle_overlay_stt_notify(DispatchCtx::process_default(), params).await.unwrap_err();
+ let err = handle_overlay_stt_notify(DispatchCtx::process_default(), params)
+ .await
+ .unwrap_err();
// The deserialize layer rejects the unknown variant with a detailed
// enum message — just assert an error surfaced.
assert!(!err.is_empty());
@@ -263,7 +267,9 @@ async fn overlay_notify_unknown_state_errors() {
#[tokio::test]
async fn overlay_notify_missing_state_errors() {
- let err = handle_overlay_stt_notify(DispatchCtx::process_default(), Map::new()).await.unwrap_err();
+ let err = handle_overlay_stt_notify(DispatchCtx::process_default(), Map::new())
+ .await
+ .unwrap_err();
assert!(!err.is_empty());
}
diff --git a/crates/openhuman-core/src/web3/bridge/schemas.rs b/crates/openhuman-core/src/web3/bridge/schemas.rs
index 374d0d0ec0..c76de358d9 100644
--- a/crates/openhuman-core/src/web3/bridge/schemas.rs
+++ b/crates/openhuman-core/src/web3/bridge/schemas.rs
@@ -95,9 +95,14 @@ pub fn schema(function: &str) -> ControllerSchema {
fn handle_quote(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
- let quote = web3_service::quote(&config, None, methods::WEB3_BRIDGE_QUOTE, Value::Object(params))
- .await
- .map_err(|error| error.to_string())?;
+ let quote = web3_service::quote(
+ &config,
+ None,
+ methods::WEB3_BRIDGE_QUOTE,
+ Value::Object(params),
+ )
+ .await
+ .map_err(|error| error.to_string())?;
Outcome::new(quote, vec!["web3 bridge prepared".to_string()]).into_cli_compatible_json()
})
}
diff --git a/crates/openhuman-core/src/web3/dapp/schemas.rs b/crates/openhuman-core/src/web3/dapp/schemas.rs
index 8577c0f62a..d8d9defa80 100644
--- a/crates/openhuman-core/src/web3/dapp/schemas.rs
+++ b/crates/openhuman-core/src/web3/dapp/schemas.rs
@@ -78,9 +78,14 @@ pub fn schema(function: &str) -> ControllerSchema {
fn handle_call(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
- let quote = web3_service::quote(&config, None, methods::WEB3_DAPP_QUOTE, Value::Object(params))
- .await
- .map_err(|error| error.to_string())?;
+ let quote = web3_service::quote(
+ &config,
+ None,
+ methods::WEB3_DAPP_QUOTE,
+ Value::Object(params),
+ )
+ .await
+ .map_err(|error| error.to_string())?;
Outcome::new(quote, vec!["web3 dapp call prepared".to_string()]).into_cli_compatible_json()
})
}
diff --git a/crates/openhuman-core/src/web3/swap/schemas.rs b/crates/openhuman-core/src/web3/swap/schemas.rs
index 408e9ec4ef..300d921d1d 100644
--- a/crates/openhuman-core/src/web3/swap/schemas.rs
+++ b/crates/openhuman-core/src/web3/swap/schemas.rs
@@ -106,9 +106,14 @@ fn unknown_schema() -> ControllerSchema {
fn handle_quote(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
- let quote = web3_service::quote(&config, None, methods::WEB3_SWAP_QUOTE, Value::Object(params))
- .await
- .map_err(|error| error.to_string())?;
+ let quote = web3_service::quote(
+ &config,
+ None,
+ methods::WEB3_SWAP_QUOTE,
+ Value::Object(params),
+ )
+ .await
+ .map_err(|error| error.to_string())?;
Outcome::new(quote, vec!["web3 swap prepared".to_string()]).into_cli_compatible_json()
})
}
diff --git a/crates/openhuman-core/src/web3/wallet/schemas.rs b/crates/openhuman-core/src/web3/wallet/schemas.rs
index a84fd8e162..03f53261a7 100644
--- a/crates/openhuman-core/src/web3/wallet/schemas.rs
+++ b/crates/openhuman-core/src/web3/wallet/schemas.rs
@@ -485,7 +485,9 @@ fn handle_prepare_transfer(_ctx: DispatchCtx, params: Map<String, Value>) -> Con
Box::pin(async move {
let parsed: PrepareTransferParams = serde_json::from_value(Value::Object(params))
.map_err(|e| format!("invalid params: {e}"))?;
- prepare_transfer(parsed, None).await?.into_cli_compatible_json()
+ prepare_transfer(parsed, None)
+ .await?
+ .into_cli_compatible_json()
})
}
@@ -493,7 +495,9 @@ fn handle_execute_prepared(_ctx: DispatchCtx, params: Map<String, Value>) -> Con
Box::pin(async move {
let parsed: ExecutePreparedParams = serde_json::from_value(Value::Object(params))
.map_err(|e| format!("invalid params: {e}"))?;
- execute_prepared(parsed, None).await?.into_cli_compatible_json()
+ execute_prepared(parsed, None)
+ .await?
+ .into_cli_compatible_json()
})
}
@@ -527,7 +531,10 @@ fn handle_lookup_tx(_ctx: DispatchCtx, params: Map<String, Value>) -> Controller
})
}
-fn handle_reveal_recovery_phrase(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_reveal_recovery_phrase(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
crate::web3::wallet::reveal_recovery_phrase()
.await?
@@ -555,7 +562,10 @@ fn handle_validate_mnemonic(_ctx: DispatchCtx, params: Map<String, Value>) -> Co
})
}
-fn handle_derive_recovery_material(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_derive_recovery_material(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let parsed: RecoveryPhraseParams = serde_json::from_value(Value::Object(params))
.map_err(|e| format!("invalid params: {e}"))?;
diff --git a/crates/openhuman-rpc/src/server/http/rpc_handler.rs b/crates/openhuman-rpc/src/server/http/rpc_handler.rs
index 967686be86..59b8a918af 100644
--- a/crates/openhuman-rpc/src/server/http/rpc_handler.rs
+++ b/crates/openhuman-rpc/src/server/http/rpc_handler.rs
@@ -1,9 +1,9 @@
//! `POST /rpc`: the JSON-RPC 2.0 endpoint.
use axum::extract::State;
-use axum::Extension;
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
+use axum::Extension;
use axum::Json;
use crate::core_host::core::invoke::invoke_method;
diff --git a/crates/openhuman-rpc/src/server/saas_gateway.rs b/crates/openhuman-rpc/src/server/saas_gateway.rs
index ee871b304f..77f5a4076a 100644
--- a/crates/openhuman-rpc/src/server/saas_gateway.rs
+++ b/crates/openhuman-rpc/src/server/saas_gateway.rs
@@ -131,7 +131,8 @@ fn bearer(req: &Request) -> Option<&str> {
/// `rpc_handler` hands to the dispatcher, and (until every reader has moved off
/// the ambient context, #7801) scopes the same context onto the request task.
pub(crate) async fn dispatch_in(ctx: Arc<CoreContext>, mut req: Request, next: Next) -> Response {
- req.extensions_mut().insert(DispatchCtx::new(Arc::clone(&ctx)));
+ req.extensions_mut()
+ .insert(DispatchCtx::new(Arc::clone(&ctx)));
CoreContext::scope(ctx, next.run(req)).await
}
diff --git a/crates/openhuman-rpc/src/server/serve.rs b/crates/openhuman-rpc/src/server/serve.rs
index 38a56bdc30..88d742526e 100644
--- a/crates/openhuman-rpc/src/server/serve.rs
+++ b/crates/openhuman-rpc/src/server/serve.rs
@@ -150,9 +150,7 @@ pub async fn serve(
router.layer(axum::middleware::from_fn(
move |req: axum::extract::Request, next: axum::middleware::Next| {
let ctx = Arc::clone(&ctx);
- async move {
- super::saas_gateway::dispatch_in(ctx, req, next).await
- }
+ async move { super::saas_gateway::dispatch_in(ctx, req, next).await }
},
))
};
diff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs
index 9685813855..e96d29190f 100644
--- a/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/schemas.rs
@@ -44,7 +44,10 @@ pub fn announcements_schemas(function: &str) -> ControllerSchema {
}
}
-fn handle_announcements_get_latest(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_announcements_get_latest(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::hosted::announcements::get_latest_announcement(&config).await?)
diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs
index a2642b1226..3961c1f11c 100644
--- a/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/billing/schemas.rs
@@ -401,7 +401,10 @@ fn handle_billing_get_summary(_ctx: DispatchCtx, _params: Map<String, Value>) ->
})
}
-fn handle_billing_get_current_plan(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_get_current_plan(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::hosted::billing::get_current_plan(&config).await?)
@@ -423,7 +426,10 @@ fn handle_billing_purchase_plan(_ctx: DispatchCtx, params: Map<String, Value>) -
})
}
-fn handle_billing_create_portal_session(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_create_portal_session(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::hosted::billing::create_portal_session(&config).await?)
@@ -441,7 +447,10 @@ fn handle_billing_top_up(_ctx: DispatchCtx, params: Map<String, Value>) -> Contr
})
}
-fn handle_billing_create_coinbase_charge(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_create_coinbase_charge(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<CoinbaseChargeParams>(params)?;
@@ -456,7 +465,10 @@ fn handle_billing_create_coinbase_charge(_ctx: DispatchCtx, params: Map<String,
})
}
-fn handle_billing_get_transactions(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_get_transactions(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = if params.is_empty() {
@@ -471,14 +483,20 @@ fn handle_billing_get_transactions(_ctx: DispatchCtx, params: Map<String, Value>
})
}
-fn handle_billing_get_auto_recharge(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_get_auto_recharge(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::hosted::billing::get_auto_recharge(&config).await?)
})
}
-fn handle_billing_update_auto_recharge(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_update_auto_recharge(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<JsonValueParams>(params)?;
@@ -493,7 +511,10 @@ fn handle_billing_get_cards(_ctx: DispatchCtx, _params: Map<String, Value>) -> C
})
}
-fn handle_billing_create_setup_intent(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_billing_create_setup_intent(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::hosted::billing::create_setup_intent(&config).await?)
diff --git a/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs
index a766e76ea9..b5ea11ede7 100644
--- a/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs
@@ -101,7 +101,10 @@ pub fn channel_link_schemas(function: &str) -> ControllerSchema {
}
}
-fn handle_auth_create_channel_link_token(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_create_channel_link_token(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<AuthCreateChannelLinkTokenParams>(params)?;
diff --git a/crates/openhuman-tinyhumans/src/hosted/oauth/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/oauth/schemas.rs
index d88d456e1e..f145667921 100644
--- a/crates/openhuman-tinyhumans/src/hosted/oauth/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/oauth/schemas.rs
@@ -157,14 +157,20 @@ fn handle_auth_oauth_connect(_ctx: DispatchCtx, params: Map<String, Value>) -> C
})
}
-fn handle_auth_oauth_list_integrations(_ctx: DispatchCtx, _params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_oauth_list_integrations(
+ _ctx: DispatchCtx,
+ _params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
to_json(crate::hosted::oauth::oauth_list_integrations(&config).await?)
})
}
-fn handle_auth_oauth_fetch_integration_tokens(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_oauth_fetch_integration_tokens(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<AuthOauthIntegrationTokensParams>(params)?;
@@ -179,7 +185,10 @@ fn handle_auth_oauth_fetch_integration_tokens(_ctx: DispatchCtx, params: Map<Str
})
}
-fn handle_auth_oauth_revoke_integration(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_oauth_revoke_integration(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<AuthOauthRevokeParams>(params)?;
@@ -190,7 +199,10 @@ fn handle_auth_oauth_revoke_integration(_ctx: DispatchCtx, params: Map<String, V
})
}
-fn handle_auth_oauth_fetch_client_key(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_auth_oauth_fetch_client_key(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<AuthOauthClientKeyParams>(params)?;
diff --git a/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs
index aff99770cc..962257f71f 100644
--- a/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/team/schemas.rs
@@ -448,7 +448,10 @@ fn handle_team_remove_member(_ctx: DispatchCtx, params: Map<String, Value>) -> C
})
}
-fn handle_team_change_member_role(_ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture {
+fn handle_team_change_member_role(
+ _ctx: DispatchCtx,
+ params: Map<String, Value>,
+) -> ControllerFuture {
Box::pin(async move {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<ChangeRoleParams>(params)?;
diff --git a/tests/raw_coverage/dispatch_param_validation_e2e.rs b/tests/raw_coverage/dispatch_param_validation_e2e.rs
index b14baee8f8..7c2fb4f0dd 100644
--- a/tests/raw_coverage/dispatch_param_validation_e2e.rs
+++ b/tests/raw_coverage/dispatch_param_validation_e2e.rs
@@ -45,9 +45,14 @@ async fn missing_required_param_is_refused_with_the_schema_comment() {
.expect("`id` input")
.comment;
- let err = dispatch(DispatchCtx::process_default(), state(), "openhuman.run_ledger_get", json!({}))
- .await
- .expect_err("`id` is required");
+ let err = dispatch(
+ DispatchCtx::process_default(),
+ state(),
+ "openhuman.run_ledger_get",
+ json!({}),
+ )
+ .await
+ .expect_err("`id` is required");
assert_eq!(err, format!("missing required param 'id': {comment}"));
@@ -71,7 +76,10 @@ async fn unknown_param_is_refused_by_the_gate_alone() {
.await
.expect_err("unknown params are refused");
- assert_eq!(err, "unknown param 'nonsense_param' for memory.engines_list");
+ assert_eq!(
+ err,
+ "unknown param 'nonsense_param' for memory.engines_list"
+ );
}
/// Declared types are enforced at the same gate, so a handler's own
@@ -100,9 +108,14 @@ async fn mistyped_param_is_refused_with_the_declared_type() {
/// directory call controllers.
#[tokio::test]
async fn handler_refusal_differs_from_the_dispatcher_refusal_for_an_absent_param() {
- let dispatched = dispatch(DispatchCtx::process_default(), state(), "openhuman.memory_recall", json!({}))
- .await
- .expect_err("`question` is required");
+ let dispatched = dispatch(
+ DispatchCtx::process_default(),
+ state(),
+ "openhuman.memory_recall",
+ json!({}),
+ )
+ .await
+ .expect_err("`question` is required");
assert!(
dispatched.starts_with("missing required param 'question': "),
"got: {dispatched}"
diff --git a/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs b/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
index 8ee9723ed8..3ab3f5768a 100644
--- a/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
@@ -45,10 +45,10 @@
//! serialization mechanism, the same reasoning as `tests/agent_harness_e2e.rs:8-12`.
#![allow(clippy::await_holding_lock)]
-use openhuman_core::core::runtime::DispatchCtx;
use crate::env_guard::EnvVarGuard;
+use openhuman_core::core::runtime::DispatchCtx;
use std::path::{Path, PathBuf};
-use std::sync::{OnceLock};
+use std::sync::OnceLock;
use openhuman_core::config::Config;
use openhuman_core::core::all::RegisteredController;
@@ -67,7 +67,8 @@ fn env_lock() -> tokio::sync::MutexGuard<'static, ()> {
async fn env_lock_async() -> tokio::sync::MutexGuard<'static, ()> {
ENV_LOCK
.get_or_init(|| tokio::sync::Mutex::new(()))
- .lock().await
+ .lock()
+ .await
}
/// Point the Ollama health probe at a closed loopback port and clear the
diff --git a/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs b/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
index e6a706e482..c593c9d042 100644
--- a/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/tool_registry_approval_raw_coverage_e2e.rs
@@ -5,9 +5,9 @@
//! direct public API calls cover persistence/redaction/provider branches that
//! are otherwise only indirectly reachable from the controllers.
-use openhuman_core::core::runtime::DispatchCtx;
use crate::env_guard::EnvVarGuard;
use crate::rpc_harness::{error_message, payload};
+use openhuman_core::core::runtime::DispatchCtx;
use std::path::Path;
use std::sync::{Arc, OnceLock};
use std::time::{Duration, Instant};
@@ -550,7 +550,9 @@ async fn approval_schema_handlers_validate_params_and_surface_empty_gate_state()
.find(|controller| controller.schema.function == "list_pending")
.expect("list pending controller")
.handler;
- let list_value = list_handler(DispatchCtx::process_default(), Map::new()).await.expect("list pending value");
+ let list_value = list_handler(DispatchCtx::process_default(), Map::new())
+ .await
+ .expect("list pending value");
assert!(list_value
.get("result")
.or(Some(&list_value))
@@ -564,24 +566,30 @@ async fn approval_schema_handlers_validate_params_and_surface_empty_gate_state()
.handler;
let mut invalid_limit = Map::new();
invalid_limit.insert("limit".to_string(), json!("ten"));
- assert!(recent_handler(DispatchCtx::process_default(), invalid_limit)
- .await
- .expect_err("string limit")
- .contains("expected unsigned integer"));
+ assert!(
+ recent_handler(DispatchCtx::process_default(), invalid_limit)
+ .await
+ .expect_err("string limit")
+ .contains("expected unsigned integer")
+ );
for invalid in [json!(true), json!([]), json!({ "limit": 10 })] {
let mut invalid_limit = Map::new();
invalid_limit.insert("limit".to_string(), invalid);
- assert!(recent_handler(DispatchCtx::process_default(), invalid_limit)
- .await
- .expect_err("non-numeric limit")
- .contains("expected unsigned integer"));
+ assert!(
+ recent_handler(DispatchCtx::process_default(), invalid_limit)
+ .await
+ .expect_err("non-numeric limit")
+ .contains("expected unsigned integer")
+ );
}
let mut negative_limit = Map::new();
negative_limit.insert("limit".to_string(), json!(-1));
- assert!(recent_handler(DispatchCtx::process_default(), negative_limit)
- .await
- .expect_err("negative limit")
- .contains("expected unsigned integer"));
+ assert!(
+ recent_handler(DispatchCtx::process_default(), negative_limit)
+ .await
+ .expect_err("negative limit")
+ .contains("expected unsigned integer")
+ );
let mut null_limit = Map::new();
null_limit.insert("limit".to_string(), Value::Null);
let recent_value = recent_handler(DispatchCtx::process_default(), null_limit)
@@ -605,10 +613,12 @@ async fn approval_schema_handlers_validate_params_and_surface_empty_gate_state()
let mut numeric_request = Map::new();
numeric_request.insert("request_id".to_string(), json!(42));
numeric_request.insert("decision".to_string(), json!("deny"));
- assert!(decide_handler(DispatchCtx::process_default(), numeric_request)
- .await
- .expect_err("numeric request id")
- .contains("expected string"));
+ assert!(
+ decide_handler(DispatchCtx::process_default(), numeric_request)
+ .await
+ .expect_err("numeric request id")
+ .contains("expected string")
+ );
for invalid in [
Value::Null,
json!(false),
@@ -618,55 +628,69 @@ async fn approval_schema_handlers_validate_params_and_surface_empty_gate_state()
let mut invalid_request = Map::new();
invalid_request.insert("request_id".to_string(), invalid);
invalid_request.insert("decision".to_string(), json!("deny"));
- assert!(decide_handler(DispatchCtx::process_default(), invalid_request)
- .await
- .expect_err("non-string request id")
- .contains("expected string"));
+ assert!(
+ decide_handler(DispatchCtx::process_default(), invalid_request)
+ .await
+ .expect_err("non-string request id")
+ .contains("expected string")
+ );
}
let mut numeric_decision = Map::new();
numeric_decision.insert("request_id".to_string(), json!("missing"));
numeric_decision.insert("decision".to_string(), json!(42));
- assert!(decide_handler(DispatchCtx::process_default(), numeric_decision)
- .await
- .expect_err("numeric decision")
- .contains("expected string"));
+ assert!(
+ decide_handler(DispatchCtx::process_default(), numeric_decision)
+ .await
+ .expect_err("numeric decision")
+ .contains("expected string")
+ );
let mut invalid_decision = Map::new();
invalid_decision.insert("request_id".to_string(), json!("missing"));
invalid_decision.insert("decision".to_string(), json!("maybe"));
- assert!(decide_handler(DispatchCtx::process_default(), invalid_decision)
- .await
- .expect_err("invalid decision")
- .contains("approve_once|approve_always_for_tool|approve_always_for_flow|deny"));
+ assert!(
+ decide_handler(DispatchCtx::process_default(), invalid_decision)
+ .await
+ .expect_err("invalid decision")
+ .contains("approve_once|approve_always_for_tool|approve_always_for_flow|deny")
+ );
let preauthorize_handler = controllers
.iter()
.find(|controller| controller.schema.function == "preauthorize_flow")
.expect("preauthorize flow controller")
.handler;
- assert!(preauthorize_handler(DispatchCtx::process_default(), Map::new())
- .await
- .expect_err("missing flow id")
- .contains("missing required param 'flow_id'"));
+ assert!(
+ preauthorize_handler(DispatchCtx::process_default(), Map::new())
+ .await
+ .expect_err("missing flow id")
+ .contains("missing required param 'flow_id'")
+ );
let mut missing_tools = Map::new();
missing_tools.insert("flow_id".to_string(), json!("flow-1"));
- assert!(preauthorize_handler(DispatchCtx::process_default(), missing_tools)
- .await
- .expect_err("missing tool names")
- .contains("missing required param 'tool_names'"));
+ assert!(
+ preauthorize_handler(DispatchCtx::process_default(), missing_tools)
+ .await
+ .expect_err("missing tool names")
+ .contains("missing required param 'tool_names'")
+ );
let mut non_array_tools = Map::new();
non_array_tools.insert("flow_id".to_string(), json!("flow-1"));
non_array_tools.insert("tool_names".to_string(), json!("slack_post"));
- assert!(preauthorize_handler(DispatchCtx::process_default(), non_array_tools)
- .await
- .expect_err("non-array tool names")
- .contains("expected array of strings"));
+ assert!(
+ preauthorize_handler(DispatchCtx::process_default(), non_array_tools)
+ .await
+ .expect_err("non-array tool names")
+ .contains("expected array of strings")
+ );
let mut mixed_tools = Map::new();
mixed_tools.insert("flow_id".to_string(), json!("flow-1"));
mixed_tools.insert("tool_names".to_string(), json!(["ok", 42]));
- assert!(preauthorize_handler(DispatchCtx::process_default(), mixed_tools)
- .await
- .expect_err("non-string tool name entry")
- .contains("expected string"));
+ assert!(
+ preauthorize_handler(DispatchCtx::process_default(), mixed_tools)
+ .await
+ .expect_err("non-string tool name entry")
+ .contains("expected string")
+ );
// Success-path behavior (gate-absent tolerance, idempotent grants, audit
// rows) is pinned by the unit tests in `approval::rpc`/`approval::store`;
// asserting it here would be order-dependent on whether a sibling test