Skip to content

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

refactor(tinyagents): use shared middleware from tinyagents_harness

Steven Enamakel03b2bdb31aec
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware.rs b/crates/openhuman-core/src/agent/tinyagents/middleware.rs
index d7af857e7c..30dd4d1c1d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware.rs
@@ -25,7 +25,6 @@
//! re-exports them so `tinyagents::middleware::*` paths stay stable.
mod approval;
-mod cli_rpc_only;
mod credential_scrub;
mod embedder_hooks;
mod failure_policy;
@@ -33,20 +32,20 @@ mod fetched_site;
mod memory_pack;
mod packed_tool_route;
mod repeated_failure;
-mod tool_exposure;
mod tool_outcome_capture;
mod tool_output;
mod tool_policy;
mod turn_context;
pub(crate) use approval::ApprovalSecurityMiddleware;
-pub(crate) use cli_rpc_only::CliRpcOnlyMiddleware;
pub(crate) use credential_scrub::credential_scrub_middleware;
pub(crate) use embedder_hooks::EmbedderToolHooksMiddleware;
pub(crate) use memory_pack::memory_pack_middleware;
pub(crate) use packed_tool_route::packed_tool_route_middleware;
pub(crate) use repeated_failure::RepeatedToolFailureMiddleware;
-pub(crate) use tool_exposure::OpenHumanToolExposureShadowMiddleware;
+pub(crate) use tinyagents_harness::middleware::{
+ CliRpcOnlyMiddleware, ToolExposureShadowMiddleware,
+};
pub(crate) use tool_outcome_capture::ToolOutcomeCaptureMiddleware;
#[cfg(test)]
pub(crate) use tool_output::ToolOutputMiddleware;
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
index 6098abe607..b9efa9dbe1 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
@@ -296,13 +296,11 @@ pub(super) fn install_turn_middleware(
}
tags
};
- harness.push_middleware(Arc::new(
- middleware::OpenHumanToolExposureShadowMiddleware::new(
- &candidate_names,
- allowed.as_ref(),
- exposure_tags,
- ),
- ));
+ harness.push_middleware(Arc::new(middleware::ToolExposureShadowMiddleware::new(
+ &candidate_names,
+ allowed.as_ref(),
+ exposure_tags,
+ )));
// Prompt-cache prefix protection (issue #4249, 03.2). The vendor loop owns
// the stable-prefix layout (`PromptSegment`s built from the session's frozen