The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(agent): cover observer delivery after control actions
Steven Enamakel49185190d9cc
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rsindex d2758f11cf..832fb017e2 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_classified_failure_tests.rs@@ -385,6 +385,12 @@ fn system_messages(request: &ModelRequest) -> usize {#[tokio::test]async fn nudges_for_a_hoisting_model_add_no_system_message() {let mw = middleware_with_one_pending_nudge().await;+ let injector = mw.nudge_injector();+ // The injector must remain in the before-model pass after a prior+ // middleware requests retry control, or the queued correction is lost.+ assert!(tinyagents_harness::middleware::Middleware::is_observer(+ &injector+ ));let mut run_ctx = ctx();run_ctx.model_profile = Some(tinyinference_llm::model::ModelProfile {hoists_system_messages: true,@@ -394,7 +400,7 @@ async fn nudges_for_a_hoisting_model_add_no_system_message() {let leading = TaMessage::system("persona");let mut request = nudge_request(&leading);- mw.nudge_injector()+ injector.before_model(&mut run_ctx, &(), &mut request).await.unwrap();diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rsindex 7543d469a1..44786cca64 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs@@ -1,5 +1,19 @@use super::*;+#[test]+fn repeated_tool_failure_middleware_observes_outcomes_after_control_requests() {+ let mw = RepeatedToolFailureMiddleware::new(+ SteeringHandle::allow_all(),+ 3,+ std::sync::Arc::new(std::sync::Mutex::new(None)),+ );++ // The harness consults this contract when an earlier middleware has+ // requested control; this observer must still receive failures so its+ // no-progress accounting and corrective nudge remain active.+ assert!(Middleware::is_observer(&mw));+}+#[tokio::test]async fn sampling_tool_output_still_hits_the_byte_budget_backstop() {// Unlike the proposal tools, sampling tools are deliberately NOT