Skip to content

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

chore: format latest upstream Rust changes

Steven Enamakel9a95bfd7e35b
diff --git a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
index 2e6ed35784..9d3e3fa61a 100644
--- a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
@@ -17,8 +17,8 @@ use std::sync::Arc;
use super::*;
use crate::security::{AutonomyLevel, SecurityPolicy, TrustedAccess, TrustedRoot};
use tinyagents_harness::artifacts::{
- extract_artifact_paths, ArtifactKind, ArtifactPathPolicy,
- ARTIFACT_POINTER_PREFIX, DEFAULT_OFFLOAD_THRESHOLD_BYTES,
+ extract_artifact_paths, ArtifactKind, ArtifactPathPolicy, ARTIFACT_POINTER_PREFIX,
+ DEFAULT_OFFLOAD_THRESHOLD_BYTES,
};
/// Policy with disjoint action/workspace roots, the shipped default layout
diff --git a/crates/openhuman-core/src/agent/session_host/driver.rs b/crates/openhuman-core/src/agent/session_host/driver.rs
index 0d961ad9b9..fc3ce3b61e 100644
--- a/crates/openhuman-core/src/agent/session_host/driver.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver.rs
@@ -622,8 +622,9 @@ fn driver_error_with_snapshot(
}
let accepted_end = guard.accepted_end();
let history = guard.messages[..accepted_end].to_vec();
- let unanswered =
- crate::agent::tinyagents::middleware::render_unanswered_steps(&guard.messages[accepted_end..]);
+ let unanswered = crate::agent::tinyagents::middleware::render_unanswered_steps(
+ &guard.messages[accepted_end..],
+ );
let display = if stalled {
// The model's streamed narration was stopped before it could repeat
// indefinitely. Preserve the completed tools as a useful, bounded
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs b/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
index 83e2f95af6..d015b1bd13 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
@@ -217,10 +217,9 @@ fn build_turn_models_crate(
})
.unwrap_or_else(|| factory::resolves_to_managed_backend(role, config));
if managed {
- let (backend, _) =
- factory::make_openhuman_backend_model_for_thread(
- role, config, m, true, thread_id, &egress,
- )?;
+ let (backend, _) = factory::make_openhuman_backend_model_for_thread(
+ role, config, m, true, thread_id, &egress,
+ )?;
return Ok(Arc::new(RouteRecordingModel::new(
crate::agent::attachments::provider::wrap(
backend,
@@ -262,89 +261,88 @@ fn build_turn_models_crate(
};
let (primary, routes, summarizer): BuiltTurnModels = (|| {
- let primary = build_primary(model)?;
-
- // Additive workload-tier routes: one crate-native model per tier (skipping the
- // turn's own model, which is registered as the default primary), each pinned to
- // the tier alias so the crate registry resolves cross-route fallback across them.
- let mut routes: TierRoutes = Vec::new();
- for &tier in tinyinference_llm::model::workload::WORKLOAD_ROUTE_TIERS {
- if tier == model {
- continue;
- }
- let tier_role = factory::role_for_model_tier(tier);
- if let Some(custom) = crate::core::runtime::CoreContext::current_host_overrides()
- .and_then(|local| {
- local
- .role_models
- .get(tier)
- .or_else(|| local.role_models.get(tier_role))
- .cloned()
- })
- {
- routes.push((
- tier.to_string(),
- crate::agent::attachments::provider::wrap_injected(
- custom,
+ let primary = build_primary(model)?;
+
+ // Additive workload-tier routes: one crate-native model per tier (skipping the
+ // turn's own model, which is registered as the default primary), each pinned to
+ // the tier alias so the crate registry resolves cross-route fallback across them.
+ let mut routes: TierRoutes = Vec::new();
+ for &tier in tinyinference_llm::model::workload::WORKLOAD_ROUTE_TIERS {
+ if tier == model {
+ continue;
+ }
+ let tier_role = factory::role_for_model_tier(tier);
+ if let Some(custom) = crate::core::runtime::CoreContext::current_host_overrides()
+ .and_then(|local| {
+ local
+ .role_models
+ .get(tier)
+ .or_else(|| local.role_models.get(tier_role))
+ .cloned()
+ })
+ {
+ routes.push((
+ tier.to_string(),
+ crate::agent::attachments::provider::wrap_injected(
+ custom,
+ Arc::new(config.clone()),
+ ),
+ ));
+ continue;
+ }
+ let route = if factory::resolves_to_managed_backend(tier_role, config) {
+ factory::make_openhuman_backend_model_for_thread(
+ tier_role, config, tier, true, thread_id, &egress,
+ )
+ .map(|(backend, _)| (backend, "openhuman".to_string(), tier.to_string()))
+ } else {
+ factory::create_turn_chat_model_with_native_tools_and_route(
+ tier_role,
+ config,
+ tier,
+ temperature,
+ true,
+ &egress,
+ )
+ };
+ match route {
+ Ok((route_model, provider, resolved_model)) => routes.push((
+ tier.to_string(),
+ Arc::new(RouteRecordingModel::new(
+ crate::agent::attachments::provider::wrap(
+ route_model,
Arc::new(config.clone()),
+ &resolved_model,
+ &provider,
),
- ));
- continue;
- }
- let route = if factory::resolves_to_managed_backend(tier_role, config) {
- factory::make_openhuman_backend_model_for_thread(
- tier_role, config, tier, true, thread_id, &egress,
- )
- .map(|(backend, _)| (backend, "openhuman".to_string(), tier.to_string()))
- } else {
- factory::create_turn_chat_model_with_native_tools_and_route(
- tier_role,
- config,
- tier,
- temperature,
- true,
- &egress,
- )
- };
- match route {
- Ok((route_model, provider, resolved_model)) => routes.push((
- tier.to_string(),
- Arc::new(RouteRecordingModel::new(
- crate::agent::attachments::provider::wrap(
- route_model,
- Arc::new(config.clone()),
- &resolved_model,
- &provider,
- ),
- ResolvedModelRoute::new(provider, resolved_model, tier),
- )),
+ ResolvedModelRoute::new(provider, resolved_model, tier),
)),
- Err(e) => {
- // A route that can't be built (e.g. an unconfigured BYOK tier) is
- // skipped, not fatal — the primary still dispatches (parity with the
- // `Provider` path, where an unresolved tier simply isn't registered).
- tracing::debug!(
- route = tier,
- error = %e,
- "[models] skipping crate-native workload route that failed to build"
- );
- }
+ )),
+ Err(e) => {
+ // A route that can't be built (e.g. an unconfigured BYOK tier) is
+ // skipped, not fatal — the primary still dispatches (parity with the
+ // `Provider` path, where an unresolved tier simply isn't registered).
+ tracing::debug!(
+ route = tier,
+ error = %e,
+ "[models] skipping crate-native workload route that failed to build"
+ );
}
}
+ }
- // The summarizer is a distinct adapter instance (own empty error slot).
- let summarizer = match crate::core::runtime::CoreContext::current_host_overrides()
- .and_then(|local| local.role_models.get("summarization").cloned())
- {
- Some(custom) => crate::agent::attachments::provider::wrap_injected(
- custom,
- Arc::new(config.clone()),
- ),
- None => build_primary(model)?,
- };
+ // The summarizer is a distinct adapter instance (own empty error slot).
+ let summarizer = match crate::core::runtime::CoreContext::current_host_overrides()
+ .and_then(|local| local.role_models.get("summarization").cloned())
+ {
+ Some(custom) => {
+ crate::agent::attachments::provider::wrap_injected(custom, Arc::new(config.clone()))
+ }
+ None => build_primary(model)?,
+ };
- anyhow::Ok((primary, routes, summarizer))
- })()?;
+ anyhow::Ok((primary, routes, summarizer))
+ })()?;
let supports_vision = primary.profile().is_some_and(|p| p.modalities.image_in);
Ok(TurnModels {
diff --git a/crates/openhuman-core/src/inference/provider/factory/chat_model.rs b/crates/openhuman-core/src/inference/provider/factory/chat_model.rs
index 096fe6f09e..0893a77549 100644
--- a/crates/openhuman-core/src/inference/provider/factory/chat_model.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/chat_model.rs
@@ -72,24 +72,31 @@ pub(super) fn create_chat_model_with_model_id_inner(
if resolves_to_managed_backend(role, config) {
return make_openhuman_backend_model(role, config);
}
- if let Some(result) = try_create_claude_agent_sdk_chat_model(role, config, &EgressLedger::none()) {
+ if let Some(result) =
+ try_create_claude_agent_sdk_chat_model(role, config, &EgressLedger::none())
+ {
return result;
}
- if let Some(result) = try_create_claude_code_chat_model(role, config, None, &EgressLedger::none()) {
+ if let Some(result) =
+ try_create_claude_code_chat_model(role, config, None, &EgressLedger::none())
+ {
return result;
}
// Local OpenAI-compatible runtimes (Ollama / LM Studio / MLX / OMLX /
// local-openai) → crate-native `ChatModel` (issue #4727 Motion B) instead
// of a crate-adapted host provider. Cloud/BYOK/bespoke providers
// return `None` here and fall through to the `Provider` path below.
- if let Some(result) = try_create_local_runtime_chat_model(role, config, &EgressLedger::none()) {
+ if let Some(result) =
+ try_create_local_runtime_chat_model(role, config, &EgressLedger::none())
+ {
return result;
}
// Wire-equivalent BYOK cloud slugs (Anthropic / None / plain-Bearer, no
// codex-oauth or `/v1/responses` fallback) → crate-native `ChatModel`
// (issue #4727 Phase 3, conservative subset). `openai`/codex, custom
// proxy slugs, and the managed entry return `None` and fall through.
- if let Some(result) = try_create_cloud_slug_chat_model(role, config, &EgressLedger::none()) {
+ if let Some(result) = try_create_cloud_slug_chat_model(role, config, &EgressLedger::none())
+ {
return result;
}
}
@@ -229,35 +236,29 @@ pub(super) fn create_chat_model_from_string_with_model_id_inner(
if resolved == PROVIDER_OPENHUMAN {
return make_openhuman_backend_model(role, config);
}
- if let Some(result) =
- try_create_claude_agent_sdk_chat_model_from_string(
- role,
- &resolved,
- config,
- &EgressLedger::none(),
- )
- {
+ if let Some(result) = try_create_claude_agent_sdk_chat_model_from_string(
+ role,
+ &resolved,
+ config,
+ &EgressLedger::none(),
+ ) {
return result;
}
- if let Some(result) =
- try_create_claude_code_chat_model_from_string(
- role,
- &resolved,
- config,
- None,
- &EgressLedger::none(),
- )
- {
+ if let Some(result) = try_create_claude_code_chat_model_from_string(
+ role,
+ &resolved,
+ config,
+ None,
+ &EgressLedger::none(),
+ ) {
return result;
}
- if let Some(result) =
- try_create_local_runtime_chat_model_from_string(
- role,
- &resolved,
- config,
- &EgressLedger::none(),
- )
- {
+ if let Some(result) = try_create_local_runtime_chat_model_from_string(
+ role,
+ &resolved,
+ config,
+ &EgressLedger::none(),
+ ) {
return result;
}
if let Some(result) = try_create_cloud_slug_chat_model_from_string(
@@ -265,8 +266,7 @@ pub(super) fn create_chat_model_from_string_with_model_id_inner(
&resolved,
config,
&EgressLedger::none(),
- )
- {
+ ) {
return result;
}
}
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
index 6c51247ea1..ad6d7d4836 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
@@ -338,16 +338,15 @@ pub(super) fn try_create_cloud_slug_chat_model_from_string_with_native_tools(
}
let model_override =
(!effective_model.trim().is_empty()).then_some(effective_model.as_str());
- let (backend, pinned_model) =
- match resolve_managed_backend_with_model_override(
- role,
- config,
- model_override,
- egress,
- ) {
- Ok(result) => result,
- Err(error) => return Some(Err(error)),
- };
+ let (backend, pinned_model) = match resolve_managed_backend_with_model_override(
+ role,
+ config,
+ model_override,
+ egress,
+ ) {
+ Ok(result) => result,
+ Err(error) => return Some(Err(error)),
+ };
return Some(Ok((
Arc::new(backend.with_native_tool_calling(native_tool_calling)),
pinned_model,
diff --git a/crates/openhuman-core/src/inference/provider/factory/turn_model.rs b/crates/openhuman-core/src/inference/provider/factory/turn_model.rs
index 6c8f3df1be..4c6830b62c 100644
--- a/crates/openhuman-core/src/inference/provider/factory/turn_model.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/turn_model.rs
@@ -151,14 +151,12 @@ pub(super) fn create_turn_chat_model_with_native_tools_and_route_inner(
return result
.map(|(chat, resolved_model)| (chat, provider_name.clone(), resolved_model));
}
- if let Some(result) =
- try_create_cloud_slug_chat_model_with_native_tools(
- role,
- config,
- native_tool_calling,
- egress,
- )
- {
+ if let Some(result) = try_create_cloud_slug_chat_model_with_native_tools(
+ role,
+ config,
+ native_tool_calling,
+ egress,
+ ) {
return result
.map(|(chat, resolved_model)| (chat, provider_name.clone(), resolved_model));
}