Skip to content

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

fix(tests): remove unnecessary parentheses and simplify iterator chain

Steven Enamakel296f59597e6e
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
index d951b004d0..e75932151a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
@@ -336,7 +336,7 @@ impl ParallelHarnessProvider {
sleep(Duration::from_millis(5)).await;
}
- let response = (if flattened.contains(RESEARCH_PROMPT_CANARY) {
+ let response = if flattened.contains(RESEARCH_PROMPT_CANARY) {
if flattened.contains("research-step-3-ok") {
Ok(text_response(RESEARCH_DONE_CANARY))
} else if flattened.contains("research-step-2-ok") {
@@ -378,7 +378,7 @@ impl ParallelHarnessProvider {
Err(tinyinference_llm::Error::Model(format!(
"unexpected subagent payload: {flattened}"
)))
- });
+ } ;
self.state
.active_subagent_calls
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
index 9cabdbfa1f..dd61c3b211 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
@@ -109,9 +109,7 @@ async fn failed_subagent_run_keeps_its_unanswered_round_out_of_history() {
let raw = std::fs::read_to_string(&path).expect("raw transcript");
let marker_line = raw
.lines()
- .filter_map(|line| serde_json::from_str::<serde_json::Value>(line).ok())
- .filter(|line| line.get("role").and_then(|role| role.as_str()) == Some("assistant"))
- .next_back()
+ .filter_map(|line| serde_json::from_str::<serde_json::Value>(line).ok()).rfind(|line| line.get("role").and_then(|role| role.as_str()) == Some("assistant"))
.expect("failure marker line");
assert_eq!(
marker_line.get("iteration").and_then(|n| n.as_u64()),