Skip to content

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

refactor(tinyagents): conditionally apply model budget control

Steven Enamakel402f2b5ed182
diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
index 431c596981..ce212b6148 100644
--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs
@@ -144,11 +144,17 @@ impl HarnessPayloadSummarizer<OpenHumanRunContext> for SubagentPayloadSummarizer
);
let provider_model: Arc<dyn tinyinference_llm::model::ChatModel<()>> =
Arc::new(provider_model);
- let provider_model = super::budget::ModelBudget::control(
- provider_model,
- child_context.data.model_budget.as_ref(),
- child_context.data.dispatch_admission.clone(),
- );
+ let provider_model = if child_context.data.model_budget.is_some()
+ || child_context.data.dispatch_admission.is_some()
+ {
+ super::budget::ModelBudget::control(
+ provider_model,
+ child_context.data.model_budget.as_ref(),
+ child_context.data.dispatch_admission.clone(),
+ )
+ } else {
+ provider_model
+ };
// Unary, never streaming: a streaming child would publish the
// internal summary to the user as parent `TextDelta`s.
Ok(run_unary_summary(