Skip to content

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

chore(mcp): reformat long lines and reorder module declarations

Steven Enamakelcd0b5985b4b9
diff --git a/crates/openhuman-core/src/mcp/server/handler.rs b/crates/openhuman-core/src/mcp/server/handler.rs
index 215a9d3b35..66306b783c 100644
--- a/crates/openhuman-core/src/mcp/server/handler.rs
+++ b/crates/openhuman-core/src/mcp/server/handler.rs
@@ -64,8 +64,7 @@ impl McpServerHandler for OpenHumanMcpHandler {
name: &'a str,
arguments: Map<String, Value>,
) -> BoxFuture<'a, Result<Value, ToolCallError>> {
- let depth =
- subagent_depth::parse_header(ctx.header(subagent_depth::HEADER_SUBAGENT_DEPTH));
+ let depth = subagent_depth::parse_header(ctx.header(subagent_depth::HEADER_SUBAGENT_DEPTH));
log::trace!(
"[mcp_server] tools/call tool={name} client_source_type={} chain_depth={depth}",
ctx.source_type()
diff --git a/crates/openhuman-core/src/mcp/server/handler_tests.rs b/crates/openhuman-core/src/mcp/server/handler_tests.rs
index eaec8d94d8..b6b8daeb82 100644
--- a/crates/openhuman-core/src/mcp/server/handler_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/handler_tests.rs
@@ -27,8 +27,16 @@ async fn list_tools_advertises_the_base_catalog_with_annotations() {
let tools = OpenHumanMcpHandler
.list_tools(&context(RequestHeaders::new()))
.await;
- let names = tools.iter().map(|tool| tool.name.as_str()).collect::<Vec<_>>();
- for expected in ["core.list_tools", "agent.run_subagent", "memory.search", "tree.tag"] {
+ let names = tools
+ .iter()
+ .map(|tool| tool.name.as_str())
+ .collect::<Vec<_>>();
+ for expected in [
+ "core.list_tools",
+ "agent.run_subagent",
+ "memory.search",
+ "tree.tag",
+ ] {
assert!(names.contains(&expected), "missing {expected}: {names:?}");
}
assert!(tools
@@ -46,7 +54,10 @@ async fn resources_are_the_bundled_prompt_catalog() {
.read_resource("openhuman://prompts/identity")
.await
.expect("identity resource");
- assert_eq!(identity["contents"][0]["uri"], "openhuman://prompts/identity");
+ assert_eq!(
+ identity["contents"][0]["uri"],
+ "openhuman://prompts/identity"
+ );
let err = OpenHumanMcpHandler
.read_resource("openhuman://prompts/nope")
.await
diff --git a/crates/openhuman-core/src/mcp/server/mod.rs b/crates/openhuman-core/src/mcp/server/mod.rs
index bd26c07cd4..fecc6528a4 100644
--- a/crates/openhuman-core/src/mcp/server/mod.rs
+++ b/crates/openhuman-core/src/mcp/server/mod.rs
@@ -27,10 +27,10 @@
// `local`/`stdio` gate their own HTTP-serve paths so `openhuman mcp` (stdio)
// and the Claude-Code in-process MCP bridge still degrade gracefully when
// `http-server` is off.
-#[cfg(all(feature = "mcp", feature = "http-server"))]
-mod http;
#[cfg(feature = "mcp")]
mod handler;
+#[cfg(all(feature = "mcp", feature = "http-server"))]
+mod http;
#[cfg(feature = "mcp")]
mod local;
#[cfg(feature = "mcp")]
diff --git a/crates/openhuman-core/src/mcp/server/tools/params.rs b/crates/openhuman-core/src/mcp/server/tools/params.rs
index 51501162df..8b5d10c6cd 100644
--- a/crates/openhuman-core/src/mcp/server/tools/params.rs
+++ b/crates/openhuman-core/src/mcp/server/tools/params.rs
@@ -10,11 +10,11 @@ use tinymcp::ToolCallError;
use crate::core::all;
use super::types::{
- McpToolSpec, DEFAULT_LIMIT, MAX_LIMIT, MEMORY_NOTE_ARGUMENTS,
- MEMORY_STORE_ARGUMENTS, QUERY_ARGUMENTS, SEARCH_MAX_RESULTS, SEARXNG_SEARCH_ARGUMENTS,
- SUBAGENT_RUN_ARGUMENTS, TREE_BROWSE_ARGUMENTS, TREE_LIST_SOURCES_ARGUMENTS,
- TREE_READ_CHUNK_ARGUMENTS, TREE_TAG_ARGUMENTS, TREE_TAG_MAX_TAGS, TREE_TAG_MAX_TAG_LENGTH,
- TREE_TOP_ENTITIES_ARGUMENTS, WEB_ANSWER_ARGUMENTS, WEB_SEARCH_ARGUMENTS,
+ McpToolSpec, DEFAULT_LIMIT, MAX_LIMIT, MEMORY_NOTE_ARGUMENTS, MEMORY_STORE_ARGUMENTS,
+ QUERY_ARGUMENTS, SEARCH_MAX_RESULTS, SEARXNG_SEARCH_ARGUMENTS, SUBAGENT_RUN_ARGUMENTS,
+ TREE_BROWSE_ARGUMENTS, TREE_LIST_SOURCES_ARGUMENTS, TREE_READ_CHUNK_ARGUMENTS,
+ TREE_TAG_ARGUMENTS, TREE_TAG_MAX_TAGS, TREE_TAG_MAX_TAG_LENGTH, TREE_TOP_ENTITIES_ARGUMENTS,
+ WEB_ANSWER_ARGUMENTS, WEB_SEARCH_ARGUMENTS,
};
pub fn build_rpc_params(
@@ -56,7 +56,9 @@ pub fn build_rpc_params(
let query = required_non_empty_string(&args, "query")?;
let mut params = Map::new();
params.insert("query".to_string(), Value::String(query));
- if let Some(max_results) = optional_positive_u64(&args, "max_results", SEARCH_MAX_RESULTS as u64)? {
+ if let Some(max_results) =
+ optional_positive_u64(&args, "max_results", SEARCH_MAX_RESULTS as u64)?
+ {
params.insert("max_results".to_string(), Value::from(max_results));
}
if let Some(provider) = optional_non_empty_string(&args, "provider")? {
@@ -95,7 +97,15 @@ pub fn build_rpc_params(
// controller itself accepts up to 1000, but the MCP layer keeps
// the surface narrow so the LLM doesn't waste tokens pulling a
// huge page.
- params.insert("limit".to_string(), Value::from(positive_u64_or_default(&args, "k", DEFAULT_LIMIT, MAX_LIMIT)?));
+ params.insert(
+ "limit".to_string(),
+ Value::from(positive_u64_or_default(
+ &args,
+ "k",
+ DEFAULT_LIMIT,
+ MAX_LIMIT,
+ )?),
+ );
if let Some(values) = optional_string_array(&args, "source_kinds")? {
params.insert("source_kinds".to_string(), Value::from(values));
}
@@ -124,7 +134,15 @@ pub fn build_rpc_params(
// The controller's `limit` is required; default + cap at the MCP
// layer so the LLM doesn't have to know the underlying contract.
let mut params = Map::new();
- params.insert("limit".to_string(), Value::from(positive_u64_or_default(&args, "k", DEFAULT_LIMIT, MAX_LIMIT)?));
+ params.insert(
+ "limit".to_string(),
+ Value::from(positive_u64_or_default(
+ &args,
+ "k",
+ DEFAULT_LIMIT,
+ MAX_LIMIT,
+ )?),
+ );
if let Some(value) = optional_non_empty_string(&args, "kind")? {
params.insert("kind".to_string(), Value::String(value));
}