Skip to content

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

refactor(jev): flatten nested conditionals in evaluator

Steven Enamakel55345b852613
diff --git a/crates/openhuman-tinyhumans/src/jev/evaluator.rs b/crates/openhuman-tinyhumans/src/jev/evaluator.rs
index c87f28e527..b96fd59a52 100644
--- a/crates/openhuman-tinyhumans/src/jev/evaluator.rs
+++ b/crates/openhuman-tinyhumans/src/jev/evaluator.rs
@@ -88,19 +88,19 @@ impl SystemOneEvaluator {
}
}
let mut state = json!({ "request": request.intent });
- if !request.recent_turns.is_empty()
- && let Some(object) = state.as_object_mut()
- {
- object.insert(
- "recent_user_turns".to_owned(),
- Value::Array(
- request
- .recent_turns
- .iter()
- .map(|turn| Value::String(turn.clone()))
- .collect(),
- ),
- );
+ if !request.recent_turns.is_empty() {
+ if let Some(object) = state.as_object_mut() {
+ object.insert(
+ "recent_user_turns".to_owned(),
+ Value::Array(
+ request
+ .recent_turns
+ .iter()
+ .map(|turn| Value::String(turn.clone()))
+ .collect(),
+ ),
+ );
+ }
}
let instructions = request
.instructions