Skip to content

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

refactor(tinyagents): reference middleware via full path instead of re-export

Steven Enamakel97d674f55129
diff --git a/crates/openhuman-core/src/agent/tinyagents/routes.rs b/crates/openhuman-core/src/agent/tinyagents/routes.rs
index e8abd69f0a..ffab35fc27 100644
--- a/crates/openhuman-core/src/agent/tinyagents/routes.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/routes.rs
@@ -5,9 +5,6 @@ use std::sync::LazyLock;
use async_trait::async_trait;
use tinyagents_harness::context::RunContext;
use tinyagents_harness::events::{AgentEvent, GenerationEnrichment, GenerationPricing};
-pub(super) use tinyagents_harness::middleware::library::{
- FallbackObserverMiddleware, RequiredCapabilitiesMiddleware,
-};
use tinyagents_harness::middleware::{MiddlewareModelOutcome, ModelHandler, ModelMiddleware};
use tinyagents_harness::retry::FallbackPolicy;
use tinyagents_registry::WorkloadRouter;
@@ -15,7 +12,8 @@ use tinyinference_llm::model::{CapabilitySet, ModelRequest};
/// The workload routing table (fallback chains and the vision `image_in` gate)
/// projected into the crate [`WorkloadRouter`] from the upstream declarative
-/// [`WORKLOAD_ROUTES`] table, which owns the policy.
+/// [`WORKLOAD_ROUTES`](tinyinference_llm::model::workload::WORKLOAD_ROUTES) table,
+/// which owns the policy.
static OH_WORKLOAD_ROUTER: LazyLock<WorkloadRouter> =
LazyLock::new(|| WorkloadRouter::from_workload_routes("hint:vision"));
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
index f51c9ab8bf..59946b66c5 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
@@ -206,9 +206,11 @@ pub(super) fn install_turn_middleware(
// model is rejected pre-dispatch (and, once 02.2 lands, a capable fallback is
// selected) instead of failing at the provider.
if let Some(required) = required_capabilities {
- harness.push_model_middleware(Arc::new(routes::RequiredCapabilitiesMiddleware::new(
+ harness.push_model_middleware(Arc::new(
+ tinyagents_harness::middleware::library::RequiredCapabilitiesMiddleware::new(
required,
- )));
+ ),
+ ));
}
// Fallback event parity (issue #4249, Workstream 02.2): the crate's
@@ -220,7 +222,9 @@ pub(super) fn install_turn_middleware(
// `[fallback]`). Installed only when a fallback chain exists; it never re-issues
// the call, so it adds no provider dispatch (no double-fallback).
if has_route_fallback {
- harness.push_model_middleware(Arc::new(routes::FallbackObserverMiddleware::new(model)));
+ harness.push_model_middleware(Arc::new(
+ tinyagents_harness::middleware::library::FallbackObserverMiddleware::new(model),
+ ));
}
// Capture context settings before `install` consumes `context_mw`.