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(tinyagents): remove unused call id tracking and cost enrichment
Steven Enamakeldf4ad2e6e9f4
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs b/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rsindex 56309b1a54..d679d0242d 100644--- a/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs+++ b/crates/openhuman-core/src/agent/tinyagents/observability/event_bridge.rs@@ -17,14 +17,6 @@ use super::bridge_types::{ProviderUsageCarry, SubagentScope, ToolFailureMap, Toouse tinyagents_harness::events::{CallDedupe, IterationCursor, OrderedSender};use tinyagents_harness::events::AgentEvent;-fn valid_provider_id(value: &str) -> bool {- !value.is_empty()- && value.len() <= 64- && value- .chars()- .all(|character| character.is_ascii_alphanumeric() || matches!(character, '_' | '.' | ':' | '-'))-}-#[derive(Default)]pub(super) struct BridgeState {pub(super) input_tokens: u64,@@ -343,23 +335,6 @@ impl OpenhumanEventBridge {},};let call_cost = cost.usd();- if let tinyagents_harness::cost::CallCost::Estimated(estimated_cost_usd) = cost {- if let Some(call_id) = self- .call_ids- .lock()- .unwrap_or_else(std::sync::PoisonError::into_inner)- .get(&iteration)- .cloned()- {- self.emit_generation_enrichment(- call_id,- tinyagents_harness::events::GenerationEnrichment {- estimated_cost_usd: Some(estimated_cost_usd),- ..Default::default()- },- );- }- }// The context window + cache-creation/reasoning breakdown only exist on// the carried provider usage (the crate `Usage` mapping drops them); fall// back to the catalogue window and the crate token counts when absent.diff --git a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rsindex 2728c40858..709da2c88e 100644--- a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs+++ b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs@@ -16,14 +16,6 @@ impl EventListener for OpenhumanEventBridge {match &record.event {AgentEvent::ModelStarted { call_id, .. } => {let iteration = tinyagents_harness::events::advance_iteration(&self.cursor);- self.call_ids- .lock()- .unwrap_or_else(std::sync::PoisonError::into_inner)- .insert(iteration, call_id.clone());- self.emit_generation_enrichment(- call_id.clone(),- self.base_generation_enrichment(),- );match &self.scope {None => self.send(AgentProgress::IterationStarted {iteration,@@ -151,10 +143,6 @@ impl EventListener for OpenhumanEventBridge {..} => {let iteration = self.iteration();- self.call_ids- .lock()- .unwrap_or_else(std::sync::PoisonError::into_inner)- .remove(&iteration);let usage = usage.unwrap_or_default();// Prefer the figures `record_usage` resolved for this call// (charged>estimate cost + carried cache/reasoning breakdown —