Skip to content

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

fix(agent): handle tool output with no content gracefully

Steven Enamakel590705604db2
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
index 3e69d86bc8..8beebee4ca 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
@@ -143,7 +143,7 @@ impl ToolOutputMiddleware {
&self,
ctx: &RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>,
tool_name: &str,
- bytes: usize,
+ content: &str,
) -> Option<Result<GenerateTicket, ()>> {
let summarizer = self.payload_summarizer.as_ref()?;
let threshold_tokens = self
@@ -151,7 +151,7 @@ impl ToolOutputMiddleware {
.as_ref()
.map(|config| config.context.summarizer_payload_threshold_tokens)
.unwrap_or_default();
- if threshold_tokens == 0 || estimate_output_tokens(bytes) < threshold_tokens as u64 {
+ if threshold_tokens == 0 || estimate_output_tokens(content) < threshold_tokens as u64 {
return None;
}
match summarizer.prepare(ctx) {