Skip to content

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

test: simplify async test helper in middleware command exit failure tests

Steven Enamakelf418e72c6ee3
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs
index 6bffb71ec4..e7853cd2ca 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_command_exit_failure_tests.rs
@@ -12,20 +12,17 @@ fn sigpipe_git_log_report() -> String {
)
}
-fn run_shell(
+async fn run_shell(
mw: &RepeatedToolFailureMiddleware,
id: &str,
command: &str,
mut result: TaToolResult,
-) -> impl std::future::Future<Output = ()> + '_ {
+) {
let mut call = TaToolCall::new(id, "shell", json!({ "command": command }));
- let id = id.to_owned();
- async move {
- mw.before_tool(&mut ctx(), &(), &mut call).await.unwrap();
- mw.after_tool(&mut ctx(), &(), &invocation(&id, "shell"), &mut result)
- .await
- .unwrap();
- }
+ mw.before_tool(&mut ctx(), &(), &mut call).await.unwrap();
+ mw.after_tool(&mut ctx(), &(), &invocation(id, "shell"), &mut result)
+ .await
+ .unwrap();
}
#[test]