Skip to content

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

fix(tinyagents): disambiguate middleware trait calls

Steven Enamakeld79eaf7d245a
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs
index ab9f7d940b..208e32a842 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs
@@ -173,7 +173,11 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext>
ctx: &mut RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>,
error: &tinyagents_harness::error::TinyAgentsError,
) -> TaResult<()> {
- self.capture.on_error(ctx, error).await
+ <tinyagents_harness::middleware::library::ToolOutcomeCaptureMiddleware as Middleware<
+ (),
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >>::on_error(&self.capture, ctx, error)
+ .await
}
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
index f88dea6cb8..2493d8018f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
@@ -2,6 +2,7 @@
//! context middlewares, plus the small observation hook it owns (transcript
//! snapshot).
+use std::collections::HashMap;
use std::sync::Arc;
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context_tests.rs
index 895d043442..9d8297eaaa 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context_tests.rs
@@ -63,7 +63,10 @@ async fn transcript_snapshot_keeps_a_completed_failed_tool_row() {
.before_tool(&mut context, &(), &mut call)
.await
.expect("snapshot accepts tool start");
- let invocation = ToolInvocationIdentity::new("failed-call", "write_file");
+ let invocation = tinyagents_harness::middleware::ToolInvocationIdentity::new(
+ "failed-call",
+ "write_file",
+ );
let mut result = TaToolResult::error("permission denied");
middleware
.after_tool(&mut context, &(), &invocation, &mut result)