Skip to content

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

refactor(shell_turn_budget): replace chained min/max with clamp

Steven Enamakel25c482de70ec
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs
index 826a25d61e..8022e7b91e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/shell_turn_budget.rs
@@ -91,8 +91,7 @@ pub(crate) fn clamp_shell_timeout(
.saturating_sub(SHELL_TIMEOUT_RESERVE)
.max(remaining / 2)
.as_secs()
- .max(1)
- .min(crate::tools::timeout::MAX_TIMEOUT_SECS);
+ .clamp(1, crate::tools::timeout::MAX_TIMEOUT_SECS);
if requested.is_some_and(|secs| secs <= cap) {
return None;
}