Skip to content

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

feat(tool_output): consume raw fetch entry unconditionally

Steven Enamakel3cebf56f0680
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 e2e163b68a..585e77dff4 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_output.rs
@@ -213,6 +213,13 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext> for Too
// compacts it, and the byte budget persists it as a *new* artifact with
// the same bounded preview — a loop that never reaches the data (#6284).
// Serve it verbatim, one bounded page at a time.
+ // Consumed unconditionally so the entry cannot outlive its call, even on
+ // the artifact-read early return below.
+ let raw_fetch = self
+ .raw_fetches
+ .lock()
+ .ok()
+ .is_some_and(|mut raw| raw.remove(&call_id));
let artifact_read = self
.artifact_reads
.lock()