Skip to content

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

Merge remote-tracking branch 'upstream/main' into epic/8089-test-ownership

Steven Enamakel1b8f123825f5
diff --cc crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
index 1536080c3d,d994c7a4aa..95fc5fb521
--- a/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_plan_tests.rs
@@@ -14,30 -14,8 +14,30 @@@ use tinyagents_runtime::DriverRequest
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
use tinytools::{Tool, ToolResult};
- const GOAL_TOOLS: [&str; 3] = ["goal_get", "goal_set", "goal_complete"];
+ const GOAL_TOOLS: [&str; 4] = ["goal_get", "goal_set", "goal_complete", "goal_resume"];
+#[test]
+fn turn_plan_preserves_the_host_retry_policy_in_the_run_policy() {
+ let (policy, _) = turn_run_policy(
+ "assembly-test-model",
+ 10,
+ false,
+ false,
+ tinyagents_harness::config::ToolDispatcher::default(),
+ None,
+ None,
+ None,
+ );
+ let host_policy =
+ crate::agent::tinyagents::turn_policy::run_policy_for_provider(10, false, false, None);
+
+ assert_eq!(policy.retry, host_policy.retry);
+ assert_eq!(
+ policy.limits.max_retries_per_call,
+ host_policy.limits.max_retries_per_call
+ );
+}
+
struct PlainTool;
#[async_trait]
diff --cc crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index 833be315c2,b118f7c47b..7426941133
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@@ -199,8 -160,17 +199,17 @@@ fn run_policy_for_provider_with_overrid
max_depth: MAX_SPAWN_DEPTH,
local_provider,
response_cache_enabled,
- overrides: env_overrides(),
+ overrides,
});
+ // A call that dies at its output cap with nothing to show is retried at
+ // 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 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;
apply_retry_backoff_override(&mut policy, retry_backoff_ms);
policy
}
diff --cc crates/openhuman-core/src/threads/schemas/registry.rs
index 608cd9b31e,a333ada08b..a8624d2e46
--- a/crates/openhuman-core/src/threads/schemas/registry.rs
+++ b/crates/openhuman-core/src/threads/schemas/registry.rs
@@@ -7,10 -7,10 +7,11 @@@ use crate::core::ControllerSchema
use super::handlers::{
handle_create_new, handle_delete, handle_edit_message, handle_generate_title, handle_goal_get,
handle_list, handle_message_append, handle_message_update, handle_messages_list, handle_purge,
- handle_regenerate, handle_search, handle_todos_get, handle_token_usage, handle_transcript_get,
- handle_turn_state_clear, handle_turn_state_get, handle_turn_state_get_turn,
- handle_turn_state_history, handle_turn_state_list, handle_update_labels, handle_update_title,
- handle_update_working_dir, handle_upsert, parse_upsert, run_upsert,
+ handle_regenerate, handle_search, handle_state_get, handle_todos_get, handle_token_usage,
+ handle_transcript_get, handle_turn_state_clear, handle_turn_state_get,
+ handle_turn_state_get_turn, handle_turn_state_history, handle_turn_state_list,
+ handle_update_labels, handle_update_title, handle_update_working_dir, handle_upsert,
++ parse_upsert, run_upsert,
};
use super::schema_defs::schemas;