Skip to content

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

chore: reformat long lines and reorder imports across tinyagents middleware

Steven Enamakel95ecf0499607
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
index f99aea487d..3b8d35f94e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
@@ -7,7 +7,9 @@ use std::collections::HashSet;
use std::sync::Arc;
use tinyagents_harness::runtime::AgentHarness;
-use tinyagents_registry::{CapabilityRegistry, ComponentKind, RegistryDiagnostic, RegistrySnapshot};
+use tinyagents_registry::{
+ CapabilityRegistry, ComponentKind, RegistryDiagnostic, RegistrySnapshot,
+};
use crate::agent::tinyagents::tools::{EarlyExitHook, SharedToolAdapter};
use crate::agent::tinyagents::turn_policy::is_subagent_spawn_or_delegate_tool;
@@ -34,7 +36,12 @@ pub(super) fn register_turn_tools_and_agents(
early_exit_set: &HashSet<&str>,
early_exit_hook: Option<&EarlyExitHook>,
is_subagent_run: bool,
-) -> (usize, Vec<String>, Vec<RegistryDiagnostic>, RegistrySnapshot) {
+) -> (
+ usize,
+ Vec<String>,
+ Vec<RegistryDiagnostic>,
+ RegistrySnapshot,
+) {
if let Some(set) = allowed {
if set.is_empty() {
tracing::warn!(
@@ -174,5 +181,10 @@ pub(super) fn register_turn_tools_and_agents(
"[registry] per-turn capability projection summary"
);
- (tool_count, candidate_names, registry_diagnostics, registry_snapshot)
+ (
+ tool_count,
+ candidate_names,
+ registry_diagnostics,
+ registry_snapshot,
+ )
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs
index 0655c2d68d..a9222d0e56 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs
@@ -109,8 +109,9 @@ impl ToolMiddleware<()> for ApprovalSecurityMiddleware {
);
let summary = summarize_action(&call.name, &call.arguments);
let redacted = redact_args(&call.arguments);
- let (outcome, request_id) =
- gate.intercept_audited(approval_name.as_ref(), &summary, redacted).await;
+ let (outcome, request_id) = gate
+ .intercept_audited(approval_name.as_ref(), &summary, redacted)
+ .await;
match outcome {
GateOutcome::Deny { reason } => {
tracing::warn!(
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/artifact_index_toc.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/artifact_index_toc.rs
index 75df7ad710..f1a4e8f007 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/artifact_index_toc.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/artifact_index_toc.rs
@@ -128,10 +128,9 @@ impl Middleware<()> for ArtifactIndexTocMiddleware {
_state: &(),
request: &mut ModelRequest,
) -> TaResult<()> {
- let Some(store) = ctx
- .stores
- .get(crate::agent::harness::tool_result_artifacts::TINYAGENTS_TOOL_RESULT_ARTIFACT_STORE)
- else {
+ let Some(store) = ctx.stores.get(
+ crate::agent::harness::tool_result_artifacts::TINYAGENTS_TOOL_RESULT_ARTIFACT_STORE,
+ ) else {
return Ok(());
};
// A read failure and an empty index produce the same contents list —
@@ -162,10 +161,7 @@ impl Middleware<()> for ArtifactIndexTocMiddleware {
let Ok(Some(entry)) = store.get(ARTIFACT_INDEX_NAMESPACE, key).await else {
continue;
};
- let tool = entry
- .get("tool")
- .and_then(|v| v.as_str())
- .unwrap_or("tool");
+ let tool = entry.get("tool").and_then(|v| v.as_str()).unwrap_or("tool");
let Some(path) = entry.get("artifact_path").and_then(|v| v.as_str()) else {
continue;
};
@@ -210,8 +206,9 @@ impl Middleware<()> for ArtifactIndexTocMiddleware {
// half the fix: the fixed text is ~118 tokens and the floor a small
// window gets is 64, so the message still cleared its share with no
// rows in it.
- let compact =
- format!("_{total} tool result(s) were written to disk — ask by tool name to locate one._");
+ let compact = format!(
+ "_{total} tool result(s) were written to disk — ask by tool name to locate one._"
+ );
if self.input_budget > 0 {
let cap = self.input_budget.max(1);
let fixed = estimate_text_tokens(&header).saturating_add(FOOTER_ALLOWANCE);
@@ -235,8 +232,7 @@ impl Middleware<()> for ArtifactIndexTocMiddleware {
// for the omitted-count line, which cannot be measured before the
// count is known — it is one short sentence, and reserving it when
// nothing is omitted only spends a row.
- let mut used: u64 =
- estimate_text_tokens(&header).saturating_add(FOOTER_ALLOWANCE);
+ let mut used: u64 = estimate_text_tokens(&header).saturating_add(FOOTER_ALLOWANCE);
let mut kept = 0usize;
for row in &rows {
used = used.saturating_add(estimate_text_tokens(row));
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs
index 6d650694a6..d92ab859be 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/credential_scrub.rs
@@ -86,8 +86,7 @@ impl ToolMiddleware<()> for CredentialScrubMiddleware {
}
if let Some(err) = result.error.as_ref() {
- let scrubbed_err =
- crate::agent::harness::credentials::scrub_credentials(err);
+ let scrubbed_err = crate::agent::harness::credentials::scrub_credentials(err);
if &scrubbed_err != err {
tracing::warn!(
tool = %tool_name,
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs
index 67239d7a57..d6c059bad0 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs
@@ -22,9 +22,7 @@ pub(crate) struct EmbedderToolHooksMiddleware {
}
impl EmbedderToolHooksMiddleware {
- pub(crate) fn new(
- hooks: Vec<std::sync::Arc<dyn crate::agent::hooks::ToolHook>>,
- ) -> Self {
+ pub(crate) fn new(hooks: Vec<std::sync::Arc<dyn crate::agent::hooks::ToolHook>>) -> Self {
Self {
hooks,
arguments_by_call_id: std::sync::Mutex::new(std::collections::HashMap::new()),
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/final_call_wrap_up.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/final_call_wrap_up.rs
index 3ca0ea38cb..598d6c7f35 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/final_call_wrap_up.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/final_call_wrap_up.rs
@@ -198,7 +198,11 @@ impl Middleware<()> for FinalCallWrapUpMiddleware {
let TaMessage::Tool(tool) = message else {
continue;
};
- if tool.content.iter().any(|block| !matches!(block, ContentBlock::Text(_))) {
+ if tool
+ .content
+ .iter()
+ .any(|block| !matches!(block, ContentBlock::Text(_)))
+ {
continue;
}
let body: String = tool
@@ -263,8 +267,7 @@ impl Middleware<()> for FinalCallWrapUpMiddleware {
request
.messages
.push(TaMessage::user(self.instruction.to_string()));
- self.fired
- .store(true, std::sync::atomic::Ordering::SeqCst);
+ self.fired.store(true, std::sync::atomic::Ordering::SeqCst);
Ok(())
}
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/loop_guards.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/loop_guards.rs
index dd04ce8013..977da0dea6 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/loop_guards.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/loop_guards.rs
@@ -167,7 +167,11 @@ pub(crate) fn recoverable_identical_halt_summary(tool: &str, count: u32, result:
/// Halt summary when many recoverable-looking failures pile up with no progress.
/// Ported from the legacy loop.
-pub(crate) fn recoverable_no_progress_halt_summary(consecutive: u32, tool: &str, result: &str) -> String {
+pub(crate) fn recoverable_no_progress_halt_summary(
+ consecutive: u32,
+ tool: &str,
+ result: &str,
+) -> String {
format!(
"Stopping: {consecutive} recoverable-looking tool failures happened in a row with no \
successful progress. Last error (from `{tool}`):\n{}\n\nThe turn is still bounded by the \
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/memory_protocol.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/memory_protocol.rs
index 582b898b94..a487a0a00b 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/memory_protocol.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/memory_protocol.rs
@@ -24,17 +24,13 @@ use tinyinference::tool::ToolCall as TaToolCall;
/// neither creates an entry nor obliges an index update. Non-memory tools are
/// ignored, so this is a no-op on turns that never touch memory.
pub struct MemoryProtocolMiddleware {
- tracker:
- std::sync::Mutex<crate::agent::harness::memory_protocol::MemoryProtocolTracker>,
+ tracker: std::sync::Mutex<crate::agent::harness::memory_protocol::MemoryProtocolTracker>,
/// call_id → classified op, captured in `before_tool` (the tool result carries
/// no arguments, yet `update_memory_md` and `memory_tree` can only be
/// classified from their `file` / `mode` argument). Correlated back by
/// `result.call_id` in `after_tool`.
pending_ops: std::sync::Mutex<
- std::collections::HashMap<
- String,
- crate::agent::harness::memory_protocol::MemoryOp,
- >,
+ std::collections::HashMap<String, crate::agent::harness::memory_protocol::MemoryOp>,
>,
}
@@ -70,10 +66,8 @@ impl Middleware<()> for MemoryProtocolMiddleware {
// Classify with the arguments in hand (the result won't carry them) and
// stash the op keyed by call id. Only memory-relevant ops are stored, so
// the map stays empty on turns that never touch memory.
- let op = crate::agent::harness::memory_protocol::classify_memory_op(
- &call.name,
- &call.arguments,
- );
+ let op =
+ crate::agent::harness::memory_protocol::classify_memory_op(&call.name, &call.arguments);
if op != crate::agent::harness::memory_protocol::MemoryOp::Other {
if let Ok(mut ops) = self.pending_ops.lock() {
ops.insert(call.id.clone(), op);
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/repeat_progress.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/repeat_progress.rs
index 8fc06b18a6..fcbe059306 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/repeat_progress.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/repeat_progress.rs
@@ -75,7 +75,10 @@ pub(crate) struct RepeatProgressMiddleware {
}
impl RepeatProgressMiddleware {
- pub(crate) fn new(handle: SteeringHandle, halt_summary: crate::agent::tinyagents::HaltSummarySlot) -> Self {
+ pub(crate) fn new(
+ handle: SteeringHandle,
+ halt_summary: crate::agent::tinyagents::HaltSummarySlot,
+ ) -> Self {
Self {
handle,
halt_summary,
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs
index fbd4914cb1..7a5dfaf121 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_outcome_capture.rs
@@ -58,9 +58,10 @@ impl Middleware<()> for ToolOutcomeCaptureMiddleware {
// preserved, and already-structured `ToolPolicyMiddleware` denials (which
// carry a `Workaround:` suffix) are left untouched. This runs before
// classification below, which still recognises the preserved marker.
- if let Some(enriched) =
- crate::agent::tinyagents::policy_denial::maybe_enrich_policy_block(&result.name, &result.content)
- {
+ if let Some(enriched) = crate::agent::tinyagents::policy_denial::maybe_enrich_policy_block(
+ &result.name,
+ &result.content,
+ ) {
tracing::debug!(
tool = result.name.as_str(),
"[tinyagents::mw] enriched raw security-policy block with workaround + relay"
@@ -91,9 +92,7 @@ impl Middleware<()> for ToolOutcomeCaptureMiddleware {
std::borrow::Cow::Owned(format!("{error}\n{}", result.content))
};
let timed_out = combined.contains("timed out");
- Some(crate::tools::status::classify(
- &combined, timed_out,
- ))
+ Some(crate::tools::status::classify(&combined, timed_out))
};
if let Ok(mut map) = self.failure_map.lock() {
// Keep duration + rendered output size as a compatibility fallback
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs
index 646149e5f0..99a02ca5e3 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs
@@ -75,9 +75,7 @@ impl ToolPolicyMiddleware {
fn callable_delegates_for(&self, owners: &[&str]) -> Vec<String> {
let mut found: Vec<String> = Vec::new();
for tool in self.tool_sets.iter().flat_map(|set| set.iter()) {
- let Some(target) =
- crate::tools::traits::delegation_target(tool.as_ref())
- else {
+ let Some(target) = crate::tools::traits::delegation_target(tool.as_ref()) else {
continue;
};
if !owners.contains(&target) {
@@ -233,7 +231,6 @@ impl ToolPolicyMiddleware {
}
None
}
-
}
impl ToolPolicyMiddleware {
@@ -246,9 +243,7 @@ impl ToolPolicyMiddleware {
.iter()
.flat_map(|set| set.iter())
.find(|t| t.name() == name)
- .and_then(|t| {
- crate::tools::traits::generated_runtime_context(t.as_ref(), args)
- })
+ .and_then(|t| crate::tools::traits::generated_runtime_context(t.as_ref(), args))
}
}
@@ -265,9 +260,7 @@ impl ToolMiddleware<()> for ToolPolicyMiddleware {
call: TaToolCall,
next: ToolHandler<'_, (), ()>,
) -> TaResult<MiddlewareToolOutcome> {
- use crate::agent::tool_policy::{
- ToolCallContext, ToolPolicyDecision, ToolPolicyRequest,
- };
+ use crate::agent::tool_policy::{ToolCallContext, ToolPolicyDecision, ToolPolicyRequest};
// Channel-permission ceiling first (session deny + per-call permission
// level), mirroring the engine order in `agent_tool_exec`.
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
index 901aa82625..a276639f32 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
@@ -97,8 +97,7 @@ impl Middleware<()> for TranscriptSnapshotMiddleware {
_state: &(),
request: &mut ModelRequest,
) -> TaResult<()> {
- let history =
- crate::agent::message_convert::messages_to_history(&request.messages);
+ let history = crate::agent::message_convert::messages_to_history(&request.messages);
if let Ok(mut guard) = self.sink.lock() {
*guard = history;
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
index ae9b6b7908..ee2caf3ef9 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
@@ -1,4 +1,3 @@
-use super::*;
use super::approval::approval_tool_name;
use super::artifact_index_toc::{FOOTER_ALLOWANCE, NO_WINDOW_ALLOWANCE};
use super::message_trim::{estimate_message_tokens, estimate_text_tokens, IMAGE_MARKER_TOKEN_COST};
@@ -7,6 +6,7 @@ use super::tool_output::{
is_compaction_exempt, is_truncation_exempt, COMPACTION_EXEMPT_TOOLS, SAMPLING_TOOLS,
};
use super::turn_context::DEFAULT_TOOL_RESULT_BUDGET_BYTES;
+use super::*;
use serde_json::json;
use std::collections::HashMap;
use std::sync::Arc;
@@ -411,11 +411,11 @@ fn embedder_hook_mw(
})])
}
-#[path = "middleware_tool_output_tests.rs"]
-mod tool_output_tests;
#[path = "middleware_loop_guard_tests.rs"]
mod loop_guard_tests;
-#[path = "middleware_wrap_up_toc_tests.rs"]
-mod wrap_up_toc_tests;
+#[path = "middleware_tool_output_tests.rs"]
+mod tool_output_tests;
#[path = "middleware_tool_policy_tests.rs"]
mod tool_policy_tests;
+#[path = "middleware_wrap_up_toc_tests.rs"]
+mod wrap_up_toc_tests;
diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rs
index a1a9af5ea7..33872749ef 100644
--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs
@@ -79,8 +79,8 @@ pub use resolved_route::{
};
pub(crate) use run_cancellation_context::{current_run_cancellation, with_run_cancellation};
pub(crate) use topology::all_graph_topologies;
-pub(crate) use turn_models::TurnModels;
pub use turn_models::TurnModelSource;
+pub(crate) use turn_models::TurnModels;
pub(crate) use turn_outcome::{TinyagentsTurnOutcome, ToolCallOutcome};
pub(crate) use turn_policy::{agent_turn_wall_clock_ms, ToolPolicyEnforcement};
#[cfg(test)]
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs b/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs
index e23cef9877..22946e0f46 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs
@@ -442,4 +442,3 @@ impl OpenhumanEventBridge {
)
}
}
-
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs b/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
index ca6c86a151..abb6d8a5a6 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_models.rs
@@ -13,14 +13,12 @@ pub(crate) fn tinyagents_depth_error(
) -> Option<crate::agent::harness::subagent_runner::SubagentRunError> {
match err {
tinyagents_harness::TinyAgentsError::SubAgentDepth(max_depth)
- | tinyagents_harness::TinyAgentsError::RecursionLimit(max_depth) => {
- Some(
- crate::agent::harness::subagent_runner::SubagentRunError::SpawnDepthExceeded {
- attempted_depth: max_depth.saturating_add(1),
- max_depth: *max_depth,
- },
- )
- }
+ | tinyagents_harness::TinyAgentsError::RecursionLimit(max_depth) => Some(
+ crate::agent::harness::subagent_runner::SubagentRunError::SpawnDepthExceeded {
+ attempted_depth: max_depth.saturating_add(1),
+ max_depth: *max_depth,
+ },
+ ),
_ => None,
}
}
@@ -328,10 +326,7 @@ impl TurnModelSource {
}
let provider_string = self.crate_native.as_ref().map(|source| {
source.primary_override.clone().unwrap_or_else(|| {
- crate::inference::provider::provider_for_role(
- &source.role,
- &source.config,
- )
+ crate::inference::provider::provider_for_role(&source.role, &source.config)
})
});
let local_kind = provider_string
@@ -354,10 +349,7 @@ impl TurnModelSource {
}
self.crate_native.as_ref().is_some_and(|source| {
let provider = source.primary_override.clone().unwrap_or_else(|| {
- crate::inference::provider::provider_for_role(
- &source.role,
- &source.config,
- )
+ crate::inference::provider::provider_for_role(&source.role, &source.config)
});
crate::inference::local::profile::is_local_provider_string(&provider)
})
@@ -407,9 +399,8 @@ impl TurnModelSource {
let provider_string = cn.primary_override.clone().unwrap_or_else(|| {
crate::inference::provider::provider_for_role(&cn.role, &cn.config)
});
- let is_local = crate::inference::local::profile::is_local_provider_string(
- &provider_string,
- );
+ let is_local =
+ crate::inference::local::profile::is_local_provider_string(&provider_string);
let provider_id = if provider_string == "openhuman"
|| provider_string.is_empty()
|| provider_string == "cloud"
@@ -458,9 +449,15 @@ impl TurnModelSource {
}
if let Some(cn) = &self.crate_native {
let built = match cn.primary_override.as_deref() {
- Some(ps) => crate::inference::provider::factory::create_turn_chat_model_from_string(
- &cn.role, ps, &cn.config, model, temperature,
- ),
+ Some(ps) => {
+ crate::inference::provider::factory::create_turn_chat_model_from_string(
+ &cn.role,
+ ps,
+ &cn.config,
+ model,
+ temperature,
+ )
+ }
None => crate::inference::provider::factory::create_turn_chat_model(
&cn.role,
&cn.config,
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs b/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
index 6e1cd1de7c..f1f3b9c42c 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_run_finalize.rs
@@ -16,7 +16,9 @@ use crate::agent::progress::AgentProgress;
use crate::agent::tinyagents::journal::TurnJournal;
use crate::agent::tinyagents::observability::{self, OpenhumanEventBridge, SubagentScope};
use crate::agent::tinyagents::tools::EarlyExitHook;
-use crate::agent::tinyagents::turn_outcome::{HaltSummarySlot, TinyagentsTurnOutcome, ToolOutcomeSink};
+use crate::agent::tinyagents::turn_outcome::{
+ HaltSummarySlot, TinyagentsTurnOutcome, ToolOutcomeSink,
+};
/// Assemble the [`TinyagentsTurnOutcome`] for a run that returned
/// successfully: stamp the durable journal's completed status, surface
@@ -167,9 +169,8 @@ pub(super) async fn finalize_turn_outcome(
let input = run.usage.usage.input_tokens;
let output = run.usage.usage.output_tokens;
let cached = run.usage.usage.cache_read_tokens;
- let charged = crate::platform::cost::catalog::estimate_cost_usd(
- model, input, output, cached,
- );
+ let charged =
+ crate::platform::cost::catalog::estimate_cost_usd(model, input, output, cached);
crate::agent::tinyagents::turn_outcome::record_unobserved_turn_usage(
model, input, output, cached, charged,
);
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
index 64d7224bbe..4cbbfc342b 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
@@ -272,10 +272,12 @@ pub(crate) async fn run_turn_via_tinyagents_shared(
// generated tools, dangling alias, etc.) aborts the turn instead of silently
// resolving to an unintended component while a provider call is in flight.
if !registry_diagnostics.is_empty() {
- let (errors, warnings): (Vec<&tinyagents_registry::RegistryDiagnostic>, Vec<&tinyagents_registry::RegistryDiagnostic>) =
- registry_diagnostics
- .iter()
- .partition(|d| matches!(d.severity, DiagnosticSeverity::Error));
+ let (errors, warnings): (
+ Vec<&tinyagents_registry::RegistryDiagnostic>,
+ Vec<&tinyagents_registry::RegistryDiagnostic>,
+ ) = registry_diagnostics
+ .iter()
+ .partition(|d| matches!(d.severity, DiagnosticSeverity::Error));
for diag in &warnings {
tracing::warn!(
kind = diag.kind.as_str(),