The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(inference): move turn model and reasoning helpers out of agent
Steven Enamakel312342f334db
diff --git a/crates/openhuman-core/src/agent/message_convert.rs b/crates/openhuman-core/src/agent/message_convert.rsindex f10f85f018..3d8f12f0fb 100644--- a/crates/openhuman-core/src/agent/message_convert.rs+++ b/crates/openhuman-core/src/agent/message_convert.rs@@ -22,7 +22,6 @@ use tinytools_agent::dialect::{DialectMessage, DialectResponse, DialectRole, ToolDialect, ToolResultEntry, TranscriptEntry,};-use crate::inference::provider::ChatResponse;use tinyagents_runtime::transcript::reasoning_from_content;#[cfg(test)]use tinyagents_runtime::transcript::{@@ -33,13 +32,6 @@ use tinyagents_session::transcript::TranscriptMessage;/// Convert the host provider response at its boundary into the canonical/// dialect input. The dialect crate owns all parsing after this field-wise map.-pub(crate) fn dialect_response_from_provider(response: &ChatResponse) -> DialectResponse {- DialectResponse {- text: response.text.clone(),- tool_calls: response.tool_calls.clone(),- }-}-/// Replay typed conversation entries through a canonical dialect and return/// the provider's typed rows (a native tool round keeps its calls and call ids/// in fields, never packed into `content`).diff --git a/crates/openhuman-core/src/agent/tinyagents/budget.rs b/crates/openhuman-core/src/agent/tinyagents/budget.rsindex e648efaf82..771548323a 100644--- a/crates/openhuman-core/src/agent/tinyagents/budget.rs+++ b/crates/openhuman-core/src/agent/tinyagents/budget.rs@@ -52,7 +52,7 @@ pub(super) fn install_depth(}}-impl super::turn_models::TurnModels {+impl crate::inference::turn_models::TurnModels {/// Wrap every concrete route and summarizer below harness retries/fallback.pub(crate) fn with_budget(mut self, budget: Option<&ModelBudget>) -> Self {let Some(budget) = budget else {diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rsindex bf677332ff..2f6b8c6f6a 100644--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs@@ -31,7 +31,6 @@ pub(crate) mod journal;pub(crate) mod live_harness;mod memory_summarizer;pub(crate) mod middleware;-pub(crate) mod model;pub(crate) mod observability;pub mod run_mode;// `pub` since issue #6014, and the inconsistency it removes is the point:@@ -49,7 +48,6 @@ pub mod budget;pub mod payload_summarizer;mod policy_denial;pub(crate) mod reaper;-pub(crate) mod reasoning;mod routes;mod steering_forwarder;pub(crate) mod stop_hooks;@@ -57,7 +55,6 @@ pub(crate) mod tool_registration;mod turn_exec;mod turn_middleware;mod turn_model_resolver;-mod turn_models;mod turn_outcome;mod turn_plan;mod turn_policy;@@ -71,10 +68,10 @@ pub(crate) use crate::agent::message_convert::chat_message_to_message;pub(crate) use crate::agent::message_convert::ta_call_to_oh_call;pub(crate) use observability::SubagentScope;-pub(crate) use reasoning::{apply_requested_effort, parse_reasoning_effort};+pub(crate) use crate::inference::reasoning::{apply_requested_effort, parse_reasoning_effort};pub(crate) use turn_exec::TurnSpec;-pub use turn_models::TurnModelSource;-pub(crate) use turn_models::TurnModels;+pub use crate::inference::turn_models::TurnModelSource;+pub(crate) use crate::inference::turn_models::TurnModels;pub(crate) use turn_outcome::TinyagentsTurnOutcome;#[cfg(test)]pub(crate) use turn_policy::is_subagent_spawn_or_delegate_tool;diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_model_resolver.rs b/crates/openhuman-core/src/agent/tinyagents/turn_model_resolver.rsindex 4be2affc3c..85c9babd30 100644--- a/crates/openhuman-core/src/agent/tinyagents/turn_model_resolver.rs+++ b/crates/openhuman-core/src/agent/tinyagents/turn_model_resolver.rs@@ -4,8 +4,8 @@ use std::sync::Arc;use async_trait::async_trait;-use super::model::TurnChatModel;-use super::turn_models::TurnModels;+use crate::inference::provider::model::TurnChatModel;+use crate::inference::turn_models::TurnModels;use tinyagents_harness::host::{ModelResolveRequest, ModelResolver};use tinyinference_llm::model::ErrorSlotModel;diff --git a/crates/openhuman-core/src/inference/mod.rs b/crates/openhuman-core/src/inference/mod.rsindex 0962d353f6..10ce22398d 100644--- a/crates/openhuman-core/src/inference/mod.rs+++ b/crates/openhuman-core/src/inference/mod.rs@@ -30,8 +30,10 @@ pub(crate) mod failure_copy;pub mod host_runtime;pub mod http;pub mod model_context;+pub(crate) mod reasoning;pub mod ops;pub mod provider;+pub(crate) mod turn_models;mod schemas;pub mod tokenjuice;diff --git a/crates/openhuman-core/src/inference/provider/mod.rs b/crates/openhuman-core/src/inference/provider/mod.rsindex fc464cfffb..0d0436c07e 100644--- a/crates/openhuman-core/src/inference/provider/mod.rs+++ b/crates/openhuman-core/src/inference/provider/mod.rs@@ -13,6 +13,7 @@ pub(crate) mod openai_codex;/// Crate-native managed OpenHuman backend as a host `ChatModel` (issue #4727).pub mod openhuman_backend_model;pub mod ops;+pub(crate) mod model;pub mod types;#[allow(unused_imports)]diff --git a/crates/openhuman-core/src/agent/tinyagents/model.rs b/crates/openhuman-core/src/inference/provider/model.rssimilarity index 100%rename from crates/openhuman-core/src/agent/tinyagents/model.rsrename to crates/openhuman-core/src/inference/provider/model.rsdiff --git a/crates/openhuman-core/src/agent/tinyagents/model_g1_usage_tests_tests.rs b/crates/openhuman-core/src/inference/provider/model_g1_usage_tests_tests.rssimilarity index 100%rename from crates/openhuman-core/src/agent/tinyagents/model_g1_usage_tests_tests.rsrename to crates/openhuman-core/src/inference/provider/model_g1_usage_tests_tests.rsdiff --git a/crates/openhuman-core/src/agent/tinyagents/reasoning.rs b/crates/openhuman-core/src/inference/reasoning.rssimilarity index 100%rename from crates/openhuman-core/src/agent/tinyagents/reasoning.rsrename to crates/openhuman-core/src/inference/reasoning.rsdiff --git a/crates/openhuman-core/src/agent/tinyagents/reasoning_tests.rs b/crates/openhuman-core/src/inference/reasoning_tests.rssimilarity index 100%rename from crates/openhuman-core/src/agent/tinyagents/reasoning_tests.rsrename to crates/openhuman-core/src/inference/reasoning_tests.rsdiff --git a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs b/crates/openhuman-core/src/inference/turn_models.rssimilarity index 100%rename from crates/openhuman-core/src/agent/tinyagents/turn_models.rsrename to crates/openhuman-core/src/inference/turn_models.rsdiff --git a/crates/openhuman-core/src/agent/tinyagents/turn_models_tests.rs b/crates/openhuman-core/src/inference/turn_models_tests.rssimilarity index 100%rename from crates/openhuman-core/src/agent/tinyagents/turn_models_tests.rsrename to crates/openhuman-core/src/inference/turn_models_tests.rs