Skip to content

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

refactor(embed): source ToolRanker from tinytools

Steven Enamakele15180fca25d
diff --git a/crates/openhuman-embed/src/runtime/seams.rs b/crates/openhuman-embed/src/runtime/seams.rs
index 82c50bc1e7..5bf767afab 100644
--- a/crates/openhuman-embed/src/runtime/seams.rs
+++ b/crates/openhuman-embed/src/runtime/seams.rs
@@ -28,10 +28,10 @@ use openhuman_core::agent::hooks::{
use openhuman_core::agent::tinyagents::discovery::{
clear_tool_ranker, install_tool_ranker, installed_tool_ranker,
};
-use tinytools::ToolRanker;
use openhuman_core::core::all::{register_controller_extension, ControllerExtension};
use openhuman_core::core::server_launcher::{install_server_launcher, ServerLauncher};
use openhuman_core::security::SecurityPolicy;
+use tinytools::ToolRanker;
use super::RuntimeBuilder;
diff --git a/crates/openhuman-embed/src/runtime/summary.rs b/crates/openhuman-embed/src/runtime/summary.rs
index 5345d6d427..4739d9e13e 100644
--- a/crates/openhuman-embed/src/runtime/summary.rs
+++ b/crates/openhuman-embed/src/runtime/summary.rs
@@ -36,7 +36,7 @@ pub struct BuilderSummary {
pub has_session_store: bool,
/// The group of each controller extension, in registration order.
pub controller_extensions: Vec<DomainGroup>,
- /// The [`kind`](crate::seams::ToolRanker::kind) of the tool ranker.
+ /// The [`kind`](tinytools::ToolRanker::kind) of the tool ranker.
pub tool_ranker: Option<String>,
pub post_turn_hooks: Vec<String>,
pub tool_hooks: Vec<String>,
diff --git a/crates/openhuman-tinyhumans/README.md b/crates/openhuman-tinyhumans/README.md
index 22dcbba217..711dd2e99e 100644
--- a/crates/openhuman-tinyhumans/README.md
+++ b/crates/openhuman-tinyhumans/README.md
@@ -47,7 +47,7 @@ layer renders as a `BACKEND_UNAVAILABLE:` error that observability demotes.
The crate's only openhuman dependency is `openhuman-embed`, per the chain
core -> embed -> tinyhumans -> rpc -> hosts. The public embed API covers the transport port
(`BackendTransport`, `install_backend_transport`, ...) and the seam types
-(`embed::seams::{ControllerExtension, ToolRanker, ...}`); the deeper core
+(`embed::seams::{ControllerExtension, ...}`; the ranker trait is `tinytools::ToolRanker`, taken from the same vendored path); the deeper core
internals the transport and hosted controllers need (`backend::BackendClient`,
`core::all`'s registry types, `security::credentials`, `config`) come through
embed's `#[doc(hidden)] __host` module, an explicit list kept in embed.
diff --git a/crates/openhuman-tinyhumans/src/install.rs b/crates/openhuman-tinyhumans/src/install.rs
index 94e21d4bc8..a535380221 100644
--- a/crates/openhuman-tinyhumans/src/install.rs
+++ b/crates/openhuman-tinyhumans/src/install.rs
@@ -11,8 +11,9 @@ use std::sync::{Arc, Mutex, OnceLock};
use openhuman_embed::__host::agent::tinyagents::discovery::install_tool_ranker;
use openhuman_embed::__host::core::all::register_controller_extension;
-use openhuman_embed::seams::{ControllerExtension, ToolRanker};
+use openhuman_embed::seams::ControllerExtension;
use openhuman_embed::{install_backend_transport, installed_backend_transport};
+use tinytools::ToolRanker;
use crate::backend::{set_product_identity, ProductIdentity};
use crate::transport::SdkBackendTransport;
diff --git a/crates/openhuman-tinyhumans/src/runtime.rs b/crates/openhuman-tinyhumans/src/runtime.rs
index 8871f687b7..5605e7c3af 100644
--- a/crates/openhuman-tinyhumans/src/runtime.rs
+++ b/crates/openhuman-tinyhumans/src/runtime.rs
@@ -25,8 +25,10 @@ use std::path::PathBuf;
use std::sync::Arc;
use openhuman_embed::seams::{
- ControllerExtension, PostTurnHook, SecurityPolicy, ServerLauncher, ToolHook, ToolRanker,
+ ControllerExtension, PostTurnHook, SecurityPolicy, ServerLauncher, ToolHook,
};
+use tinytools::ToolRanker;
+
use openhuman_embed::{
Access, ApiKey, ConfigSource, DomainSet, HostKind, Provider, Runtime, RuntimeConfig,
ServiceSet, Session, SessionStoreProvider, TokenSource, ToolGroups, Workspace,
diff --git a/crates/openhuman-tinyhumans/src/runtime_tests.rs b/crates/openhuman-tinyhumans/src/runtime_tests.rs
index 39164c6845..a8ca4d5124 100644
--- a/crates/openhuman-tinyhumans/src/runtime_tests.rs
+++ b/crates/openhuman-tinyhumans/src/runtime_tests.rs
@@ -115,11 +115,10 @@ fn knobs_and_seams_forward_unchanged() {
async fn rank(
&self,
_intent: &str,
- _context: &openhuman_embed::seams::RankContext,
- _candidates: &[openhuman_embed::seams::RankCandidate],
+ _context: &tinytools::RankContext,
+ _candidates: &[tinytools::RankCandidate],
_limit: usize,
- ) -> Result<Vec<openhuman_embed::seams::RankHit>, openhuman_embed::seams::RankError>
- {
+ ) -> Result<Vec<tinytools::RankHit>, tinytools::RankError> {
Ok(Vec::new())
}
}