Skip to content

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

chore: files changed crates/openhuman-core/src/core/all.rs,crates/openhuman-core/src/tools/registry/

Steven Enamakel8cb3fde24876
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index 1dc5d66c53..b4f5708714 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -556,10 +556,10 @@ fn build_registered_controllers() -> Vec<GroupedController> {
crate::tools::all_tools_registered_controllers(),
);
// Unified read-only registry across MCP stdio tools and controller-backed tools
- push(
+ push_entries(
&mut controllers,
DomainGroup::Platform,
- crate::tools::registry::all_tool_registry_registered_controllers(),
+ crate::tools::registry::all_tool_registry_bound_controller_entries(),
);
// Memory v2 (`docs/specs/memory-v2.md`): engines, recall/fetch/learn/
// forget, conversations, document sources, context.md and v1 import.
diff --git a/crates/openhuman-core/src/tools/registry/mod.rs b/crates/openhuman-core/src/tools/registry/mod.rs
index 472c488d20..4092e67866 100644
--- a/crates/openhuman-core/src/tools/registry/mod.rs
+++ b/crates/openhuman-core/src/tools/registry/mod.rs
@@ -15,6 +15,7 @@ pub use schemas::{
all_controller_schemas as all_tool_registry_controller_schemas,
all_registered_controllers as all_tool_registry_registered_controllers,
};
+pub(crate) use schemas::all_bound_controller_entries as all_tool_registry_bound_controller_entries;
pub use tinytools::{
CapabilityProviderDiagnostics, McpAllowlistDiagnostics, McpServerAllowlistSummary,
McpWriteAuditHealth, RecentPolicyDenial, ToolPolicyDiagnostics, ToolPolicyPosture,
diff --git a/crates/openhuman-core/src/tools/registry/schemas.rs b/crates/openhuman-core/src/tools/registry/schemas.rs
index c5ac81fd45..e2f75d8867 100644
--- a/crates/openhuman-core/src/tools/registry/schemas.rs
+++ b/crates/openhuman-core/src/tools/registry/schemas.rs
@@ -1,7 +1,9 @@
use crate::core::runtime::DispatchCtx;
use serde_json::{Map, Value};
-use crate::core::all::{ControllerFuture, RegisteredController};
+use crate::core::all::{
+ BoundRegisteredController, ControllerEntry, ControllerFuture, RegisteredController,
+};
use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
@@ -28,6 +30,27 @@ pub fn all_registered_controllers() -> Vec<RegisteredController> {
]
}
+/// Bound runtime entries for the `tool_registry` namespace.
+pub(crate) fn all_bound_controller_entries() -> Vec<ControllerEntry> {
+ vec![
+ ControllerEntry::bound(BoundRegisteredController::typed(
+ schemas("list"),
+ parse_list,
+ run_list,
+ )),
+ ControllerEntry::bound(BoundRegisteredController::typed(
+ schemas("get"),
+ parse_get,
+ run_get,
+ )),
+ ControllerEntry::bound(BoundRegisteredController::typed(
+ schemas("diagnostics"),
+ parse_diagnostics,
+ run_diagnostics,
+ )),
+ ]
+}
+
/// Return the schema for one `tool_registry` function.
pub fn schemas(function: &str) -> ControllerSchema {
match function {
@@ -122,6 +145,46 @@ fn handle_diagnostics(_ctx: DispatchCtx, params: Map<String, Value>) -> Controll
})
}
+fn parse_list(_params: Map<String, Value>) -> Result<(), String> {
+ Ok(())
+}
+
+fn parse_get(params: Map<String, Value>) -> Result<String, String> {
+ required_tool_id(&params).map(str::to_owned)
+}
+
+fn parse_diagnostics(_params: Map<String, Value>) -> Result<(), String> {
+ Ok(())
+}
+
+fn run_list(ctx: DispatchCtx, (): ()) -> ControllerFuture {
+ Box::pin(async move {
+ log::debug!("[tool_registry] rpc list requested");
+ to_json(crate::tools::registry::ops::list_tools(&ctx))
+ })
+}
+
+fn run_get(ctx: DispatchCtx, tool_id: String) -> ControllerFuture {
+ Box::pin(async move {
+ log::debug!("[tool_registry] rpc get requested tool_id={tool_id}");
+ to_json(crate::tools::registry::ops::get_tool(&ctx, &tool_id)?)
+ })
+}
+
+fn run_diagnostics(_ctx: DispatchCtx, (): ()) -> ControllerFuture {
+ Box::pin(async move {
+ log::debug!("[tool_registry] rpc diagnostics requested");
+ let result = crate::tools::registry::ops::diagnostics()
+ .await
+ .and_then(to_json);
+ log::debug!(
+ "[tool_registry] rpc diagnostics completed success={}",
+ result.is_ok()
+ );
+ result
+ })
+}
+
fn required_tool_id(params: &Map<String, Value>) -> Result<&str, String> {
params
.get("tool_id")
diff --git a/crates/openhuman-core/src/tools/registry/schemas_tests.rs b/crates/openhuman-core/src/tools/registry/schemas_tests.rs
index 4f74baf6f4..25bebf0fb6 100644
--- a/crates/openhuman-core/src/tools/registry/schemas_tests.rs
+++ b/crates/openhuman-core/src/tools/registry/schemas_tests.rs
@@ -44,7 +44,7 @@ fn required_tool_id_trims_padded_ids_before_lookup() {
let mut params = Map::new();
params.insert("tool_id".to_string(), json!(" tools.web_search "));
- assert_eq!(required_tool_id(&params).unwrap(), "tools.web_search");
+ assert_eq!(parse_get(params).unwrap(), "tools.web_search");
}
#[test]