Skip to content

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

feat(middleware): mark repeated failure middleware as an observer

Steven Enamakelee754084d766
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
index 3d393a4964..0a1093c1f1 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeated_failure.rs
@@ -419,6 +419,12 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext>
"repeated_tool_failure"
}
+ // Failure accounting and corrective nudges must observe tool outcomes even
+ // when an earlier middleware has already requested a control action.
+ fn is_observer(&self) -> bool {
+ true
+ }
+
async fn before_tool(
&self,
_ctx: &mut RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>,