Skip to content

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

style: apply rustfmt formatting across tinyagents and inference modules

Steven Enamakelcac9c4969305
diff --git a/crates/openhuman-core/src/agent/tinyagents/budget.rs b/crates/openhuman-core/src/agent/tinyagents/budget.rs
index 265db5bb17..d038825e8c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/budget.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/budget.rs
@@ -3,10 +3,10 @@
/// Product recursion ceiling shared by native and MCP delegation.
pub(crate) const MAX_SPAWN_DEPTH: usize = 3;
+pub use tinyagents_harness::cost::ModelBudget;
pub use tinyinference_llm::model::budget::{
Budget, BudgetExceeded, BudgetSnapshot, CallBudget, Spend, SpendLimits,
};
-pub use tinyagents_harness::cost::ModelBudget;
/// Effective host depth ceiling, never wider than product policy.
pub(crate) fn depth(context: &super::host::OpenHumanRunContext) -> usize {
context
diff --git a/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs b/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs
index 2eacb6fe6a..07b16701b3 100644
--- a/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/hosted_error.rs
@@ -31,8 +31,14 @@ pub(crate) fn run_error_from_hosted(error: HostedError) -> TinyAgentsError {
.timeout_bound
.map(turn_timeout_bound)
.unwrap_or(TurnTimeoutBound::RunRemaining);
- tracing::debug!(timeout_bound = bound.tag(), "[tinyagents] hosted turn timed out; carrying the typed bound");
- TinyAgentsError::Timeout(format!("hosted agent invocation exceeded its {}", bound.phrase()))
+ tracing::debug!(
+ timeout_bound = bound.tag(),
+ "[tinyagents] hosted turn timed out; carrying the typed bound"
+ );
+ TinyAgentsError::Timeout(format!(
+ "hosted agent invocation exceeded its {}",
+ bound.phrase()
+ ))
} else {
TinyAgentsError::from(error)
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/fetched_site.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/fetched_site.rs
index 570891d1c2..9d3c7c56cd 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/fetched_site.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/fetched_site.rs
@@ -57,9 +57,7 @@ pub(super) fn fetch_host_scope(tool: &str, field: &str, value: &str) -> Option<S
/// is read whole.
pub(super) fn heuristic_text<'a>(tool: &str, failure_text: &'a str) -> &'a str {
match tinytools::status::classify_web_fetch_status(tool, failure_text, false) {
- Some(failure)
- if failure.recovery == tinytools::status::FetchedSiteRecovery::Ordinary =>
- {
+ Some(failure) if failure.recovery == tinytools::status::FetchedSiteRecovery::Ordinary => {
failure.headline(failure_text)
}
_ => failure_text,
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
index 4bd90787b2..0c9bf28448 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
@@ -183,8 +183,7 @@ async fn drive_turn(
// Wrap concrete routes before the invocation-local hosted resolver captures them.
let turn_models = turn_models.with_budget(run_context.model_budget.as_ref());
let hosted_model_resolver = hosted_root.as_ref().map(|_| {
- Arc::new(turn_models.resolver())
- as Arc<dyn tinyagents_harness::host::ModelResolver<()>>
+ Arc::new(turn_models.resolver()) as Arc<dyn tinyagents_harness::host::ModelResolver<()>>
});
// The host security adapter must see the exact same `Arc`-shared instances
// the registration resolves against, so retain only the cheap Arc clone for
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit.rs b/crates/openhuman-core/src/agent/tools/plan_exit.rs
index 76864fa216..df11af0096 100644
--- a/crates/openhuman-core/src/agent/tools/plan_exit.rs
+++ b/crates/openhuman-core/src/agent/tools/plan_exit.rs
@@ -6,7 +6,8 @@ use tinytools::ToolRunContext;
/// Resolve the live thread mode only when no plan review is still pending.
pub(crate) fn mode_lookup(context: &dyn ToolRunContext) -> Option<RunModeHandle> {
let thread_id = context.thread_id()?;
- let dispatch_ctx = crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(Some(context));
+ let dispatch_ctx =
+ crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(Some(context));
let tenant = dispatch_ctx.tenant().ok()?;
if crate::plan_review::gate::global()
.parked_review_for_thread(&tenant, thread_id)
@@ -14,7 +15,10 @@ pub(crate) fn mode_lookup(context: &dyn ToolRunContext) -> Option<RunModeHandle>
{
return None;
}
- Some(crate::threads::run_mode::handle_for_thread(&dispatch_ctx, thread_id))
+ Some(crate::threads::run_mode::handle_for_thread(
+ &dispatch_ctx,
+ thread_id,
+ ))
}
#[cfg(test)]
diff --git a/crates/openhuman-core/src/inference/turn_models_tests.rs b/crates/openhuman-core/src/inference/turn_models_tests.rs
index 04e9a96531..4b87a76be2 100644
--- a/crates/openhuman-core/src/inference/turn_models_tests.rs
+++ b/crates/openhuman-core/src/inference/turn_models_tests.rs
@@ -7,8 +7,8 @@ use tinyinference_llm::message::ContentBlock;
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
use super::TurnModels;
-use tinyagents_harness::host::PrebuiltModelResolver as TurnModelResolver;
use crate::agent::tinyagents::TurnModelSource;
+use tinyagents_harness::host::PrebuiltModelResolver as TurnModelResolver;
#[tokio::test]
async fn role_pins_apply_when_the_primary_uses_config_routing() {