Skip to content

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

fix(agent): reasoning off only for the retry after a dead call

sanil-2326ca86bb2085
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index e675863d9c..b118f7c47b 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@ -166,13 +166,11 @@ pub(crate) fn run_policy_for_provider_with_backoff(
// the same cap, never a doubled one: a model that reasons past the cap
// without answering does the same past twice the cap, at twice the cost.
policy.truncated_empty_constant_cap = true;
- // And the call after a dead one goes out without reasoning: a model that
- // thought to the cap without acting tends to do so again at any cap.
+ // And the retry (or nudge) after a dead one goes out without reasoning: a
+ // model that thought to the cap without acting tends to do so again at
+ // any cap. Only that call: every new call keeps its reasoning
+ // (`truncated_empty_reasoning_off_sticky_after` stays 0).
policy.truncated_empty_reasoning_off = true;
- // From the second dead call in a turn on, the rest of the turn runs
- // without reasoning: one reasoning-off call recovers the step, but the
- // model thinks to the cap again as soon as reasoning comes back.
- policy.truncated_empty_reasoning_off_sticky_after = 2;
apply_retry_backoff_override(&mut policy, retry_backoff_ms);
policy
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs
index 24784a92e0..2bd62f7f1d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy_budget_tests.rs
@@ -136,7 +136,7 @@ fn retry_backoff_override_shrinks_the_schedule_and_ignores_junk() {
}
#[test]
-fn a_dead_call_is_retried_at_the_same_cap_without_reasoning_sticky_after_two() {
+fn a_dead_call_is_retried_at_the_same_cap_without_reasoning_and_new_calls_keep_it() {
for local_provider in [false, true] {
let policy = run_policy_for_provider(50, false, local_provider, None);
assert!(
@@ -145,8 +145,11 @@ fn a_dead_call_is_retried_at_the_same_cap_without_reasoning_sticky_after_two() {
);
assert!(
policy.truncated_empty_reasoning_off,
- "the call after a dead one runs without reasoning"
+ "the retry after a dead one runs without reasoning"
+ );
+ assert_eq!(
+ policy.truncated_empty_reasoning_off_sticky_after, 0,
+ "new calls keep their reasoning"
);
- assert_eq!(policy.truncated_empty_reasoning_off_sticky_after, 2);
}
}